On 09/22/2016 10:21 AM, Seth P wrote:
The documentation for DateTime,
http://docs.sqlalchemy.org/en/latest/core/type_basics.html?highlight=datetime#sqlalchemy.types.DateTime,
states
Parameters:*timezone* – boolean. If True, and supported by the backend,
will produce ‘TIMESTAMP WITH TIMEZONE’. For backends that don’t support
timezone aware timestamps, has no effect.
But this does not appear to be the case. In SQLAlchemy 1.0.15 with
oracle+cx_Oracle,
that documentation was written only with Postgresql in mind, since I'm
not about to make the timezone type suddenly bump Oracle DATE to
TIMESTAMP right now I've updated the documentation for clarity.
http://docs.sqlalchemy.org/en/latest/core/type_basics.html?highlight=datetime#sqlalchemy.types.DateTime
class FooBar(BaseModel):
idx = sa.Column(sa.Integer, sa.Sequence('idx_seq'), primary_key=True)
my_oracle_DATE = sa.Column(oracle.DATE(timezone=False))
my_oracle_DATE_tz = sa.Column(oracle.DATE(timezone=True))
my_DateTime = sa.Column(sa.DateTime(timezone=False))
*my_DateTime_tz = sa.Column(sa.DateTime(timezone=True))*
my_TIMESTAMP = sa.Column(sa.TIMESTAMP(timezone=False))
my_TIMESTAMP_tz = sa.Column(sa.TIMESTAMP(timezone=True))
emits
CREATE TABLE barra.foo_bar (
idx INTEGER NOT NULL,
"my_oracle_DATE" DATE,
"my_oracle_DATE_tz" DATE,
"my_DateTime" DATE,
* "my_DateTime_tz" DATE,*
"my_TIMESTAMP" TIMESTAMP,
"my_TIMESTAMP_tz" TIMESTAMP WITH TIME ZONE,
PRIMARY KEY (idx)
)
--
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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.