Skip to content

Commit 0f14f0c

Browse files
committed
Slightly refactor sqlite crate to have more clear documentation and naming
Signed-off-by: Caleb Schoepp <[email protected]>
1 parent 9239ccc commit 0f14f0c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/sqlite/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl RuntimeConfigResolver {
7575
let database_kind = config.type_.as_str();
7676
match database_kind {
7777
"spin" => {
78-
let config: LocalDatabase = config.config.try_into()?;
78+
let config: InProcDatabase = config.config.try_into()?;
7979
Ok(Arc::new(
8080
config.connection_creator(&self.local_database_dir)?,
8181
))
@@ -122,11 +122,11 @@ const DEFAULT_SQLITE_DB_FILENAME: &str = "sqlite_db.db";
122122
/// Configuration for a local SQLite database.
123123
#[derive(Clone, Debug, Deserialize)]
124124
#[serde(deny_unknown_fields)]
125-
pub struct LocalDatabase {
125+
pub struct InProcDatabase {
126126
pub path: Option<PathBuf>,
127127
}
128128

129-
impl LocalDatabase {
129+
impl InProcDatabase {
130130
/// Get a new connection creator for a local database.
131131
///
132132
/// `base_dir` is the base directory path from which `path` is resolved if it is a relative path.
@@ -155,6 +155,8 @@ fn resolve_relative_path(path: &Path, base_dir: &Path) -> PathBuf {
155155
}
156156

157157
/// Configuration for a libSQL database.
158+
///
159+
/// This is used to deserialize the specific runtime config toml for libSQL databases.
158160
#[derive(Clone, Debug, Deserialize)]
159161
#[serde(deny_unknown_fields)]
160162
pub struct LibSqlDatabase {

0 commit comments

Comments
 (0)