Open wanghaisheng opened 4 months ago
from sqlalchemy import create_engine import os
url = os.getenv("TURSO_DATABASE_URL") auth_token = os.getenv("TURSO_AUTH_TOKEN")
engine = create_engine("sqlite+libsql://", echo=True)
Base.metadata.create_all(engine)
then if i set this to local db, after process how to sync to cloud like conn.sync()
create a turso client along with engine, and use the sqlalchemy default file as input to the turso client, currently i dont found another way, please let me know if it works.
from sqlalchemy import create_engine import os
url = os.getenv("TURSO_DATABASE_URL") auth_token = os.getenv("TURSO_AUTH_TOKEN")
engine = create_engine("sqlite+libsql://", echo=True)
Base.metadata.create_all(engine)
then if i set this to local db, after process how to sync to cloud like conn.sync()