- Store the date as a huge, wasteful string in ISO8601 format
- Store it as Unix epoch seconds
- Store it as a fractional Julian day
Besides the first one, you have to remember how the date is stored and ensure all client libraries handle the conversion. If you want to view or manipulate the latter 2 formats in SQL, you need to chain a bunch of conversion functions.
This runs on python and works with several backends including SQLite. https://requests-cache.readthedocs.io/en/stable/
SQLite is used in some HPC work.
ISO-8601 datetime strings can easily wreck your L1 cache. Instead of filling an eighth of the cache with a 64-bit value, you wind up filling almost half with a 27-character-long string.
What format works well for hardware caching?
As small as you can tolerate tbh. The game is played by keeping data as small as possible and ensuring that related data has good locality in memory.
The gap between how fast your CPU works and how fast data can be retrieved from RAM is enormous.
This is what we do. Have been storing 100% of our timestamps this way in SQLite for ~8 years now. Using .NET to handle the actual conversion to/from long.
var myTimeUtc = DateTime.UtcNow;
var myTimeUnix = new DateTimeOffset(myTimeUtc).ToUnixTimeSeconds();
var myTimeUtc2 = DateTimeOffset.FromUnixTimeSeconds(myTimeUnix).UtcDateTime;
No drama at all. No weird libraries or utility methods. It's all simple built-ins these days.I am doing something very similar with .NET stack (single file deployments), SQLite and offline scenario...
Please contact me on my username's email (gmail).
Any code (usually one codebase) which looks at dates in a SQLite DB can already easily do these conversions, even at the application-level.
As others have mentioned, SQLite has fairly comprehensive support for JSON. Arrays can be represented as JSON arrays.
Some geometry features are supported through the R*Tree module: https://www.sqlite.org/rtree.html
And I'm not sure what sort of support you'd expect for a UUID type. Depending on how you represent the UUID, it's either a string or a blob -- I can't think of any meaningful operations to perform on a UUID which go beyond basic comparisons.
That's not fair on many levels and reflects harsher on the casual readership hereabouts than yourself.
Your comment is probably rated stellar by the time I hit enter ...
The limited datatypes are so silly, and the limits seem pretty pointless. There's all kinds of weird datatypes, but no unsigned integers?
Of course, SQLite types are a special level of hell, where everything is stringly typed.