-
-
Notifications
You must be signed in to change notification settings - Fork 648
Closed
Copy link
Labels
A-driverC-enhancementCategory: enhancementCategory: enhancementgood first issueGood for newcomersGood for newcomers
Description
Description
When ConnectOptions is converted to sqlx::pool::PoolOptions, the max_lifetime and idle_timeout fields are set only if the value provided is not None:
sea-orm/src/driver/sqlx_common.rs
Lines 54 to 56 in b68e770
| if let Some(idle_timeout) = self.idle_timeout { | |
| opt = opt.idle_timeout(Some(idle_timeout)); | |
| } |
sea-orm/src/driver/sqlx_common.rs
Lines 60 to 62 in b68e770
| if let Some(max_lifetime) = self.max_lifetime { | |
| opt = opt.max_lifetime(Some(max_lifetime)); | |
| } |
However, None is a valid field for sqlx to enable infinite connection lifetime and no idle timeout. By default, the values are set to 30 mins and 10 mins respectively.
Use Case
I'm using an SQLite in-memory database and the data will be wiped if connections to it are closed. Therefore I want to keep a connection to the database indefinitely.
iftachFridental
Metadata
Metadata
Assignees
Labels
A-driverC-enhancementCategory: enhancementCategory: enhancementgood first issueGood for newcomersGood for newcomers