Bump version to 0.1.4 and improve DatabaseConfig default implementation

This commit is contained in:
2026-01-02 13:40:45 +01:00
parent c783323b69
commit c70a1eb443
3 changed files with 18 additions and 14 deletions

2
Cargo.lock generated
View File

@@ -747,7 +747,7 @@ dependencies = [
[[package]]
name = "k-core"
version = "0.1.3"
version = "0.1.4"
dependencies = [
"anyhow",
"chrono",

View File

@@ -1,6 +1,6 @@
[package]
name = "k-core"
version = "0.1.3"
version = "0.1.4"
edition = "2024"
[features]

View File

@@ -19,20 +19,24 @@ pub struct DatabaseConfig {
impl Default for DatabaseConfig {
fn default() -> Self {
#[cfg(feature = "sqlite")]
{
Self {
url: "sqlite::memory:".to_string(),
max_connections: 5,
min_connections: 1,
acquire_timeout: Duration::from_secs(30),
};
}
}
#[cfg(all(not(feature = "sqlite"), feature = "postgres"))]
{
Self {
url: "postgres://localhost:5432/mydb".to_string(),
max_connections: 5,
min_connections: 1,
acquire_timeout: Duration::from_secs(30),
};
}
}
#[cfg(not(any(feature = "sqlite", feature = "postgres")))]
Self {