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

Failed to generate entities for large schema #555

Closed
milesgranger opened this issue Feb 23, 2022 · 4 comments
Closed

Failed to generate entities for large schema #555

milesgranger opened this issue Feb 23, 2022 · 4 comments

Comments

@milesgranger
Copy link

Description

When testing out the project, specifically generating entities for a schema we use which has nearly 1,000 tables, the following results:

$ sea-orm-cli generate entity -u $CONNECTION_URI -s big-schema -o src/models/replication/big-schema --compact-format
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PoolTimedOut', /home/milesg/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/sea-schema-0.5.1/src/postgres/discovery/executor/real.rs:30:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Steps to Reproduce

Difficult, but generating a lot of tables, which may have hundreds of columns can reproduce this error.

Expected Behavior

Same behavior (works) on small schemas with ~20 tables.

Actual Behavior

PoolTimedOut

Reproduces How Often

Every time.

Versions

└── sea-orm v0.6.0
    ├── sea-orm-macros v0.6.0 (proc-macro)
    ├── sea-query v0.21.0
    │   ├── sea-query-derive v0.2.0 (proc-macro)
    ├── sea-strum v0.23.0
    │   └── sea-strum_macros v0.23.0 (proc-macro)

OS: Ubuntu 18
Database: PostgreSQL 12.7

@billy1624
Copy link
Member

Hey @milesgranger, thanks for the report! Actually, we haven't try to run sea-orm-cli generate entity on a huge database. I think there are some bottleneck when querying the metadata from the information schemas. We would try to reproduce the errors with a large database then identify the bottleneck.

@billy1624 billy1624 added the good first issue Good for newcomers label Mar 14, 2022
@tyt2y3 tyt2y3 removed the good first issue Good for newcomers label Mar 31, 2022
@tyt2y3
Copy link
Member

tyt2y3 commented Mar 31, 2022

The cause of failure may or may not be "large". It could be because of one table using an unsupported feature. So I think at least a minimum-reproducible schema to be provided for this issue to be actionable. Please reopen if you have any updates

@tyt2y3 tyt2y3 closed this as completed Mar 31, 2022
@milesgranger
Copy link
Author

I think at least, a reasonable error should be produced if a table is using an unsupported feature, would you agree?

@tyt2y3
Copy link
Member

tyt2y3 commented Apr 1, 2022

Indeed

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

3 participants