Skip to main content
get_records_json(table_name, column_names=None, offset=0, limit=-9999, expression=None, orderby_columns=None, having_clause=None)[source]

Retrieves records from a table in the form of a JSON array (stringified). The only mandatory parameter is the ‘tableName’. The rest are all optional with suitable defaults wherever applicable.

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

Parameters

table_name (str) –

Name of the table to query

column_names (list) –

the columns names to retrieve, or None for all

offset (int) –

the offset to start from; default 0

limit (int) –

the maximum number of records; default GPUdb.END_OF_SET

expression (str) –

the filter expression

orderby_columns (list) –

the list of columns to order by

having_clause (str) –

the having clause

Returns

The response string (JSON)

Raises

GPUdbException –

On detecting invalid parameters or some other internal errors

Example