On Aug 30, 2007, at 8:20 AM, marq wrote:
Hello,
apologies if I'm the obvious or important things in the documentation
- and I'm obviously very new to SQLAlchemy...
I'd like to create my own types which are aware of different database
dialects. For example, I need a type 'Double' which holds a
representation of a double precision floating point number. With
MySQL, I would robably use the native DOUBLE type, with Oracle
BINARY_DOUBLE. I would like to encapsulate the data base dependency
with a properly defined custom type.
Is there a straigtforward way to achieve this? I have managed to build
custom types, of course, but I haven't found a way on how to deduce
the current data base engine / dialect from the types.TypeEngine...
we have one "user defined" type thats doing something like this right
now, the Interval type in types.py. You might take a look at that
for ideas - it uses "DateTime" for most dialects except for Postgres
where it uses "Interval".