naise_pos/db/query/sessions.sql

17 lines
273 B
MySQL
Raw Permalink Normal View History

2023-03-16 12:21:41 +07:00
-- name: CreateSession :one
INSERT INTO user_sessions (
id,
email,
refresh_token,
user_agent,
client_ip,
is_blocked,
expires_at
) VALUES (
$1, $2, $3, $4, $5, $6, $7
) RETURNING *;
-- name: GetSession :one
SELECT * FROM user_sessions
WHERE id = $1
LIMIT 1;