Re:Show HN: Sqlkit – Golang SQL package with nested transact...
by kodebrew on Saturday July 13, 2019 @04:45PM
(#20430045)
Yes I think it would insert an empty string. I think all the tests are using uuid's as primary keys, this is a good point -- thanks for raising.
Re:Show HN: Sqlkit – Golang SQL package with nested transact...
by noir_lord on Saturday July 13, 2019 @05:37PM
(#20430329)
That would be horrible if you had other systems that predated and did depend on the null (you could argue they shouldn't do that but well shouldn't and didn't aren't the same thing alas).
Re:Show HN: Sqlkit – Golang SQL package with nested transact...
by caesarshift on Saturday July 13, 2019 @09:48PM
(#20431185)
Why is NULL a bad thing? Sometimes I absolutely want to know if a field is NULL, so i can coalesce to the desired value. I know this is SQL Server specific, since Oracle treats empty strings and NULLs the same, but that approach has always felt wrong to me. Thoughts?
Edit: I see maybe that I should have scrolled down further before posting this. Lots of discussion further down about NULL values.
if I read out a nullable text field and write the same struct back into the database is it going to insert an empty string into that column?
Also related, how would auto incr pk work?