[sqlalchemy] Re: Not able to filter json column filter in flask-sqlalchemy

2017-12-06 Thread shrey . chauhan
Hi Mike, as you said I tried this: *from sqlalchemy.dialects import postgresql class Student(db.Model): # ...data_test=db.Column(postgresql.JSON) * and I tried querying like this: *a = Student.query.filter(Student.data_test["foo"].astext =="bar").first()* tried this as well: *a =

Re: alembic_version creation fails when in different new schema (Postgres)

2017-12-06 Thread Mike Bayer
On Wed, Dec 6, 2017 at 5:34 PM, Jules Olléon wrote: > Hello, > > I have an issue with schema creation when the alembic_version table is not > in the default (public) schema on Postgres. > > We have a setup where multiple services use the same Postgres DB (to > simplify ops

Re: [sqlalchemy] How to implement a conditional insert (MySQL)

2017-12-06 Thread jens . troeger
> is that session using "autocommit" mode? > print("--> autocommit", dbsession.autocommit) gives a False. > it looks like the error is raised on the UNLOCK ? When I comment out the UNLOCK, the exception still raises. Here is SQLA’s verbose logging: --> autocommit False 2017-12-07

alembic_version creation fails when in different new schema (Postgres)

2017-12-06 Thread Jules Olléon
Hello, I have an issue with schema creation when the alembic_version table is not in the default (public) schema on Postgres. We have a setup where multiple services use the same Postgres DB (to simplify ops work) but we are trying to isolate each service in its own Postgres schema. The

Re: [sqlalchemy] Not able to filter json column filter in flask-sqlalchemy

2017-12-06 Thread Mike Bayer
On Wed, Dec 6, 2017 at 7:42 AM, wrote: > Hi, > > I am using flask-sqlalchemy in my project, but I am not able to understand > how to query(filter_by) on a json column > > test_example: > > #I am using Postgresql backend > app = Flask(__name__) >

[sqlalchemy] Not able to filter json column filter in flask-sqlalchemy

2017-12-06 Thread shrey . chauhan
Hi, I am using flask-sqlalchemy in my project, but I am not able to understand how to query(filter_by) on a json column test_example: #I am using Postgresql backend app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:postgres@localhost:5432/test_db' db =