Database settings are configured.
This commit is contained in:
parent
2bf1ec6fdf
commit
c08fc79fac
9
database/database.py
Normal file
9
database/database.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from sqlalchemy import create_engine
|
||||||
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
from sqlalchemy.orm import sessionmaker
|
||||||
|
|
||||||
|
DATABASE_URL = "postgresql://postgres:postgres@localhost/price-builder"
|
||||||
|
|
||||||
|
engine = create_engine(DATABASE_URL)
|
||||||
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||||
|
Base = declarative_base()
|
@ -1,5 +1,5 @@
|
|||||||
from sqlalchemy import Column, Integer, String, Float
|
from sqlalchemy import Column, Integer, String, Float
|
||||||
from database import Base
|
from database.database import Base
|
||||||
|
|
||||||
class Laptop(Base):
|
class Laptop(Base):
|
||||||
__tablename__ = "laptops"
|
__tablename__ = "laptops"
|
||||||
|
Loading…
Reference in New Issue
Block a user