Created
July 10, 2016 07:51
-
-
Save bgnori/b11db15f0bc952d230d260848906bb19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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