-- name: CreateModeOfTransport :one
INSERT INTO modesoftransport (
    topackhouse,
    toexit,
    todestination,
    motdescription
 ) VALUES (
    $1, $2, $3, $4
 ) RETURNING *;

-- name: GetModeOfTransport :one
SELECT * FROM modesoftransport
WHERE id = $1 LIMIT 1;

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

-- name: ListModes :many
SELECT * FROM modesoftransport;

-- name: UpdateModeOfTransport :one
UPDATE modesoftransport
  set 
    topackhouse = $2,
    toexit = $3,
    todestination = $4,
    motdescription = $5
WHERE id = $1
RETURNING *;

-- name: DeleteModeOfTransport :exec
DELETE FROM modesoftransport WHERE id= $1;

-- name: InsertBulkModesOfTransport :one
INSERT INTO modesoftransport (
    topackhouse,
    toexit,
    todestination,
    motdescription
) VALUES(
   $1,
   $2,
   $3,
   $4
)
RETURNING *;

-- name: GetModeofTransportIDByName :one
SELECT id FROM modesoftransport where motdescription= $1;