Writing additional code to check things that you'd reasonably expect the DB to handle is a slippery slope. It can work well if you are going into it with an application geared towards that mindset and behavior, it works pretty bad introducing it into an existing codebase that historically works a more strict way.
Yeah don't get me wrong, I'd prefer it if SQLite took care of it. But I don't know of any embedded DBs that do loads of type-checking. Apart from SQLite they all seem to be key value stores that operate on sequences of bytes.
Re:SQLite Is Dynamically Typed (2020)
by john-shaffer on Thursday August 05, 2021 @02:39AM
(#28070587)
It's pretty easy to run embedded postgres on the JVM: https://github.com/opentable/otj-pg-embedded
The defaults create a temporary DB which is useful for dev & tests, but a pair of calls to .setCleanDataDirectory(false) and .setDataDirectory("...") will change that.
If you don't like the default postgres version, you may select one from https://search.maven.org/search?q=io.zonky.test.postgres or include your own postgres binary.
Re:SQLite Is Dynamically Typed (2020)
by formerly_proven on Thursday August 05, 2021 @03:05AM
(#28070739)
You can put check constraints into your schema to make sure no one puts strings in your integer columns (for example). If you have an ORM you likely can automatically make it generate check constraints for each column based on the declared properties.
> But I don't know of any embedded DBs that do loads of type-checking.
Firebird Embedded: https://www.firebirdsql.org/pdfmanual/html/ufb-cs-embedded.h...
If you've got multiple apps writing to it, you probably have the 'complexity budget' to use postgres.