lf5/backend/__init__.py

20 lines
502 B
Python
Raw Permalink Normal View History

2024-01-23 15:58:54 +01:00
#!/usr/bin/env python3
import os
2024-01-24 15:39:03 +01:00
import time
2024-01-24 16:14:43 +01:00
from dotenv import load_dotenv
from .database import db
2024-01-23 15:58:54 +01:00
async def startup():
2024-01-24 15:39:03 +01:00
load_dotenv()
await db.connect()
await db.signin({"user": os.environ.get('DB_USER'), "pass": os.environ.get('DB_PW')})
await db.use("lf5", "lf5")
await db.query('DEFINE TABLE kunde SCHEMAFULL')
await db.query('DEFINE FIELD kundenNr ON TABLE kunde TYPE string')
2024-01-24 16:14:43 +01:00
while True:
2024-01-24 15:39:03 +01:00
print(await db.query('SELECT * FROM kunde'))
2024-01-24 16:14:43 +01:00
time.sleep(5)