-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtabledef.py
More file actions
24 lines (19 loc) · 721 Bytes
/
Copy pathtabledef.py
File metadata and controls
24 lines (19 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from sqlalchemy import *
from sqlalchemy import create_engine, ForeignKey
from sqlalchemy import Column, Date, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref
engine = create_engine('sqlite:///output.db', echo=True)
Base = declarative_base()
########################################################################
class Output(Base):
""""""
__tablename__ = "output"
id = Column(Integer, primary_key=True)
text = Column(String)
#----------------------------------------------------------------------
def __init__(self, text):
""""""
self.text = text
# create tables
Base.metadata.create_all(engine)