Class luasql.exasol.CursorData
This internal class represents the result data of a cursor that allows retreiving rows from a result set.
It handles large result sets by fetching new batches automatically.
Local Functions
luasql.exasol.cursordata.convert_col_value(col_value) | Convert a column value if necessary before returining it. |
Methods
luasql.exasol.cursordata:create(connection_properties, websocket, result_set) | Create a new instance of the CursorData class. |
luasql.exasol.cursordata:next_row() | Advances the cursor data to the next row. |
luasql.exasol.cursordata:get_current_row() | Get the current row number. |
luasql.exasol.cursordata:has_more_rows() | Check if there are more rows available in the result set. |
luasql.exasol.cursordata:get_column_value(column_index) | Get a column value from the current row. |
luasql.exasol.cursordata:_fetch_data() | Fetch the next batch of data if no more rows are available locally. |
luasql.exasol.cursordata:_end_of_result_set_reached() | Check if the cursor has reached the last row of the complete result set. |
luasql.exasol.cursordata:_more_data_available() | Check if more rows are available in the current batch or if the next batch must be fetched. |
luasql.exasol.cursordata:_fetch_next_data_batch() | Fetches the next batch of the result set from the database. |
Local Functions
Methods- luasql.exasol.cursordata.convert_col_value(col_value) line 75
-
Convert a column value if necessary before returining it.
We need to replace
cjson.null
withluasql.exasol.NULL
to hide the implementation detail that we are using cjson for JSON parsing.Parameters:
- col_value
Methods
- luasql.exasol.cursordata:create(connection_properties, websocket, result_set) line 31
-
Create a new instance of the CursorData class.
Parameters:
- connection_properties luasql.exasol.ConnectionProperties the user defined connection settings, containing e.g. fetch size
- websocket luasql.exasol.ExasolWebsocket the websocket connection to the database
- result_set table the result set received when executing a query
Returns:
-
luasql.exasol.CursorData
a new CursorData instance
Raises:
an error in case the result set is invalid - luasql.exasol.cursordata:next_row() line 55
- Advances the cursor data to the next row.
- luasql.exasol.cursordata:get_current_row() line 62
-
Get the current row number.
Returns:
-
number
the current row number (starting with 1) of the complete result set
- luasql.exasol.cursordata:has_more_rows() line 68
-
Check if there are more rows available in the result set.
Returns:
-
boolean
true
if there are more rows available - luasql.exasol.cursordata:get_column_value(column_index) line 87
-
Get a column value from the current row.
Fetches the next batch in case not enough data is available.
Parameters:
- column_index number the column index starting with 1
Returns:
-
any
the value of the given column
- luasql.exasol.cursordata:_fetch_data() line 105
- Fetch the next batch of data if no more rows are available locally.
- luasql.exasol.cursordata:_end_of_result_set_reached() line 123
- Check if the cursor has reached the last row of the complete result set.
- luasql.exasol.cursordata:_more_data_available() line 128
- Check if more rows are available in the current batch or if the next batch must be fetched.
- luasql.exasol.cursordata:_fetch_next_data_batch() line 133
- Fetches the next batch of the result set from the database.