Hi,

The attached patch for the sqlite backend would recognize DECIMAL
columns as being of type Numeric.

Kind regards,
Markus

On 10/19/07, Markus Gritsch <[EMAIL PROTECTED]> wrote:
> On 10/18/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
> >
> > sqlite doesnt have DECIMAL or TINYINT types defined.   sqlite3
> > instead as a somewhat bizarre way of indicating types, where you can
> > use any string you want to indicate a type and it uses search
> > expressions on the string to determine its storage and column
> > affinity (the strings that indicate "real numbers" are NUMERIC, FLOA,
> > REAL, DOUB...no DECIMAL in the list right now).  but you can still
> > put any kind of value in any kind of column.  so im not sure if
> > SQLAlchemy should be making any reflection choices given those
> > particular names of DECIMAL and TINYINT (i dont think TINYINT is even
> > part of the SQL standard).
>
> You are right about TINYINT not being part of ANSI SQL
> (http://savage.net.au/SQL/sql-92.bnf.html#exact%20numeric%20type).
>
> I know that SQLites has a different approach to the type system, using
> storage classes and column affinity.  However, I think the SQLite
> backend should at least support the Numeric and DECIMAL datatypes,
> because
> *) the backend already supports other datatypes like DATETIME and
> TIMESTAMP, which are also not native SQLite storage classes
> *) they are documented at http://www.sqlalchemy.org/docs/04/types.html
> to exist for the various backends.
>
> If TINYINT should be recognized as well, and mapped to SLSmallInteger
> like SMALLINT already does, remains to be decided.  It is probably
> wrong that SQLObject maps its BoolCol to TINYINT in the SQLite
> backend.  I will talk about this with Oleg Broytman.  But maybe this
> type should also be tolerated and recognized by SQLAlchemy, since
> "practicality beats purity" ;)
>
> One last word about Numeric and DECIMAL: The ANSI standard and MySQL
> talk about <precision> and <scale>, whereas SQLAlchemy uses
> <precision> and <length>.  Maybe SQLAlchemy should also use "scale"
> instead of "length" in the code and the documentation.
>
> Kind regards,
> Markus

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: sqlite.diff
Description: Binary data

Reply via email to