lf5/backend/__init__.py
2024-01-24 16:14:43 +01:00

19 lines
502 B
Python

#!/usr/bin/env python3
import os
import time
from dotenv import load_dotenv
from .database import db
async def startup():
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')
while True:
print(await db.query('SELECT * FROM kunde'))
time.sleep(5)