Switched from sea-orm to sqlx

This commit is contained in:
2023-11-25 19:29:06 +03:00
parent e4e33f52b1
commit 9f967e82d5
40 changed files with 434 additions and 1110 deletions

View File

@@ -5,10 +5,7 @@ use tokio::task::spawn_blocking;
pub async fn menu(bot: Throttle<Bot>, msg: Message, db: DatabaseConnection) -> crate::Result<()> {
let user_id = msg.from().ok_or(NoUserInfo)?.id.0;
let names: Vec<String> = Account::get_names(user_id, &db)
.await?
.try_collect()
.await?;
let names: Vec<String> = Account::get_names(user_id, &db).try_collect().await?;
if names.is_empty() {
bot.send_message(msg.chat.id, "You don't have any accounts")