-- name: CreateProductDocumentType :one
INSERT INTO productdoctypes (
    pddocumentcode,
    pddocumentdescription
 ) VALUES (
    $1, $2
 ) RETURNING *;

-- name: GetProductDocumentType :one
SELECT * FROM productdoctypes
WHERE id = $1 LIMIT 1;

-- name: ListProductDocumentTypes :many
SELECT * FROM productdoctypes
ORDER BY id LIMIT $1
OFFSET $2;

-- name: UpdateProductDocumentType :one
UPDATE productdoctypes
  set 
    pddocumentcode = $2,
    pddocumentdescription = $3
WHERE id = $1
RETURNING *;

-- name: DeleteProductDocumentType :exec
DELETE FROM productdoctypes WHERE id= $1;