[Lazarus] Problem with zeos and sqlite-3

Michael Van Canneyt michael at freepascal.org
Sat Feb 16 13:28:25 CET 2013



On Sat, 16 Feb 2013, TonyMc wrote:

> On Fri, 15 Feb 2013 13:43:21 +0100 (CET), you wrote:
>
>
>> You should use a real database instead of sqlite.
>> sqlite is good only for storing strings.
>
> I don't know what you mean by a "real database" but you are wrong
> about the data types SQLite can hold.  I seem to recall that what you
> say was once true (or closer to the truth), but things change.  I have
> stored integers, reals, blobs and strings in sqlite tables.

I never said you cannot do that.
I said: it is *good* only for storing strings. Configuration variables or so.

Why ? Because sqlite does not enforce the data type.

You can perfectly store a string in an integer declared column:

home: >sqlite3 
SQLite version 3.7.9 2011-11-01 00:52:41 
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t (a int);
sqlite> insert into t (a) values ("a string");
sqlite> select * from t;
a string
sqlite>

QED.

> Furthermore, SQLite makes a good partner for FreePascal and Lazarus,
> so you should not discourage people here from using it.

I strongly disagree it is a good partner.

Object Pascal is a strongly typed language:
FPC database code expects an integer in a column declared as integer.

So if sqlite does not ensure this, it is a bad partner for Object Pascal.

A good partner is Firebird or Postgres: real databases with stable apis.

I will never stop discouraging people from what I think is very bad software.
And I consider sqlite very bad for the reasons outlined above.

Michael.




More information about the Lazarus mailing list