Skip to content

Instantly share code, notes, and snippets.

@bgnori
Created July 10, 2016 07:51
Show Gist options
  • Save bgnori/b11db15f0bc952d230d260848906bb19 to your computer and use it in GitHub Desktop.
Save bgnori/b11db15f0bc952d230d260848906bb19 to your computer and use it in GitHub Desktop.
#/usr/bin/python
# coding: utf-8
from sqlalchemy.engine import create_engine
from sqlalchemy.engine import create_engine
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.sql.expression import and_
from sqlalchemy.schema import Column
from sqlalchemy.dialects.postgresql import DATE, VARCHAR, DOUBLE_PRECISION, BIGINT, INTEGER, NUMERIC
from sqlalchemy.dialects.postgresql import TIMESTAMP
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine("postgresql://nori:hogehoge@localhost:5432/texas", echo=True)
Base = declarative_base(engine)
class Card(Base):
__tablename__ = 'Card'
__table_args__ = {'autoload': True}
conn = engine.connect()
session = sessionmaker(bind=engine)()
print(Card)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment