SeaQL / sea-orm

🐚 An async & dynamic ORM for Rust
https://www.sea-ql.org/SeaORM/
Apache License 2.0
7.44k stars 522 forks source link

sea-orm-cli cannot open SQLite db. #2262

Open snaiperskaya96 opened 5 months ago

snaiperskaya96 commented 5 months ago

Description

Hello, i'm running into this issue where sea-orm-cli does not seem to be able to open my DB file. I'm generating the db and populating it via a programmatic migration so that part of the API seems fine. Any idea?

Steps to Reproduce

  1. Generate a sqlite db. image
  2. Interact with it to make sure seaql can pick it up
    let db = db::create_db_conn().await?; // 
    let _ = SchemaManager::new(&db); // <- This all work 
    Migrator::refresh(&db).await?; // 
  3. Try to generate entities with the cli
    sea-orm-cli generate entity -u sqlite://C:\\Users\\jury\\AppData\\Roaming\\skaya\\fluffy-waffle\\data\\db_debug.sqlite -o src/entities --with-serde both

Expected Behavior

Entities are being generated and populated into src/entities

Actual Behavior

Connecting to SQLite ...
error returned from database: (code: 14) unable to open database file

Reproduces How Often

Always

Workarounds

Haven't found any workaround so far.

Versions

sea-orm = { version = "0.12.15", features = ["sqlx-sqlite", "runtime-async-std-native-tls"] }
sea-orm-migration = "0.12.15"
snaiperskaya96 commented 5 months ago

Ok this seems to work so it might be an issue with the absolute db path... sea-orm-cli generate entity -u "sqlite://db_debug.sqlite" I guess for the time being I can work around that by copy the db the current folder :\

nephi-dev commented 1 month ago

hey, facing the same issue here

EvilWatermelon commented 1 month ago

Deleting the path worked