You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
db.exec(sql"insert into data (name) values (?)", name)
the name can be null or some(value), is there any facility around this optional concept so we can deal with some(value) or none in both case without overhead of writing different sql string?
The text was updated successfully, but these errors were encountered:
I just use NOT NULL then forget about the possibility of it being null.
I know that null can give a tiny performance improvement, but it does not worth the risks,
like theres a lot of other things that can be improved for performance in your project than using nulls everywhere,
makes me remember of then string and seq was null on Nim, but is not null anymore and people use them just fine.
At the time of writing it, Nim's opinion was to not use nulls in database stuff anyway.
If theres interests for possibly null values and fields, then it can be added,
I dont know how the design would be, or how the implementation would be, but Pull Requests welcome.
I understand, but kinda the same happens with other ORM,
like if you have a DB built on manual raw SQL and plug a Django in it,
youll see Django using random names for stuff, not understanding prepared SQL, using too big data types, etc.
But this is something that can be improved in this project. 🙂:+1:
For the following statement using db_postgres:
db.exec(sql"insert into data (name) values (?)", name)
the name can be null or some(value), is there any facility around this optional concept so we can deal with some(value) or none in both case without overhead of writing different sql string?
The text was updated successfully, but these errors were encountered: