---
title: "Reads rows of a table"
method: GET
path: "/lambdas/{privateKey}/database/tables/{table}"
tags: ["Database"]
---

# Reads rows of a table

`GET /lambdas/{privateKey}/database/tables/{table}`

## Request

- Base URL: `https://genhttp.dev/api/v1`
- URL: `https://genhttp.dev/api/v1/lambdas/{privateKey}/database/tables/{table}`
- Auth: none declared

The newest rows first, unless a column to sort by is named. Each row is a list of values in the order of the
columns. A text longer than 2000 characters is cut and sent as `{ "text": …, "length": … }`, bytes as
`{ "blob": length }`, and an integer beyond what JavaScript holds exactly as text.

## Path parameters

- `privateKey` string, required
- `table` string, required

## Query parameters

- `order` string
- `offset` integer
- `limit` integer
- `descending` boolean

## Response `200`

A page of rows

- DatabaseRowsResponse: A page of the rows of a table or view.
  - `Table` string: The name of the table
  - `Columns` DatabaseColumnResponse[]: Its columns, in the order of the values of each row
    - `Name` string: Its name
    - `Type` string: The type it was declared with, as written: `INTEGER`, `TEXT`, or anything else SQLite accepts
    - `NotNull` boolean: Whether it was declared `NOT NULL`
    - `PrimaryKey` boolean: Whether it is the primary key, or part of it
    - `Default` string, nullable: The expression it defaults to, as written
  - `Rows` array[]: Each row as its values, in the order of the columns: a number, a text or null - an integer beyond what JavaScript holds exactly as text, a text of more than 2000 characters as `{ text, length }`, and bytes as `{ blob }`, their length
    - unknown[]
      - unknown
  - `Total` integer: How many rows the table holds
  - `Offset` integer: How many rows were skipped
  - `Limit` integer: How many rows were asked for at most
  - `Order` string, nullable: The column the rows are sorted by; absent for the order they were written in
  - `Descending` boolean: Whether the order is reversed: newest, or highest, first

## Other responses

- `204`: A response containing no body
- `400`: The table has no column of the name to sort by.
- `404`: No lambda has this editor key, or its database has no such table.
- `409`: The database is switched off.

---

[API](https://skmtc.dev/genhttp/apis/genhttp-lambda-api.md) · [All operations](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/revisions/8b36699e03df?raw)
