python_bot/sqdb.py
Pavel_Duron 2d4dbca227
All checks were successful
continuous-integration/drone/push Build is passing
тест ывода информации из бд
2022-11-12 21:57:46 +10:00

43 lines
756 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()