-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Namespace all of a table’s columns using * #249
Comments
I'm also running into this, the following code: let query = someTable.select(someTable[*]) Throws: The compiler also gives some more info: |
Looks like a regression. If you can avoid |
+1 |
Confirmed this is still happening with the current Swift (2.1.1). Any swift geeks want to take a pass at this? Likely some some syntax change between 1.x and 2.x. The relevant code is https://github.com/stephencelis/SQLite.swift/blob/master/Source/Typed/Query.swift, around line 113: public func select(star: Star) -> Self {
return select([star(nil, nil)])
} Here's a copy-paste playground repo case: import SQLite
let db = try! Connection()
db.trace { print($0) }
let emails = Table("emails")
let to = Expression<String>("to")
let subject = Expression<String?>("subject")
try! db.run(emails.create {t in t.column(to); t.column(subject)} )
try! db.run(emails.insert(to <- "stephen@example.com", subject <- "Hello, world!" ))
let query = emails.select(emails[*])
for row in try db.prepare(query) {
print (row)
} This gives the error:
|
Note the work around for now is to change: let query = emails.select(emails[*]) to let query = emails |
Hello,
after changing to the swift2 branch it is not possible to select all table columns from a join query using [*]:
Are we doing something wrong? According to the documentation this should work as it has been in the trunk version. If we change the [*] to any column name the compile succeeds but we don't want to add every column manually in the code.
Thank you in advance
The text was updated successfully, but these errors were encountered: