-- name: CreateDocumentType :one
INSERT INTO consignmentdoctypes (
    cdcode,
    cddescription
 ) VALUES (
    $1, $2
 ) RETURNING *;

-- name: GetDocumentType :one
SELECT * FROM consignmentdoctypes
WHERE id = $1 LIMIT 1;

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

-- name: UpdateDocumentType :one
UPDATE consignmentdoctypes
  set 
    cdcode= $2,
    cddescription = $3
WHERE id = $1
RETURNING *;

-- name: DeleteDocumentType :exec
DELETE FROM consignmentdoctypes WHERE id= $1;



