Files
expenses/server/.sqlx/query-6e94a9a8c3d5f266a8e53b99c6d9af63b87d279c09b1c484315eea1cd3e08459.json
T

121 lines
3.3 KiB
JSON

{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO user_app_secrets (id, app_id, secret_hash, expires_at)\n SELECT $2, $3, $4, $5\n FROM user_apps\n WHERE user_id = $1 AND id = $3\n FOR KEY SHARE\n ON CONFLICT (id, app_id) DO UPDATE SET\n secret_hash = EXCLUDED.secret_hash,\n expires_at = EXCLUDED.expires_at\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n COALESCE(old_row.app_id, new_row.app_id) AS \"old_app_id!\",\n COALESCE(old_row.secret_hash, new_row.secret_hash) AS \"old_secret_hash!\",\n COALESCE(old_row.expires_at, new_row.expires_at) AS \"old_expires_at!\",\n COALESCE(old_row.created_at, new_row.created_at) AS \"old_created_at!\",\n new_row.id AS \"id!\",\n new_row.app_id AS \"app_id!\",\n new_row.secret_hash AS \"secret_hash!\",\n new_row.expires_at AS \"expires_at!\",\n new_row.created_at AS \"created_at!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "old_app_id!",
"type_info": "Uuid",
"origin": "Expression"
},
{
"ordinal": 2,
"name": "old_secret_hash!",
"type_info": "Bytea",
"origin": "Expression"
},
{
"ordinal": 3,
"name": "old_expires_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 4,
"name": "old_created_at!",
"type_info": "Timestamptz",
"origin": "Expression"
},
{
"ordinal": 5,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 6,
"name": "app_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "app_id"
}
}
},
{
"ordinal": 7,
"name": "secret_hash!",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "secret_hash"
}
}
},
{
"ordinal": 8,
"name": "expires_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "expires_at"
}
}
},
{
"ordinal": 9,
"name": "created_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "created_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Uuid",
"Bytea",
"Timestamptz"
]
},
"nullable": [
false,
null,
null,
null,
null,
false,
false,
false,
false,
false
]
},
"hash": "6e94a9a8c3d5f266a8e53b99c6d9af63b87d279c09b1c484315eea1cd3e08459"
}