Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix create/drop index functions #666

Closed
wants to merge 5 commits into from
Closed

fix create/drop index functions #666

wants to merge 5 commits into from

Conversation

kireev4art
Copy link

According to documentation I can do this:

try db.run(users.createIndex(email, ifNotExists: true))
// CREATE INDEX IF NOT EXISTS "index_users_on_email" ON "users" ("email")

and this:

try db.run(users.createIndex(email, ifNotExists: true))
// CREATE INDEX IF NOT EXISTS "index_users_on_email" ON "users" ("email")

But in fact:

import SQLite

let table = Table("table")
let field = Expression<Int64>("field")
table.createIndex(field, unique: true, ifNotExists: true)
// error: cannot convert value of type 'Expression<Int64>' to expected argument type '[Expressible]'
// table.createIndex(field, unique: true, ifNotExists: true)
table.dropIndex(field, ifExists: true)
// error: MyPlayground.playground:6:17: error: cannot convert value of type 'Expression<Int64>' to expected argument type '[Expressible]'
// table.dropIndex(field, ifExists: true)

So I removed:

public func createIndex(_ columns: Expressible...) -> String
public func dropIndex(_ columns: Expressible...) -> String

and changed:

public func createIndex(_ columns: [Expressible], unique: Bool = false, ifNotExists: Bool = false) -> String
public func dropIndex(_ columns: [Expressible], ifExists: Bool = false) -> String

to:

public func dropIndex(_ columns: Expressible..., ifExists: Bool = false) -> String
public func dropIndex(_ columns: Expressible..., ifExists: Bool = false) -> String

@kireev4art
Copy link
Author

iOS version was updated to solve build error:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:10.3, name:iPhone 6s }
The requested device could not be found because no available devices matched the request.

But now there is a new problem that I don't really understand.
So, anyone, please look at travis logs.

@kireev4art kireev4art closed this Jun 13, 2017
@kireev4art kireev4art reopened this Jun 13, 2017
@jberkel
Copy link
Collaborator

jberkel commented Jun 16, 2017

@kireev165 if you rebase against master it should work

@kireev4art
Copy link
Author

@jberkel thanks. it seems that everything fine now

@jberkel
Copy link
Collaborator

jberkel commented Sep 16, 2017

applied: ac52569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants