ovid,
@ovid@fosstodon.org avatar

One of the many things I hate about :

sqlite> select typeof(created_at) from customers;
real
text
null
text
text
integer

For a given column, you have no guarantees about its type at all.

manwar,

@ovid really? never came across.

ovid,
@ovid@fosstodon.org avatar

@manwar It's called "type affinity" in . If you have a column defined as "count INTEGER NOT NULL DEFAULT 0", there's nothing to stop you from inserting the value of "foo" into that column.

It's one of the reasons why I strongly recommend not using SQLite to simulate your database in the test suite: the subtle differences in behavior means your test suite might pass, even if your code is going to fail in production.

manwar,

@ovid hard to believe what I just read.

barubary,

@manwar @ovid It's basically dynamic typing. In SQLite, each datum is typed separately and "column types" are more like suggestions.
That said, you can declare your table as strict to make SQLite behave more like other DBs. https://www.sqlite.org/stricttables.html

ovid,
@ovid@fosstodon.org avatar

@manwar Most databases are remarkably bad at handling data. SQLite is even worse! Fortunately, its incredible ease of use makes up for its weaknesses.

mjgardner,
@mjgardner@social.sdf.org avatar

@ovid @manwar “Sometimes when you pull the trigger it explodes at both ends. But on the upside, the safety is very easy to disengage!”

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • everett
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • normalnudes
  • Youngstown
  • Durango
  • slotface
  • ngwrru68w68
  • kavyap
  • mdbf
  • InstantRegret
  • JUstTest
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • Leos
  • anitta
  • modclub
  • khanakhh
  • cubers
  • cisconetworking
  • megavids
  • provamag3
  • tester
  • lostlight
  • All magazines