I find this sad, and I wonder what those too many programs are. Why would one put NULL on PRIMARY KEY?
I find this sad, and I wonder what those too many programs are. Why would one put NULL on PRIMARY KEY?
sqlite4 OTOH seems to be the "let's break things" phase. Probably healthy to have both attitudes at certain stages.
- Providing it's own malloc/free "proxies" to work away with different linked CRT versions (Microsoft) - Prefixing ("namespacing") everything, and not exporting symbols outside of the API - Configuration of the API before it's started, where it makes sense (threading model for example) - Ability to retrieve compilation options back (e.g. how it was compiled and with what features) - many other things
The worst and most common though is the "break all things for no reason at all"...
However, if SQLite never enforced non-NULL behavior then it's certainly possible that along the way some applications could have written an errant record to a database with a NULL primary key (instead of treating it as an error case). And if a "fixed" version of SQLite3 ever shipped, then these previously-valid data files would suddenly become invalid.
Imagine being an app developer and having random customers whose data files suddenly break because the OS happened to upgrade the SQLite3 library to a version that included this fix. I completely understand why the the SQLite maintainers may have decided it wasn't worth the hassle to fix things prior to SQLite4.
I don't think this actually detracts from your point, but, are there cases where that can actually happen? Isn't SQLite always statically linked with the applicaton?
SQLite can be dynamically linked, though static linking is probably more common.
`apt-cache rdepends slite3`
on ubuntu 14.04 packages including the following link to sqlite dynamic packages(this may be partially due to debian heavily discouraging statistically linked packages.
zabbix-proxy-sqlite3
yokadi
uwsgi
usermetricsservice
trove-common
sympa
sqliteman
sisu-sqlite
rt4-db-sqlite
roundcube-sqlite3
redmine-sqlite
ratbox-services-sqlite
postfix-cluebringer-sqlite3
pdns-backend-sqlite3
pbnj
opendnssec-enforcer-sqlite3
lire
krecipes
kamailio-sqlite-modules
inspircd
imms-common
hud-tools
gbrowse
eurephia
dotclear
beancounter
adminer
bacula-director-sqlite3[1] It's slightly more complicated, but it's basically similar.
[2] "zz" might be appropriate to represent an unknown country, but other domains might not have a good default value
Edit: double asterisks messing up my formatting