Sporades SDK API
    Preparing search index...

    Type Alias TableApi<Row>

    Runtime table API exposed as ctx.db.<tableName> inside server handlers.

    Query builders are immutable from an app-author point of view: chain where, orderBy, and limit, then finish with get() or all(). Inserts and updates return rows including Sporades-managed auto fields.

    type TableApi<Row extends Record<string, unknown> = Record<string, unknown>> = {
        all(): Row[];
        delete(id: string): boolean;
        get(): Row | null;
        insert(values: InsertValues<Row>): Row;
        limit(count: number): TableApi<Row>;
        orderBy(
            fieldName: keyof Row & string,
            direction?: OrderDirection,
        ): TableApi<Row>;
        update(id: string, values: UpdateValues<Row>): Row | null;
        where<FieldName extends string>(
            fieldName: FieldName,
            value: Row[FieldName],
        ): TableApi<Row>;
    }

    Type Parameters

    • Row extends Record<string, unknown> = Record<string, unknown>
    Index
    • Parameters

      • id: string

      Returns boolean