Table of contents
  1. Limiting to a number
  2. Limiting with offset
import { table, dsql as sql } from "../../src";

We will use this table

CREATE TABLE users(id int, age int, name string);

Which is defined in typescript as

const users = table(["id", "age", "name"], "users");

Limiting to a number

users.selectStar().limit(5).stringify();
SELECT
  *
FROM
  `users`
LIMIT
  5

Limiting with offset

users
    .selectStar()
    .limit(sql`1 OFFSET 10`)
    .stringify();
SELECT
  *
FROM
  `users`
LIMIT
  1
OFFSET
  10

This document used eval-md