hiling_go/db/queries/sessions.sql

16 lines
266 B
MySQL
Raw Normal View History

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