Neon icon

Neon

Connect to Neon database and perform operations

Row → Insert

AI-generated

Summary

Inserts rows into a Neon database table, optionally mapping input data to columns and handling conflicts or large numbers.

Inputs

  • schema — Database schema to use (e.g., public), selectable from a list or entered as a name.
  • table — Table name to insert data into; can be chosen from a list or typed manually.
  • mappingMode — Choose auto‑map to match input field names with table columns or manually define each column's value.
  • valuesToSend — Collection of column‑value pairs to insert; each entry defines a column name and its value.
  • options — Various execution options such as query mode, cascade behavior, delay for idle connections, output format for large numbers, and conflict handling.

Output shape

The operation returns a response object containing the result of the insert, typically including affected row information or an empty success indicator.

Success returns normally without a body; errors are thrown. The shape may vary based on query mode and options.

Examples

Example 1: Insert user records from a previous node into the 'users' table, auto‑mapping column names.

Set Schema to 'public', Table to 'users', leave MappingMode as Auto‑Map Input Data, populate Values To Send with column/value pairs, and keep default Options.

Example 2: Insert data with manual column mapping and skip conflicts.

Select MappingMode = Define Each Column Manually, enable Skip on Conflict, and configure Values To Send accordingly.

Example 3: Execute a bulk insert using a transaction mode with large number handling.

Choose Query Mode = transaction, set Output Large‑Format Number As = string, and provide Values To Send entries.

Discussion