From 63f37a78c3de691078d92254fb6af252f54cb814 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Tue, 14 Jul 2020 08:45:30 -0700 Subject: [PATCH] feat(sqlite): add SqliteConnectOptions::filename --- sqlx-core/src/sqlite/options/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sqlx-core/src/sqlite/options/mod.rs b/sqlx-core/src/sqlite/options/mod.rs index 8afdf58c..93b2993d 100644 --- a/sqlx-core/src/sqlite/options/mod.rs +++ b/sqlx-core/src/sqlite/options/mod.rs @@ -70,6 +70,12 @@ impl SqliteConnectOptions { } } + /// Sets the name of the database file. + pub fn filename(mut self, filename: impl AsRef) -> Self { + self.filename = Cow::Owned(filename.as_ref().to_owned()); + self + } + /// Set the enforcement of [foreign key constriants](https://www.sqlite.org/pragma.html#pragma_foreign_keys). /// /// By default, this is enabled.