Have an async connection pool in FastApi application. Using python-oracledb async connection pool (thin mode).
Trying to call Connection.gettype(name)
(await (await session.connection()).get_raw_connection()).cursor() have no attribute connection
await session.connection() and await (await session.connection()).get_raw_connection() have no attribute gettype
So how can I get user defined DbObjectType
In cx_Oracle connection's cursor I call this
# cursor: Connection cursor
# data: list):
my_type = cursor.get_connection().gettype('MY_SCHEMA.MY_TYPE_ARRAY').newobject()
my_type.extend(data)
Have an async connection pool in FastApi application. Using python-oracledb async connection pool (thin mode).
Trying to call Connection.gettype(name)
(await (await session.connection()).get_raw_connection()).cursor() have no attribute connection
await session.connection() and await (await session.connection()).get_raw_connection() have no attribute gettype
So how can I get user defined DbObjectType
In cx_Oracle connection's cursor I call this
# cursor: Connection cursor
# data: list):
my_type = cursor.get_connection().gettype('MY_SCHEMA.MY_TYPE_ARRAY').newobject()
my_type.extend(data)
Share
Improve this question
edited 8 hours ago
Kamo Petrosyan
asked yesterday
Kamo PetrosyanKamo Petrosyan
2441 silver badge10 bronze badges
2
- Since you tagged this with python-oracledb, hopefully the reference to the obsolete cx_Oracle driver in the question was a typo. – Christopher Jones Commented 17 hours ago
- before i used cx_Oracle and in question is example from old code with cx_Oracle. Question is for asynchronous oracledb driver (thin mode connection). – Kamo Petrosyan Commented 8 hours ago
1 Answer
Reset to default 0DBAPICursor has (protected) _connection attrubute
cursor = (await (await session.connection()).get_raw_connection()).cursor()
obj_type = (
await (
await session.cursor()
)._connection.gettype("MY_SCHEMA.MY_TYPE_ARRAY")
).newobject()