Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
snaiperskaya96 opened this issue Jun 14, 2024 · 1 comment
Open

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

snaiperskaya96 opened this issue Jun 14, 2024 · 1 comment

Comments

@snaiperskaya96
Copy link

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"
@snaiperskaya96
Copy link
Author

snaiperskaya96 commented Jun 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant