async fn insert_submission<'a, E: Executor<'a, Database = Sqlite>>( sub: &Submission, executor: E, st_lock: &RwLock<()>, ) -> Result { let _g = st_lock.write().await; let com_id = sub.com_id.to_string(); let author_id = sub.author_id.to_string(); let state = sub.state as i32; sqlx::query!("INSERT INTO mt_subs (name, com_id, author, author_id, server, state) VALUES(?, ?, ?, ?, ?, ?)", sub.name, com_id, sub.author, author_id, sub.server, state).execute(executor).await }