test
This commit is contained in:
parent
459e2b1dea
commit
043386268b
17
test.py
17
test.py
|
@ -1,17 +0,0 @@
|
|||
from sqlalchemy import create_engine, inspect
|
||||
|
||||
# Подключаемся к БД
|
||||
engine = create_engine("sqlite:///./glass_cutting.db")
|
||||
inspector = inspect(engine)
|
||||
|
||||
# Получаем список таблиц
|
||||
print("Таблицы в БД:", inspector.get_table_names())
|
||||
|
||||
# Получаем информацию по конкретной таблице
|
||||
if "calculations" in inspector.get_table_names():
|
||||
columns = inspector.get_columns("calculations")
|
||||
print("\nСтруктура таблицы 'calculations':")
|
||||
for column in columns:
|
||||
print(f"{column['name']} ({column['type']})")
|
||||
else:
|
||||
print("Таблица 'calculations' не найдена.")
|
Loading…
Reference in New Issue