MySQL vrs SQLite

Dave Benjamin ramen at lackingtalent.com
Wed May 5 18:41:35 EDT 2004


In article <mailman.283.1083787205.25742.python-list at python.org>, Michael wrote:
> I'm considering changing a Python program of mine, that uses MySQL as 
> it's db backend, to use SQLite. I'm mostly wanting something that can 
> make my program a complete package without requiring the user install 
> and configure an external db program. Has anyone experience with these? 
> They both follow the same DB-API so the code should be pretty easy to 
> port, right? Any draw backs to making this change?

I haven't used SQLite, through Python or otherwise, but I think it's
important to note nonetheless that it is supposedly a "typeless" database,
as opposed to MySQL, which (though perhaps tolerant to a fault) conforms
your data to the datatypes of your columns. The following paragraph from the
SQLite web site makes me rather uncomfortable:

"""SQLite is "typeless". This means that you can store any kind of data you
want in any column of any table, regardless of the declared datatype of that
column. (See the one exception to this rule in section 2.0 below.) This
behavior is a feature, not a bug. A database is suppose to store and
retrieve data and it should not matter to the database what format that data
is in. The strong typing system found in most other SQL engines and codified
in the SQL language spec is a misfeature - it is an example of the
implementation showing through into the interface. SQLite seeks to overcome
this misfeature by allowing you to store any kind of data into any kind of
column and by allowing flexibility in the specification of datatypes."""

            -- http://www.hwaci.com/sw/sqlite/datatypes.html

If you are doing any type of database work where you need to deal with
different types of data (ie. not just strings) and you are concerned with
the integrity of your data, I recommend that you take a good hard look at
this "feature, not a bug" and determine if SQLite meets your project's
requirements. Like I said, I've never used it, so this is all conjecture.

-- 
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
:  please talk to your son or daughter about parametric polymorphism. :



More information about the Python-list mailing list