[sqlalchemy] SQLAlchemy psycopg2.ProgrammingError when using creator/connection string

2018-12-01 Thread Nirmal .M
If I connect to my database directly using psycopg2 it works, However, if I try with sqlalchemy it throws Programming error Direct connection using psycopg2 works: connection = psycopg2.connect( sslmode='require', host='query-prod-va7', port='80', dbname='all',

Re: [sqlalchemy] Unexplained SELECT Being Issued

2018-12-01 Thread Alex Rothberg
Makes sense. The code posted was a stripped down example of my issue. What I was seeing was an integrity error caused by the autoflush of that load: s = Session(e) e = Employee(id=1) s.add(e) s.flush() er = EmployeeRecord() # there are other attributes to EmployeeRecord # assume this is

Re: [sqlalchemy] Unexplained SELECT Being Issued

2018-12-01 Thread Mike Bayer
On Sat, Dec 1, 2018 at 9:55 PM Mike Bayer wrote: > > On Sat, Dec 1, 2018 at 9:21 PM Alex Rothberg wrote: > > > > I set up the DB: > > from sqlalchemy import * > > from sqlalchemy.orm import * > > from sqlalchemy.ext.declarative import declarative_base > > > > > > Base = declarative_base() > > >

Re: [sqlalchemy] Unexplained SELECT Being Issued

2018-12-01 Thread Mike Bayer
On Sat, Dec 1, 2018 at 9:21 PM Alex Rothberg wrote: > > I set up the DB: > from sqlalchemy import * > from sqlalchemy.orm import * > from sqlalchemy.ext.declarative import declarative_base > > > Base = declarative_base() > > class Employee(Base): > __tablename__ = 'employee' > id =

[sqlalchemy] Unexplained SELECT Being Issued

2018-12-01 Thread Alex Rothberg
I set up the DB: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Employee(Base): __tablename__ = 'employee' id = Column(Integer, primary_key=True) class EmployeeRecord(Base):