use clap::builder::Str; use diesel::{ deserialize::FromSql, serialize::{Output, ToSql}, sql_types::Text, Queryable, Selectable, Insertable, sqlite::{Sqlite, SqliteValue}, AsExpression, FromSqlRow, }; use std::fmt; use super::types::{RecordStates, AuthMethod}; #[derive(Debug)] #[derive(Queryable, Selectable, Insertable)] #[diesel(table_name = super::schema::providers_records)] #[diesel(check_for_backend(diesel::sqlite::Sqlite))] pub(crate) struct ProviderRecord{ pub(crate) service_name: String, pub(crate) expires_at: Option, // Unix timestamp pub(crate) auth_methode: AuthMethod, pub(crate) has_notifyed: bool, pub(crate) state: RecordStates, pub(crate) awnsered_by: Option, } #[derive(Debug)] #[derive(Insertable)] #[diesel(table_name = super::schema::beggars_records)] #[diesel(check_for_backend(diesel::sqlite::Sqlite))] pub(crate) struct BeggarsRecord{ //request_time: String, // automatically set by sqlite service_name: String, http_result: i32, note: Option, awnsered_by: Option, }