REST from your database catalog
    DocumentationCheat sheetQuestionsDownloadSource
    Questions
    • How do I...?
    Start here
    • Getting started
    • What a table becomes
    • Compared with PostgREST
    Setting up
    • Tables, columns and relations
    • Security and hooks
    • Writes and procedures
    • Prefer: return=representation
    • Node, Fastify, Express
    Reading
    • select
    • /{key}
    • relation(...)
    • order
    • limit, offset
    • relation.order, .limit
    • count
    • count(), sum(), avg()...
    • "name"
    Filtering
    • eq, neq
    • gt, gte, lt, lte
    • in
    • like, ilike
    • match, imatch
    • is
    • ov, cs, cd
    • not
    • relation.column
    • or, and
    Databases
    • Supported databases
    • Adding a database
    Reference
    • Cheat sheet
    • Errors
    Reading

    One row by its key

    Add the primary key to the path to read a single row as an object.

    /todos/1/todos/1?select=name,owner(name)

    A collection answers an array. A path with a key answers one object, so a client never has to unwrap a one-item list.

    A row that does not exist answers 404 not_found, and so does a row the caller may not see: the answer never tells them apart.

    Examples

    The first todo and its owner.
    /todos/1?select=id,name,owner(name)

    Asking the database...

    There is no todo 9.
    /todos/9

    Asking the database...

    A view has no primary key. restloom uses its id column when it has one, or the key you declare for it.

    See alsoChoose the columns Bring related rows along
    PreviousChoose the columnsNext Bring related rows along
    restloom - a REST API generated from your database catalog
    DocumentationDownloadSource