2 schema::secret::dsl::secret,
3 source::secret::Secret,
4 utils::{get_conn, DbPool},
6 use diesel::result::Error;
7 use diesel_async::RunQueryDsl;
10 /// Initialize the Secrets from the DB.
11 /// Warning: You should only call this once.
12 pub async fn init(pool: &DbPool) -> Result<Secret, Error> {
13 Self::read_secrets(pool).await
16 async fn read_secrets(pool: &DbPool) -> Result<Secret, Error> {
17 let conn = &mut get_conn(pool).await?;
18 secret.first::<Secret>(conn).await