mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-20 08:10:26 -06:00
Adds a whitespace linter to the pre-commit hook to ensure consistent formatting. It also enables linting of other SQL files such as for SQLc queries.
25 lines
438 B
SQL
25 lines
438 B
SQL
-- name: GetAPITokenById :one
|
|
SELECT
|
|
*
|
|
FROM
|
|
"APIToken"
|
|
WHERE
|
|
"id" = @id::uuid;
|
|
|
|
-- name: CreateAPIToken :one
|
|
INSERT INTO "APIToken" (
|
|
"id",
|
|
"createdAt",
|
|
"updatedAt",
|
|
"tenantId",
|
|
"name",
|
|
"expiresAt"
|
|
) VALUES (
|
|
coalesce(@id::uuid, gen_random_uuid()),
|
|
CURRENT_TIMESTAMP,
|
|
CURRENT_TIMESTAMP,
|
|
sqlc.narg('tenantId')::uuid,
|
|
sqlc.narg('name')::text,
|
|
@expiresAt::timestamp
|
|
) RETURNING *;
|