I'm trying to get rid of SQLAlchemy's warning regarding problematic storage of
numeric/decimal objects in sqlite.

My idea was to build a custom type which is backed by a string on sqlite but
uses the native DB types when available.

Well, the basics (dialect-specific conversion) seem to be easy enough but I'm
not sure how I can create the right colspec when initializing the new db (for
example using 'alembic upgrade --sql')

sqlalchemy.types.UserDefinedType has a method "get_col_spec()" but that method
has no information about the dialect or dbapi.

SQLAlchemy's built-in types seem to use a visitor-pattern where the dialect
implementation decide on the output - that makes it hard to define a custom
column type which I have in mind as I want to keep the default behavior in all
places except a few which I have under direct control.

What puzzles me is that there seem to be a few methods which look "right" but
these are not called during an alembic upgrade, e.g. 'get_dbapi_type',
'dialect_impl' and 'load_dialect_impl'.

fs

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to