Skip to main content
Sign in
Snippets Groups Projects
Select Git revision
  • eb90c0a68e75bb19754c16e97c593521251b3915
  • main default protected
2 results

query.sql

Blame
  • query.sql 1.43 KiB
    -- name: GetLocation :one
    SELECT * FROM locations
    WHERE id = ? LIMIT 1;
    
    -- name: CreateLocation :one
    INSERT INTO locations
    (id, description)
    VALUES (?, ?)
    RETURNING *;
    
    -- name: UpdateLocation :one
    UPDATE locations
    SET description = ?
    WHERE id = ?
    RETURNING *;
    
    -- name: DeleteLocation :one
    DELETE FROM locations
    WHERE id = ?
    RETURNING *;
    
    -- name: GetLocations :many
    SELECT * FROM locations;
    
    -- name: GetLocationsWithFilter :many
    SELECT * FROM locations
    WHERE description LIKE ?;
    
    -- name: GetBox :one
    SELECT * FROM boxes
    WHERE id = ? LIMIT 1;
    
    -- name: CreateBox :one
    INSERT INTO boxes
    (id, location, description)
    VALUES (?, ?, ?)
    RETURNING *;
    
    -- name: UpdateBox :one
    UPDATE boxes
    SET location = ?, description = ?
    WHERE id = ?
    RETURNING *;
    
    -- name: DeleteBox :one
    DELETE FROM boxes
    WHERE id = ?
    RETURNING *;
    
    -- name: GetBoxes :many
    SELECT * FROM boxes;
    
    -- name: GetBoxesWithFilter :many
    SELECT * FROM boxes
    WHERE description LIKE ?;
    
    -- name: GetContent :one
    SELECT * FROM contents
    WHERE id = ? LIMIT 1;
    
    -- name: CreateContent :one
    INSERT INTO contents
    (id, box, description, tags)
    VALUES (?, ?, ?, ?)
    RETURNING *;
    
    -- name: UpdateContent :one
    UPDATE contents
    SET box = ?, description = ?, tags = ?
    WHERE id = ?
    RETURNING *;
    
    -- name: DeleteContent :one
    DELETE FROM contents
    WHERE id = ?
    RETURNING *;
    
    -- name: GetContents :many
    SELECT * FROM contents;
    
    -- name: GetContentsWithFilter :many
    SELECT * FROM contents
    WHERE description LIKE ?;
    
    -- vim:et