[Lazarus] SQLite & DB Aware Components

Lars noreply at z505.com
Mon Dec 5 11:11:50 CET 2016

On Fri, December 2, 2016 9:18 am, Martin Collins via Lazarus wrote:
> The weird thing is that when creating my fields the visual database
> managers did not have the option of VARCHAR only TEXT (plus INTEGER, BLOB,
> REAL & NUMERIC), but I just found I can create a VARCHAR field by
> executing your SQL statement above! Further reading on sqlite seems to
> suggest that VARCHAR isn't really stored that way as SQLite just treats it
> as unlimited TEXT?

SQL lite, is not a database, it is a sloppy untyped dumb text storage
system, that is called a database even though it really is not...

It's perfect for when you need something a little more advanced than plain
text files, but in no way, is it an sql or relational database, even
though it accepts SQL language to access it..

Basically, it's one little step better than using plain text files... and
it is easier to ship than mysql embedded or other tools that require more
complex setups. Actually I haven't looked at mysql embedded recently, to
see what they are up to....  And as we all know mysql has a reputation of
not being a proper relational database either!

But despite sqlite being a poorly typed, weakly typed, basically dumb
database which isn't even a database... It is still a useful tool, and one
step better than Xml files, or plain text storage in plain files.

Whenever choosing sqlite, I always tell myself: remember, SQL is NOT a
relational database even though it claims to be one, so be prepared to use
it carefully, as a dumb text storage system just like plain text files.
With this warning in mind it is a very useful tool.

Fabian Pascal has something to say about it, if anyone claims it's
relational.. or typed...  The typing system in it is a joke, it basically
ignores types. As do plain text files when you save stuff to them.. You
can reinvent your own typing system though by doing careful checks.  When
using sqlite it's almost like a static/strong type programmer choosing to
use a weakly typed programming language with dynamic types: it feels odd
and strange that there is not this sterility involved with proper checks
in place. But that's exactly kind of what like using plain text files is
like... you have to store plain text and do checks at run time for
issues... So sql lite is basically, a plain text organization system. It
is, I repeat, NOT a relational nor an sql database... And Fabian Pascal
can say it much better than I can with his attack on it.

Still, a useful tool: just be warned.

More information about the Lazarus mailing list