SeaQL/sea-orm

sea-orm-cli cannot open SQLite db.

snaiperskaya96 opened this issue · 3 comments

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?; // 
  1. 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"

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 :\

hey, facing the same issue here

Deleting the path worked