lf5/backend/__init__.py

17 lines
No EOL
500 B
Python

#!/usr/bin/env python3
from .database import db
import os
from dotenv import load_dotenv
import time
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)