SeaQL / SeaQL/sea-orm

sea-orm-cli cannot open SQLite db.

Open
#2,262 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area:cli
Dominant language
Rust
Stars
9.9k
Forks
734
Avg merge
6h 36m
Merged PRs (30d)
8

Description

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"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sea-orm-cli generate entity command with the Windows SQLite URL shown, then compare its connection handling with the working programmatic migration connection. Check how the CLI parses SQLite paths and document or correct the difference. Done when the command opens the database and generates entities in src/entities.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sqlite
Domain
cli, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.