@earth-app/collegedb
    Preparing search index...

    Function buildInsert

    • Builds an INSERT statement from a column to value object.

      Column order follows object key order. Values flow through positional bindings, so key names are quoted-and-validated while values are never interpolated. undefined values are skipped; null inserts a SQL NULL.

      Parameters

      • table: string

        Target table name

      • values: ColumnValues

        Column to value map for the new row

      • options: BuildInsertOptions = {}

        Insert modifiers (OR REPLACE/OR IGNORE, RETURNING)

      Returns BuiltQuery

      The parameterized SQL and its bindings

      If no columns are provided or an identifier is invalid

      const { sql, bindings } = buildInsert('users', { id: 'u1', name: 'Ada', age: 36 });
      // sql: INSERT INTO "users" ("id", "name", "age") VALUES (?, ?, ?)
      // bindings: ['u1', 'Ada', 36]