openGauss icon

openGauss

Get, add and update data in openGauss

Database → Insert

AI-generated

Summary

Inserts rows into an openGauss table, optionally returning new or updated values.

Inputs

  • schema (required) — The schema that contains the table you want to write to.
  • table (required) — The name of the table you want to insert data into.
  • dataMode — Whether to map node input properties and the table data automatically or manually.
  • valuesToSend — Set the value for each destination column manually (visible only in 'Map Each Column Manually' mode).
  • options.outputColumns — Comma-separated list of columns to return. Use * to return all columns. Leave empty to skip RETURNING.
  • options.skipOnConflict — Whether to skip the row instead of throwing an error if a unique constraint is violated.

Output shape

a list of items; each item represents a single inserted row if RETURNING is used, otherwise a success confirmation with affected row count.

If 'Output Columns' is left empty, no rows are returned, only a success indicator with affected rows.

Examples

Example 1: Insert a single row with matching field names

Set 'Data Mode' to 'Auto-Map Input Data to Columns' and provide input data with keys matching table columns (e.g., {name: 'Alice', email: 'alice@example.com'}).

Example 2: Insert rows and retrieve generated IDs

Set 'Data Mode' to 'Auto-Map Input Data to Columns' and configure 'Output Columns' to 'id' to return the newly generated primary key.

Example 3: Insert data but ignore duplicate key errors

Enable 'Skip on Conflict' in the options to allow the operation to continue without failing when a unique constraint is violated.

Links

Discussion