mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-11-03 19:17:16 -05:00 
			
		
		
		
	Fix queries
This commit is contained in:
		
							parent
							
								
									606332ba6f
								
							
						
					
					
						commit
						6b55ae6395
					
				@ -1,8 +1,8 @@
 | 
			
		||||
-- name: GetAllUsers :many
 | 
			
		||||
select
 | 
			
		||||
	u.*,
 | 
			
		||||
	*
 | 
			
		||||
from
 | 
			
		||||
	users as u
 | 
			
		||||
	users
 | 
			
		||||
order by
 | 
			
		||||
	id
 | 
			
		||||
limit $1;
 | 
			
		||||
@ -20,18 +20,18 @@ limit $1;
 | 
			
		||||
 | 
			
		||||
-- name: GetUser :one
 | 
			
		||||
select
 | 
			
		||||
	sqlc.embed(users),
 | 
			
		||||
	sql.embed(oidc_handle)
 | 
			
		||||
	sqlc.embed(u),
 | 
			
		||||
	sqlc.embed(h)
 | 
			
		||||
from
 | 
			
		||||
	users as u
 | 
			
		||||
	left join oidc_handle as h on u.id = h.user_id
 | 
			
		||||
where
 | 
			
		||||
	id = $1
 | 
			
		||||
	u.id = $1
 | 
			
		||||
limit 1;
 | 
			
		||||
 | 
			
		||||
-- name: CreateUser :one
 | 
			
		||||
insert into users(username, email, password, claims)
 | 
			
		||||
	values (?, ?, ?, ?)
 | 
			
		||||
	values ($1, $2, $3, $4)
 | 
			
		||||
returning
 | 
			
		||||
	*;
 | 
			
		||||
 | 
			
		||||
@ -39,18 +39,18 @@ returning
 | 
			
		||||
update
 | 
			
		||||
	users
 | 
			
		||||
set
 | 
			
		||||
	username = ?,
 | 
			
		||||
	email = ?,
 | 
			
		||||
	password = ?,
 | 
			
		||||
	claims = ?
 | 
			
		||||
	username = $2,
 | 
			
		||||
	email = $3,
 | 
			
		||||
	password = $4,
 | 
			
		||||
	claims = $5
 | 
			
		||||
where
 | 
			
		||||
	id = ?
 | 
			
		||||
	id = $1
 | 
			
		||||
returning
 | 
			
		||||
	*;
 | 
			
		||||
 | 
			
		||||
-- name: DeleteUser :one
 | 
			
		||||
delete from users
 | 
			
		||||
where id = ?
 | 
			
		||||
where id = $1
 | 
			
		||||
returning
 | 
			
		||||
	*;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user