kysely

    Class NotMatchedThenableMergeQueryBuilder<DB, TT, ST, O>

    Type Parameters

    • DB
    • TT extends keyof DB
    • ST extends keyof DB
    • O
    Index

    Constructors

    Methods

    • Performs the insert (...) values action.

      This method is similar to InsertQueryBuilder.values, so see the documentation for that method for more examples.

      To perform the do nothing action, see thenDoNothing.

      const result = await db.mergeInto('person')
      .using('pet', 'person.id', 'pet.owner_id')
      .whenNotMatched()
      .thenInsertValues({
      first_name: 'John',
      last_name: 'Doe',
      })
      .execute()

      The generated SQL (PostgreSQL):

      merge into "person"
      using "pet" on "person"."id" = "pet"."owner_id"
      when not matched then
      insert ("first_name", "last_name") values ($1, $2)

      Type Parameters

      • I extends InsertObjectOrList<DB, TT>

      Parameters

      • insert: I

      Returns WheneableMergeQueryBuilder<DB, TT, ST, O>

    • Performs the insert (...) values action.

      This method is similar to InsertQueryBuilder.values, so see the documentation for that method for more examples.

      To perform the do nothing action, see thenDoNothing.

      const result = await db.mergeInto('person')
      .using('pet', 'person.id', 'pet.owner_id')
      .whenNotMatched()
      .thenInsertValues({
      first_name: 'John',
      last_name: 'Doe',
      })
      .execute()

      The generated SQL (PostgreSQL):

      merge into "person"
      using "pet" on "person"."id" = "pet"."owner_id"
      when not matched then
      insert ("first_name", "last_name") values ($1, $2)

      Type Parameters

      • IO extends InsertObjectOrListFactory<DB, TT, ST>

      Parameters

      • insert: IO

      Returns WheneableMergeQueryBuilder<DB, TT, ST, O>

    MMNEPVFCICPMFPCPTTAAATR