You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lemmy/crates/db_schema/src/impls/secret.rs

16 lines
405 B
Rust

use crate::source::secret::Secret;
use diesel::{result::Error, *};
impl Secret {
/// Initialize the Secrets from the DB.
/// Warning: You should only call this once.
pub fn init(conn: &mut PgConnection) -> Result<Secret, Error> {
read_secrets(conn)
}
}
fn read_secrets(conn: &mut PgConnection) -> Result<Secret, Error> {
use crate::schema::secret::dsl::*;
secret.first::<Secret>(conn)
}