Compare commits
2 Commits
be72fa7bc3
...
962b8feae7
Author | SHA1 | Date | |
---|---|---|---|
962b8feae7 | |||
c2a7a01a7d |
|
@ -86,10 +86,7 @@ pub fn derive_table_meta(input: TokenStream) -> TokenStream {
|
|||
impl TableMeta for #ident {
|
||||
type PrimaryKey = #key_t;
|
||||
const TABLE: &'static str = #table_name;
|
||||
}
|
||||
|
||||
impl #ident {
|
||||
pub async fn update(&mut self, pool: &crate::db::CurrPool) -> anyhow::Result<Self> {
|
||||
async fn update(&mut self, pool: &crate::db::CurrPool) -> anyhow::Result<Self> {
|
||||
#modified_at
|
||||
let session = sqlx::query_as!(
|
||||
#ident,
|
||||
|
@ -103,7 +100,7 @@ pub fn derive_table_meta(input: TokenStream) -> TokenStream {
|
|||
}
|
||||
};
|
||||
|
||||
eprintln!("{}", output.to_string());
|
||||
// eprintln!("{}", output.to_string());
|
||||
|
||||
output.into()
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ pub mod user;
|
|||
pub trait TableMeta: for<'r> sqlx::FromRow<'r, PgRow> {
|
||||
type PrimaryKey: Type<super::CurrDb> + Clone;
|
||||
const TABLE: &'static str;
|
||||
async fn update(&mut self, pool: &crate::db::CurrPool) -> anyhow::Result<Self>;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user