PostgresQL error no schema has been selected to create in
#2021
Replies: 3 comments 1 reply
-
Tried giving the user all usage and create permissions on the schema and defining the schema to use in the database uri but both don't work. |
Beta Was this translation helpful? Give feedback.
-
I don't understand the problem, did you put the schema name on the connection string? i.e. https://www.sea-ql.org/SeaORM/docs/install-and-config/connection/#postgres |
Beta Was this translation helpful? Give feedback.
-
Fixed it! In the ConnectOptions I had set |
Beta Was this translation helpful? Give feedback.
-
Description
I created a few tables in my database and let the sea-orm-cli generate Rust types from the tables.
Now I want to implement that the schema gets loaded when the tables do not exist in the database.
But now I get the following error:
Steps to Reproduce
schema.create_table_from_entity(user::Entity)
)Expected Behavior
That the database uses the standard schema (default public)
Actual Behavior
Getting an SQLx error.
Reproduces How Often
Yes always.
Even after deleting the data folder etc.
Workarounds
Adding this to the table:
#[sea_orm(table_name = "user", schema_name = "public")]
Doesn't fix migrations tho!!!
Reproducible Example
Will do this tomorrow!!!
Versions
Database: PostgresQL version 16.1 (Docker)
OS on Docker: Alpine v3.18
Host Os: Fedora 39 Workstation
Beta Was this translation helpful? Give feedback.
All reactions