You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
postgreSQL: SQLModel.metadata.create_all(engine) doesn't create the database file #66
Following the tutorial user guide based on sqlite I tried to do the same with postgresql database, but contrary to sqlite the SQLModel.metadata.create_all(engine) command doesn't seem to create my embeddings_sts_tf postgresql database
From this stack-overflow post you can't create a postgresql database via create_engine or create_all. Following the steps in that SO answer works, with the caveat of the SQLAlchemy 2.0 engine not allowing you to just execute on text (and create_engine from SQLModel has future=True by default). For 2.0 you need to use the text() construct to execute text like that. YOLO importing text from SQLModel seems to import the right thing, so you don't even need to import it from SQLAlchemy apparently but I've not seen this import documented anywhere.
Activity
rodg commentedon Sep 2, 2021
From this stack-overflow post you can't create a postgresql database via
create_engineorcreate_all. Following the steps in that SO answer works, with the caveat of the SQLAlchemy 2.0 engine not allowing you to just execute on text (andcreate_enginefrom SQLModel hasfuture=Trueby default). For 2.0 you need to use thetext()construct to execute text like that. YOLO importingtextfrom SQLModel seems to import the right thing, so you don't even need to import it from SQLAlchemy apparently but I've not seen this import documented anywhere.