about summary refs log tree commit diff
path: root/src/database/postgres
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-01 22:50:28 +0300
committerVika <vika@fireburn.ru>2024-08-02 16:13:39 +0300
commit2318a33f9b359ae27b52cd9a19db1f6782d8dae3 (patch)
tree5f4dc1ad73d5c4104679a1976781861ec23cb20e /src/database/postgres
parent61a6bf6b80aea18d8b7af159d504004a29e50576 (diff)
downloadkittybox-2318a33f9b359ae27b52cd9a19db1f6782d8dae3.tar.zst
Upgrade dependencies and fix deprecated functionality
I think I managed to not lose any functionality from my dependencies.

sqlparser remains unupgraded, but that's mostly because it is only
used in one example and it's not worth it to upgrade right now.
Diffstat (limited to 'src/database/postgres')
-rw-r--r--src/database/postgres/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/database/postgres/mod.rs b/src/database/postgres/mod.rs
index 0ebaffb..7f788a8 100644
--- a/src/database/postgres/mod.rs
+++ b/src/database/postgres/mod.rs
@@ -1,5 +1,4 @@
 use std::borrow::Cow;
-use std::str::FromStr;
 
 use kittybox_util::{MicropubChannel, MentionType};
 use sqlx::{ConnectOptions, Executor, PgPool};
@@ -30,6 +29,7 @@ impl From<sqlx::migrate::MigrateError> for StorageError {
     }
 }
 
+/// Micropub storage that uses a PostgreSQL database.
 #[derive(Debug, Clone)]
 pub struct PostgresStorage {
     db: PgPool
@@ -38,7 +38,7 @@ pub struct PostgresStorage {
 impl PostgresStorage {
     /// Construct a [`PostgresStorage`] from a [`sqlx::PgPool`],
     /// running appropriate migrations.
-    pub async fn from_pool(db: sqlx::PgPool) -> Result<Self> {
+    pub(crate) async fn from_pool(db: sqlx::PgPool) -> Result<Self> {
         db.execute(sqlx::query("CREATE SCHEMA IF NOT EXISTS kittybox")).await?;
         MIGRATOR.run(&db).await?;
         Ok(Self { db })