Pavel Korytov :emacs:☮️ on Nostr: I've decided to do a project with #sqlite in #emacs. It's been a few years since I ...
I've decided to do a project with #sqlite in #emacs. It's been a few years since I used an RDBMS without an ORM.
SQLite is so weird in some ways:
- Foreign keys are disabled by default. You have to enable them on every connection;
- Arbitrary datatype names are allowed, which are implicitly cast to 5 "affinities". E.g., the name contains "int", therefore INTEGER.
- ...but you can make tables STRICT to disable that
- NULL values are distinct for UNIQUE constraints
- All joins are nested loops, which are executed in the order they are written in the query. Beware
Also, no transactional DDL, which I expected.
#sql
Published at
2024-11-06 06:48:37Event JSON
{
"id": "93e0fa01738c04b0282918d6f90c1791ac2824333785b4b9eb88b4b53fee5d56",
"pubkey": "a0beb2d46e7c459f153950cf3af3c6e29ba1d316d08d9e92c9317c0687c99b55",
"created_at": 1730875717,
"kind": 1,
"tags": [
[
"t",
"sqlite"
],
[
"t",
"emacs"
],
[
"t",
"sql"
],
[
"proxy",
"https://mastodon.bsd.cafe/users/sqrtminusone/statuses/113434670999041676",
"activitypub"
]
],
"content": "I've decided to do a project with #sqlite in #emacs. It's been a few years since I used an RDBMS without an ORM.\n\nSQLite is so weird in some ways:\n- Foreign keys are disabled by default. You have to enable them on every connection;\n- Arbitrary datatype names are allowed, which are implicitly cast to 5 \"affinities\". E.g., the name contains \"int\", therefore INTEGER.\n - ...but you can make tables STRICT to disable that\n- NULL values are distinct for UNIQUE constraints\n- All joins are nested loops, which are executed in the order they are written in the query. Beware\n\nAlso, no transactional DDL, which I expected.\n\n#sql",
"sig": "13a81e96a540acc9ccfc4ed669281959488b2bcc5f12fa0fc90c3d5829fe097f6201f885008d8cfadc565b1045fd3e0c3d0dc4f8fcfe9e6a58b3d1cc671bf7e8"
}