решаю проблему с oracledb
parent
6c99c385ad
commit
6eb431b74e
|
|
@ -1,13 +1,16 @@
|
||||||
from os import getenv, environ
|
from os import getenv, environ
|
||||||
import hvac
|
import hvac
|
||||||
from oracledb import Error, create_pool
|
from oracledb import Error, create_pool, init_oracle_client
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
|
|
||||||
|
init_oracle_client()
|
||||||
|
|
||||||
class SimpleDB:
|
class SimpleDB:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._connect_hvac()
|
self._connect_hvac()
|
||||||
self.pool
|
self.pool
|
||||||
|
init_oracle_client()
|
||||||
|
|
||||||
def _connect_hvac(self):
|
def _connect_hvac(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -69,6 +72,7 @@ class SimpleDB:
|
||||||
# тестого
|
# тестого
|
||||||
print(value)
|
print(value)
|
||||||
respons = cursor.callproc('P_RK_SEND_JSON_LIST_FACEACC', [int(id), organ,names, date_from, date_to, ver])
|
respons = cursor.callproc('P_RK_SEND_JSON_LIST_FACEACC', [int(id), organ,names, date_from, date_to, ver])
|
||||||
|
# тестого
|
||||||
print(respons)
|
print(respons)
|
||||||
except Error as e:
|
except Error as e:
|
||||||
raise HTTPException(status_code=500, detail=f"Database error: {e}")
|
raise HTTPException(status_code=500, detail=f"Database error: {e}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue