We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Inserts for integer primary keys use SQLite to generate the actual key, e.g.
CREATE TABLE person ( person_id INTEGER PRIMARY KEY NOT NULL, name TEXT );
This is generated into:
struct Person { var id : Int var name : String? init(id: Int, name: String? = nil) {...} }
Which is a little inconvenient for inserts:
var person = Person(id: 0, name: "Donald") person = try db.insert(person)
(the return value of the insert will have copy of the record with the proper db assigned primary key).
Maybe this should be some, ideally unlikely, obscure default value, like:
init(id: Int = MyDB.defaultIntPrimaryKey, name: String? = nil) { ... } extension MyDB { static let MyDB.defaultIntPrimaryKey : Int = -0xDEADBEEF }
Not quite sure whether that is actually good or not, maybe it is OK as an optional generation option.
The text was updated successfully, but these errors were encountered:
Implemented, using Int.min
Int.min
Sorry, something went wrong.
helje5
No branches or pull requests
Inserts for integer primary keys use SQLite to generate the actual key, e.g.
This is generated into:
Which is a little inconvenient for inserts:
(the return value of the insert will have copy of the record with the proper db assigned primary key).
Maybe this should be some, ideally unlikely, obscure default value, like:
Not quite sure whether that is actually good or not, maybe it is OK as an optional generation option.
The text was updated successfully, but these errors were encountered: