SeaQL / sea-orm

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

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

Open snaiperskaya96 opened 1 week ago

snaiperskaya96 commented 1 week 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 1 week 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 :\