(feat) refactoring, migration, sqlx prepare

This commit is contained in:
Rorik Star Platinum 2025-11-06 21:45:09 +03:00
parent da3dfe40b0
commit 15b92ba3a4
17 changed files with 528 additions and 107 deletions

View file

@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT consent_id\n FROM user_consents\n WHERE user_id = $1 AND bank_code = $2 AND expires_at > NOW() AND status = 'active'\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "consent_id",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
false
]
},
"hash": "51af07266e370fc9282455cbf872b1558a4b7653972a8e8166b29856d63c37d8"
}

View file

@ -0,0 +1,17 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO user_consents (user_id, bank_code, consent_id, expires_at)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (user_id, bank_code)\n DO UPDATE SET consent_id = $3, expires_at = $4, created_at = NOW()\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Varchar",
"Varchar",
"Timestamptz"
]
},
"nullable": []
},
"hash": "7c81c4347f1e0d7a8109bfea0ad6692d7babfabd77abaedf17bccb414843c21b"
}