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

Error generating entity fromSQLite database with decimal type #123

Open
cxgreat2014 opened this issue Jan 30, 2024 · 0 comments
Open

Error generating entity fromSQLite database with decimal type #123

cxgreat2014 opened this issue Jan 30, 2024 · 0 comments

Comments

@cxgreat2014
Copy link

Description

I encountered an issue while attempting to generate an entity from a Django site's SQLite database using the sea-orm-cli. It seems to fail when dealing with the decimal type.

Steps to Reproduce

  1. Create a SQLite table as follows:
CREATE TABLE django_apscheduler_djangojobexecution
(
    id        INTEGER      NOT NULL PRIMARY KEY AUTOINCREMENT,
    status    VARCHAR(50)  NOT NULL,
    run_time  DATETIME     NOT NULL,
    duration  DECIMAL,
    finished  DECIMAL,
    exception VARCHAR(1000),
    traceback TEXT,
    job_id    VARCHAR(255) NOT NULL,
    CONSTRAINT unique_job_executions UNIQUE (job_id, run_time)
);
  1. Execute sea-orm-cli generate entity -v
2024-01-30T11:15:00.907209Z DEBUG sqlx::query: summary="PRAGMA foreign_key_list('django_apscheduler_djangojobexecution')" db.statement="" rows_affected=0 rows_returned=1 elapsed=70.6µs
2024-01-30T11:15:00.907468Z DEBUG sqlx::query: summary="PRAGMA table_info('django_apscheduler_djangojobexecution')" db.statement="" rows_affected=0 rows_returned=8 elapsed=97.6µs
thread 'main' panicked at C:\Users\rustdev\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sea-schema-0.14.2\src\sqlite\def\types.rs:62:42:
index out of bounds: the len is 1 but the index is 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Error occurs at sea-schema/types.rs:62.

Expected Behavior

Actual Behavior

Reproduces How Often

Always reproducible.

Versions

  • sea-orm-cli: 0.12.12

Additional Information

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