Database.fetch_next_serial_id

Database.fetch_next_serial_id(table_name: str)int[source]

Checks the latest ID of a serialized table and returns the next available one.

Parameters

table_name (str) – Name of the table to check.

Returns

Next available serial ID.

Return type

int

Raises

psycopg2.Error – Base exception for all kind of database errors.