Skip to main content
insert_records_json(json_records, table_name, json_options=None, create_table_options=None, options=None)[source]

Inserts a single JSON record or an array of JSON records passed in as a string.

If a fail-over event is triggered, this function will handle failing over to a secondary cluster.

Parameters

json_records (str) –

Either a single JSON record or an array of JSON records (as string). Mandatory.

table_name (str) –

The name of the table to insert into.

json_options (dict) –

Map of options–only valid one is validate, which determines whether JSON validation is performed on all records before inserting

create_table_options (dict) –

Same options as the create_table_options in the GPUdb.insert_records_from_payload() endpoint

options (dict) –

Same options as options in the GPUdb.insert_records_from_payload() endpoint

Returns

The response string (JSON)

Raises

GPUdbException –

On detecting invalid parameters or some other internal errors

Example