mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
* Initial oauth * Add Github authentication * Add AuthMethods endpoint * Add frontend * Rename basic authentication to password * Add flags for configuring GitHub auth * Remove name from API keys * Fix authmethods in test * Add stories and display auth methods error
45 lines
582 B
SQL
45 lines
582 B
SQL
-- name: GetOrganizations :many
|
|
SELECT
|
|
*
|
|
FROM
|
|
organizations;
|
|
|
|
-- name: GetOrganizationByID :one
|
|
SELECT
|
|
*
|
|
FROM
|
|
organizations
|
|
WHERE
|
|
id = $1;
|
|
|
|
-- name: GetOrganizationByName :one
|
|
SELECT
|
|
*
|
|
FROM
|
|
organizations
|
|
WHERE
|
|
LOWER("name") = LOWER(@name)
|
|
LIMIT
|
|
1;
|
|
|
|
-- name: GetOrganizationsByUserID :many
|
|
SELECT
|
|
*
|
|
FROM
|
|
organizations
|
|
WHERE
|
|
id = (
|
|
SELECT
|
|
organization_id
|
|
FROM
|
|
organization_members
|
|
WHERE
|
|
user_id = $1
|
|
);
|
|
|
|
-- name: InsertOrganization :one
|
|
INSERT INTO
|
|
organizations (id, "name", description, created_at, updated_at)
|
|
VALUES
|
|
($1, $2, $3, $4, $5) RETURNING *;
|