Loading...

vastorbit.connection.current_cursor

vastorbit.connection.current_cursor() Any

Returns the current database cursor.

Examples

Get the current cursor:

from vastorbit.connection import current_cursor

cur = current_cursor()
cur

<trino.dbapi.Cursor object at 0x11a7b4748>

Directly execute an SQL query:

cur.execute("SELECT version()").fetchone()

['Trino version 450']

See also

current_connection() : Returns the current vastorbit connection.
new_connection() : Creates a new vastorbit connection.
set_connection() : Sets the vastorbit connection.