41 lines
754 B
Python
41 lines
754 B
Python
from sqlalchemy import create_engine, MetaData, Table, Integer, String, \
|
|
Column, DateTime, ForeignKey, Numeric
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
from sqlalchemy.orm import sessionmaker
|
|
|
|
engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
|
|
Session = sessionmaker(bind=engine)
|
|
session = Session()
|
|
|
|
|
|
|
|
Base = declarative_base()
|
|
|
|
|
|
|
|
class user(Base):
|
|
__tablename__ = 'users'
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
user_id = Column(Integer)
|
|
user_fullname = Column(String)
|
|
dick_size = (Column(Integer))
|
|
|
|
# Base.metadata.create_all(engine) создает таблицу
|
|
|
|
|
|
|
|
# def adding():
|
|
|
|
# session.add()
|
|
# session.commit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|