updated mysql connector
This commit is contained in:
parent
c7933373c4
commit
4f121e4ed0
|
@ -9,7 +9,7 @@ engine = create_engine(
|
|||
)
|
||||
"""
|
||||
|
||||
SQLALCHEMY_DATABASE_URL = "mysql+mysqlconnector://root:secret@172.18.0.2:3306/test" # Przykład dla MySQL
|
||||
SQLALCHEMY_DATABASE_URL = "mysql+mysqlconnector://root:secret@src_mysql-server_1:3306/test" # Przykład dla MySQL
|
||||
engine = create_engine(
|
||||
SQLALCHEMY_DATABASE_URL,
|
||||
)
|
||||
|
@ -18,3 +18,9 @@ SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
|||
|
||||
Base = declarative_base()
|
||||
|
||||
#%%
|
||||
from sqlalchemy import text
|
||||
|
||||
with engine.connect() as conn:
|
||||
result = conn.execute(text("select 'hello world'"))
|
||||
print(result.all())
|
||||
|
|
Loading…
Reference in New Issue