Skip to content

Support diesel+sqlite in rocket_db_pools #2967

@mcclure

Description

@mcclure

What's missing?

I am trying to develop a website with Rocket+Yew for the frontend and Diesel+Sqlite for the backend.

Rocket prefers database connections to be stored in rocket_db_pools. rocket_db_pools has drivers for Diesel+Postgres and Diesel+Mysql. However, it does not support Diesel+Sqlite: https://api.rocket.rs/v0.5/rocket_db_pools/#supported-drivers

Ideal Solution

I believe the reason you do not support sqlite is that you use diesel_async, which as of its 2023 release did not support sqlite. Since then however diesel_async has added a SyncConnectionWrapper class which is used to access Sqlite. As far as I know, your existing code for diesel::MysqlPool could simply be duplicated using this class in place of AsyncMysqlConnection.

Why can't this be implemented outside of Rocket?

By providing rocket_db_pools and republishing the ::diesel crate Rocket has essentially claimed responsibility for exposing diesel's feature set. The work appears to already be done outside Rocket, but plumbing within Rocket is needed to expose it.

Are there workarounds usable today?

?

Alternative Solutions

?

Additional Context

No response

System Checks

  • I do not believe that this feature can or should be implemented outside of Rocket.
  • I was unable to find a previous request for this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    requestRequest for new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions