98

Learned this from a friend. The types are null, integer, real, text, and blob. My friend describes them thusly:

  • Null stores nothing, but like, actively nothing, as opposed to the absence of a thing.
  • Integer is a signed integer, up to 8 bytes.
  • Real is always an 8-byte float.
  • Text is an arbitrary-length UTF-8 or UTF-16.
  • Blob is an arbitrary-length anything-else. But I hope you remembered what you put there. Because it sure isn't gonna tell you. Oh, and it doesn't have strong typing, so if you ask for it back as an integer, it'll quite happily give you it back as an integer, especially if that doesn't make sense!
you are viewing a single comment's thread
view the rest of the comments
[-] packadal@beehaw.org 3 points 8 months ago

Have you ever tried storing a string in an INTEGER column ?

Due to a bug it happened in a software I worked on.

SQLite just stores the string. I have no idea if the column type has any real effect on storage as far as SQLite is concerned.

this post was submitted on 24 Dec 2023
98 points (96.2% liked)

Today I learned

7586 readers
2 users here now

founded 4 years ago
MODERATORS