forked from dunossauro/live-de-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.py
More file actions
21 lines (17 loc) · 808 Bytes
/
Copy pathcore.py
File metadata and controls
21 lines (17 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from datetime import datetime
from sqlalchemy import (create_engine, MetaData, Column,
Table, Integer, String, DateTime)
engine = create_engine('sqlite:///teste.db',
echo=False)
metadata = MetaData(bind=engine)
words_table = Table('usuarios', metadata,
Column('id', Integer, primary_key=True),
Column('nome', String(40), index=True),
Column('idade', Integer, nullable=False),
Column('senha', String),
Column('criado_em', DateTime, default=datetime.now),
Column('atualizado_em',
DateTime,
default=datetime.now,
onupdate=datetime.now))
metadata.create_all()