>
> the dialect has .server_version_info
>
> engine.dialect.server_version_info >= (9, 6)
>
> but you need your engine and connection to handle that. JSONB and JSON
> have different operator support.So you might want to do a
> TypeDecorator around it or similar but you can only support a
On 03/07/2017 03:49 PM, Jonathan Vanasco wrote:
I'm deploying something and unsure of the underlying postgresql version
for a given environment. most deployments are 9.6, a handful are 9.2.
upgrading everything is not an option I have.
i'm using declarative.
the only issue I have right now,
"within sqlalchemy". that was a typo.
--
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.
---
I'm deploying something and unsure of the underlying postgresql version for
a given environment. most deployments are 9.6, a handful are 9.2.
upgrading everything is not an option I have.
i'm using declarative.
the only issue I have right now, is that JSONB is preferred to JSON
support. Is
Hi John -
"onupdate" is a Python side directive that does not impact the DDL of
the column as created in the database, so it is not relevant to the
ALTER TABLE directive. The equivalent to "server side ON UPDATE" for
Postgresql would be a database trigger which is out of scope here.
- mike
Hi Mike, you did an awesome tool, thank you very much!!!
I started to use Alembic today, excellent tool, tutorial and
"autogenerate" option ;)
Up to now, everything is working well, except by this very small problem:
class:
created = Column(DateTime, server_default=func.now())
updated = Colum
Yeah, you're sort of right - I wasn't getting the error reported for the
initial failure, which was causing me pain. My logs aren't really up to
scratch we're using docker with AWS and it's a PITA at times.
I'm still not sure what was causing the original problem, but with some
extra work it ap
karl.latti...@innolabs.uk writes:
> current_time = datetime.datetime.utcnow()
> s = current_time - datetime.timedelta(hours=1)
> hour_ago = s.isoformat()
> query = session.query(func.count(MyTable)).filter(MyTable > hour_ago)
> ...
> StatementError: (sqlalchemy.exc.InvalidRequestError) Can't recon