@suluk/drizzle - v0.1.6
↑ Suluk
GitHub
Preparing search index...
crudRoutes
Function crudRoutes
crudRoutes
(
table
:
Table
,
opts
?:
CrudOptions
)
:
RouteContract
[]
Generate the five conventional CRUD RouteContracts for a drizzle table:
list GET {base} → 200 array(select)
get GET {base}/:id → 200 select, 404
create POST {base} (json insert) → 201 select
update PATCH {base}/:id (json update) → 200 select
delete DELETE {base}/:id → 204 Names are list
/get
/create
/update
/delete
(C009 by-name handles).
:id
is typed as a string param (path params arrive as strings; the DB layer coerces).
Parameters
table
:
Table
opts
:
CrudOptions
= {}
Returns
RouteContract
[]
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
↑ Suluk
GitHub
@suluk/drizzle - v0.1.6
Loading...
Generate the five conventional CRUD RouteContracts for a drizzle table:
:idis typed as a string param (path params arrive as strings; the DB layer coerces).