On Wed, Aug 23, 2017 at 5:00 PM, Richard Postelnik <postelr...@gmail.com> wrote:
> I was looking into an issue with a package and noticed that what was
> supposed to be an MSSQL timestamp specific case was being applied to all
> timestamps. Upon further investigation I found that the mssql.TIMESTAMP was
> equal to sa.TIMESTAMP. Both yield a sqlalchemy.sql.sqltypese.TIMESTAMP. Is
> it reasonable to expect that all dialect types yield dialect specific
> subclasses?

no, because lots of the types that are in sqltypes are perfectly valid
in a particular dialect and do not benefit from subclassing.  It's
strictly a symbol that you can import from either place.


If so, can this feature be added?
>
> Example:
> import sqlalchemy as sa
> from sqlalchemy.dialects import mssql
> type(sa.TIMESTAMP()) # sqlalchemy.sql.sqltypes.TIMESTAMP
> type(mssql.TIMESTAMP())  # sqlalchemy.sql.sqltypes.TIMESTAMP
>
> I would expect mssql.TIMESTAMP() to return a
> sqlalchemy.dialects.mssql.base.TIMESTAMP even if its not redifining the base
> timestamp class. This would make it consistent with other types that are
> redefined such as mssql.BIT which yields sqlalchemy.dialects.mssql.base.BIT.

That would add tremendous verbosity to the source code and I do not
see any reason this would be useful.




>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to