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

feat: Support for lazy database connections #2268

Merged
merged 1 commit into from
Aug 21, 2024

Commits on Jun 22, 2024

  1. feat: Support for lazy database connections

    Add support for creating DB connection pools without establishing
    connections up front. This is already supported by SQLx via the
    [Pool::connect_lazy](https://docs.rs/sqlx/latest/sqlx/struct.Pool.html#method.connect_lazy)
    method.
    
    This PR adds a new `connect_lazy` option to `database::ConnectOptions`.
    If set to `true`, the SQLx `Pool` will be created using the
    `Pool::connect_lazy_with` method; otherwise, the `Pool::connect_with`
    method will be used (e.g., the existing behavior). This "lazy" behavior
    is implemented for each DB variant (Postgres/MySQL/SQLite).
    
    This was discussed previously
    [here](SeaQL#1645), but it
    appears support was never added to SEA ORM directly.
    spencewenski committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    91c257b View commit details
    Browse the repository at this point in the history