MySQL vrs SQLite

Richie Hindle richie at entrian.com
Thu May 6 06:17:33 EDT 2004


[Dave, quoting the SQLite docs]
> """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."""

How about this?

"""Python containers (eg. lists, sets, tuples) are "typeless". This means
that you can store any kind of data you want in any container, without a
declared datatype for that container. This behavior is a feature, not a bug.
A container is suppose to store and retrieve data and it should not matter
to the container what format that data is in. The static typing systems
found in many other programming languages and codified in many language
specs is a misfeature - it is an example of the implementation showing
through into the interface. Python seeks to overcome this misfeature by
allowing you to store any kind of data into any container and by allowing
flexibility in the specification of datatypes."""

See every third posting to comp.lang.python over the past ten years for why
this kind of thing may or may not be a good idea.  Most of the arguments
that apply to dynamic typing in Python also apply to typelessness in
databases (the main one being: it's up to your unit tests, not anything
else, to make sure your program works).  If Python's dynamic typing fits
your brain, it seems likely that a typeless database should do so too.

-- 
Richie Hindle
richie at entrian.com





More information about the Python-list mailing list