DbObject
- class q2_sdk.hq.db.db_object.DbObject(logger, hq_credentials=None, ret_table_obj=None)[source]
Bases:
objectProgrammatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.
- Parameters:
logger – Reference to calling request’s logger (self.logger in your extension)
hq_credentials (
Optional[HqCredentials]) – HQ Connectivity Information (Defaults to settings file)ret_table_obj (
Optional[bool]) – Flag to return list of LXML elements ifFalseor TableRow objects from DB calls ifTrue(Defaults to settings file)
- GET_BY_NAME_KEY = ''
- NAME = ''
- hq_response: HqResponse | None
- property hq_credentials: HqCredentials
- async call_hq(stored_proc_short_name, sql_parameters=None, specific_table='Table', representation_class_override=None, use_json=True, force_q2_api=False, **kwargs)[source]
- Parameters:
stored_proc_short_name (
str) – Registered in the Q2_ApiStoredProc tablesql_parameters (
Union[SqlParameters,SqlParameters,None]) – Params to the stored procspecific_table (
str) – If shape returned is different than standard (rare)representation_class_override – Used in cases where a DbObject has more than one return class defined
use_json – If False, will use the pure soap interface
force_q2_api – If True, will not use wedge_online_banking, even if there is an active session