This plugin manages databases that are shared with other services on shuttle.
Add shuttle-shared-db
to the dependencies for your service. Every type of shareable database is behind the following feature flag and attribute path (*-rustls
uses rustls for TLS, the default uses native-tls).
| Engine | Feature flags | Attribute path |
|----------|--------------------------------|-----------------------------|
| Postgres | postgres
/ postgres-rustls
| shuttleshareddb::Postgres |
| MongoDB | mongodb
| shuttleshareddb::MongoDb |
An example using the Rocket framework can be found on GitHub
This resource has the following options
| Option | Type | Description |
|-----------|------|----------------------------------------------------------------------------------------------------------------|
| local_uri | &str | Don't spin a local docker instance of Postgres, but rather connect to this URI instead for cargo shuttle run
|
This resource has the following options
| Option | Type | Description |
|-----------|------|---------------------------------------------------------------------------------------------------------------|
| local_uri | &str | Don't spin a local docker instance of MongoDB, but rather connect to this URI instead for cargo shuttle run
|