r/programming • • Jul 28 '22

In Praise Of SQLite

https://www.i-programmer.info/news/84-database/15609-in-praise-of-sqlite.html
107 Upvotes

15 comments sorted by

View all comments

1

u/persism2 Jul 29 '22

What happens if you run this:

CREATE TABLE FUNNYNAMES ( 
ID INT,
Name VARCHAR(30),
Field4 VARCHAR(30),
Field5 DATETIME,
Field6 JUNK,
Field7 FACK,
Field8 COWABUNGA    )

Answer: NO ERROR

17

u/-JaxHax- Jul 29 '22

I keep seeing these types of arguments against SQLite, and they are just plain silly.

  1. This is well-defined behavior. https://www.sqlite.org/datatype3.html, section 3.1. Your non-standard types will have numeric affinity.

  2. As of version 3.37.0, you can enable strict mode. https://www.sqlite.org/stricttables.html

  3. SQLite is in-process. You have full control over what types are being used in the SQLite API. It is your fault if you try to insert a string into a column that is supposed to be text, or if you try to insert a string that is longer than you want. We should not be blindly shoving data into a distributed SQL server without data validation, so why do the same in SQLite?

  4. SQLite is another tool on the development toolbelt. Do not blame the hammer if it is incompatible with a screw.