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',
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
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()
> >
>
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 =
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):