firebird.driver.interfaces¶
This module contains interface wrappers for Firebird new API.
Important
-
Firebird OO API interfaces use inheritance, i.e. they could be inherited from other interface. In fact, all interfaces returned by Firebird are inherited from
IVersionedinterface. -
Firebird OO API interfaces are versioned. Any addition to particular interface increases its version number. Application developers are responsible to check the version of returned interface to verify that it supports methods they want to use.
If you want to use Firebird OO API interfaces directly in you application, read next section very carefuly.
In Python driver, interfaces are represented as instances of interface wrapper classes that expose the methods provided by particular Firebird interface version. The wrapper class hierarchy thus represent not only inheritance between Firebird interfaces, but also between versions of particular Firebird interface.
Because all interfaces returned by Firebird are inherited from IVersioned interface,
all wrapper classes have VERSION class attribute that contain version number of wrapped
interface.
Each Firebird interface has it's "canonical" Python wrapper with coresponding name. For
example interface IService has wrapper class iService. However, if there are multiple
public versions of Firebird interface, there are multiple wrapper classes for each published
interface version (interim, non-public versions used during Firebird development are skipped).
These wrapper classes have names based on their canonical name with suffix that represent
the interface version they wrap. It means that canonical wrapper always represents
the highest interface version.
Whenever Firebird interface is returned from Firebird OO API call, it's wrapped to its Python wrapper class according to interface type and version. The Python driver ensures that correct wrapper class is used according to returned interface version.
However, this architecture has several important consequences:
- The interface wrapper classes may change between driver releases as new interface versions
are introduced. For example, driver versions up to 1.5.2 had only canonical
iService(version 3), but in version 1.6.0 it was renamed toiService_v3, new wrappersiService_v4and (new canonical)iService(version 5) were added. - Instead using
isinstanceto check interface versions, you should always useVERSIONattribute on wrapper class instance.
Metaclasses¶
firebird.driver.interfaces.iVersionedMeta
¶
Bases: type
Metaclass for iVersioned interfaces.
This metaclass uses MRO to instantiate wrapper interface with version that matches version of wrapped interface.
Source code in firebird/driver/interfaces.py
Firebird API Interface wrappers¶
Base interfaces¶
firebird.driver.interfaces.iVersioned
¶
IVersioned interface wrapper
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iReferenceCounted
¶
Bases: iVersioned
IReferenceCounted interface wrapper
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iDisposable
¶
Bases: iVersioned
IDisposable interface wrapper
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iStatus
¶
Bases: iDisposable
Class that wraps IStatus interface for use from Python
IStatus replaces ISC_STATUS_ARRAY. Functionality is extended - Status has separate access to errors and warnings vectors, can hold vectors of unlimited length, itself stores strings used in vectors avoiding need in circular strings buffer. Interface is on purpose minimized (methods like convert it to text are moved to Util interface) in order to simplify it's implementation by users when needed.
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
clone() -> iStatus
¶
dispose() -> None
¶
get_errors() -> a.ISC_STATUS_ARRAY_PTR
¶
get_state() -> StateFlag
¶
get_warning() -> a.ISC_STATUS_ARRAY_PTR
¶
init() -> None
¶
set_errors(value: ByteString) -> None
¶
set_errors2(length: int, value: ByteString) -> None
¶
Set contents of errors vector with length explicitly specified in a call
set_warning2(length: int, value: ByteString) -> None
¶
Set contents of warnings vector with length explicitly specified in a call
set_warnings(value: ByteString) -> None
¶
firebird.driver.interfaces.iPluginBase
¶
Bases: iReferenceCounted
IPluginBase interface wrapper
- Reference firebird.driver.interfaces iProvider
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iMaster
¶
Bases: iVersioned
Class that wraps IMaster interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
get_config_manager() -> iConfigManager
¶
get_dispatcher() -> iProvider
¶
Get instance of iProvider interface, implemented by yValve (main provider instance).
get_dtc() -> iDtc
¶
get_metadata_builder(fieldCount: int) -> iMetadataBuilder
¶
Get instance of iMetadataBuilder interface.
Source code in firebird/driver/interfaces.py
get_plugin_manager() -> iPluginManager
¶
get_process_exiting() -> bool
¶
get_status() -> iStatus
¶
get_timer_control() -> iTimerControl
¶
get_util_interface() -> iUtil
¶
register_attachment(provider: iProvider, attachment: iAttachment) -> iAttachment
¶
register_transaction(attachment: iAttachment, transaction: iTransaction) -> iTransaction
¶
Configuration¶
firebird.driver.interfaces.iConfigEntry
¶
Bases: iReferenceCounted
Class that wraps IConfigEntry interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
get_bool_value() -> bool
¶
get_int_value() -> int
¶
get_name() -> str
¶
get_sub_config(status: iStatus) -> iConfig
¶
Treats sub-entries as separate configuration file and returns IConfig interface for it
get_value() -> str
¶
firebird.driver.interfaces.iConfig
¶
Bases: iReferenceCounted
Class that wraps IConfig interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
find(name: str) -> iConfigEntry
¶
find_pos(name: str, pos: int) -> iConfigEntry
¶
Find entry by name and position. If configuration file contains lines:
Db=DBA Db=DBB Db=DBC
call to find_pos(status, “Db”, 2) will return entry with value DBB.
Source code in firebird/driver/interfaces.py
find_value(name: str, value: str) -> iConfigEntry
¶
Find entry by name and value
firebird.driver.interfaces.iFirebirdConf_v3
¶
Bases: iReferenceCounted
Class that wraps IFirebirdConf v3 interface for use from Python
- Reference firebird.driver.interfaces iFirebirdConf
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
as_boolean(key: str) -> bool
¶
as_integer(key: int) -> int
¶
as_string(key: int) -> str
¶
get_key(name: str) -> int
¶
Returns key for configuration parameter.
Note
If parameter with given name does not exists, returns 0xffffffff.
firebird.driver.interfaces.iFirebirdConf
¶
Bases: iFirebirdConf_v3
Class that wraps IFirebirdConf v4 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
as_boolean(key: str) -> bool
¶
as_integer(key: int) -> int
¶
as_string(key: int) -> str
¶
get_key(name: str) -> int
¶
Returns key for configuration parameter.
Note
If parameter with given name does not exists, returns 0xffffffff.
get_version() -> int
¶
firebird.driver.interfaces.iConfigManager_v2
¶
Bases: iVersioned
Class that wraps IConfigManager v2 interface for use from Python
- Reference firebird.driver.interfaces iConfigManager
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
get_database_conf(database: str) -> iFirebirdConf
¶
Returns interface to access db-specific configuration. Takes into an account firebird.conf and appropriate part of databases.conf.
Source code in firebird/driver/interfaces.py
get_directory(dirspec: DirectoryCode) -> str
¶
Returns location of appropriate directory in current firebird instance
get_firebird_conf() -> iFirebirdConf
¶
Returns interface to access default configuration values (from firebird.conf)
get_install_directory() -> str
¶
get_plugin_config(plugin: str) -> iConfig
¶
get_root_directory() -> str
¶
Returns root directory of current instance, in single-instance case usually matches install directory
firebird.driver.interfaces.iConfigManager
¶
Bases: iConfigManager_v2
Class that wraps IConfigManager v3 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
get_database_conf(database: str) -> iFirebirdConf
¶
Returns interface to access db-specific configuration. Takes into an account firebird.conf and appropriate part of databases.conf.
Source code in firebird/driver/interfaces.py
get_default_security_db() -> str
¶
get_directory(dirspec: DirectoryCode) -> str
¶
Returns location of appropriate directory in current firebird instance
get_firebird_conf() -> iFirebirdConf
¶
Returns interface to access default configuration values (from firebird.conf)
get_install_directory() -> str
¶
get_plugin_config(plugin: str) -> iConfig
¶
get_root_directory() -> str
¶
Returns root directory of current instance, in single-instance case usually matches install directory
Database and service attachments¶
firebird.driver.interfaces.iProvider
¶
Bases: iPluginBase
Class that wraps IProvider interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
attach_database(filename: str, dpb: bytes | None = None, encoding: str = 'ascii') -> iAttachment
¶
Replaces isc_attach_database()
Source code in firebird/driver/interfaces.py
attach_service_manager(service: str, spb: bytes) -> iService
¶
Replaces isc_service_attach()
Source code in firebird/driver/interfaces.py
create_database(filename: str, dpb: bytes, encoding: str = 'ascii') -> iAttachment
¶
Replaces isc_create_database()
Source code in firebird/driver/interfaces.py
get_owner() -> iReferenceCounted
¶
release() -> int
¶
set_dbcrypt_callback(callback: iCryptKeyCallbackImpl) -> None
¶
Sets database encryption callback interface that will be used for following database and service attachments
Source code in firebird/driver/interfaces.py
set_owner(r: iReferenceCounted) -> None
¶
firebird.driver.interfaces.iAttachment_v3
¶
Bases: iReferenceCounted
Class that wraps IAttachment v3 interface for use from Python
- Reference firebird.driver.interfaces iAttachment_v4
Source code in firebird/driver/interfaces.py
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 | |
encoding: str
instance-attribute
¶
Encoding used for string values
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
cancel_operation(option: int) -> None
¶
compile_request(blr: bytes) -> iRequest
¶
create_blob(transaction: iTransaction, id_: a.ISC_QUAD, bpb: bytes | None = None) -> iBlob
¶
Creates new blob, stores it's identifier in id, replaces isc_create_blob2()
Source code in firebird/driver/interfaces.py
detach() -> None
¶
Replaces isc_detach_database(). On success releases interface.
drop_database() -> None
¶
Replaces isc_drop_database(). On success releases interface.
execute(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata | None = None, in_buffer: bytes | None = None, out_metadata: iMessageMetadata | None = None, out_buffer: bytes | None = None) -> None
¶
Executes any SQL statement except returning multiple rows of data.
Partial analogue of isc_dsql_execute2() - in and out XSLQDAs replaced with
input and output messages with appropriate buffers.
Source code in firebird/driver/interfaces.py
execute_dyn(transaction: iTransaction, dyn: bytes) -> None
¶
get_info(items: bytes, buffer: bytes) -> None
¶
get_slice(transaction: iTransaction, id_: a.ISC_QUAD, sdl: bytes, param: bytes, slice_: bytes) -> int
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
open_blob(transaction: iTransaction, id_: a.ISC_QUAD, bpb: bytes | None = None) -> iBlob
¶
Opens existing blob, replaces isc_open_blob2()
Source code in firebird/driver/interfaces.py
open_cursor(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata, in_buffer: bytes, out_metadata: iMessageMetadata, cursor_name: str, cursor_flags: int) -> iResultSet
¶
Executes SQL statement potentially returning multiple rows of data.
Returns iResultSet interface which should be used to fetch that data. Format of
output data is defined by out_metadata parameter, leaving it NULL default format
may be used. Parameter cursor_name specifies name of opened cursor (analogue of
isc_dsql_set_cursor_name()). Parameter cursor_flags is needed to open
bidirectional cursor setting it's value to Istatement::CURSOR_TYPE_SCROLLABLE.
Source code in firebird/driver/interfaces.py
ping() -> None
¶
Checks connection status. If test fails the only operation possible with attachment is to close it.
prepare(transaction: iTransaction, stmt: str, dialect: int, flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement
¶
Replaces isc_dsql_prepare(). Additional parameter flags makes it
possible to control what information will be preloaded from engine at once
(i.e. in single network packet for remote operation).
Source code in firebird/driver/interfaces.py
put_slice(transaction: iTransaction, id_: a.ISC_QUAD, sdl: bytes, param: bytes, slice_: bytes) -> None
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
que_events(callback: iEventCallbackImpl, events: bytes) -> iEvents
¶
Replaces isc_que_events() call. Instead callback function with
void* parameter callback interface is used.
Source code in firebird/driver/interfaces.py
reconnect_transaction(id_: bytes) -> iTransaction
¶
Makes it possible to connect to a transaction in limbo. Id parameter contains transaction number in network format of given length.
Source code in firebird/driver/interfaces.py
release() -> int
¶
start_transaction(tpb: bytes) -> iTransaction
¶
Partially replaces isc_start_multiple(), to start >1 transaction
distributed transactions coordinator should be used, also possible to join 2
transactions into single distributed transaction
Source code in firebird/driver/interfaces.py
transact_request(transaction: iTransaction, blr: bytes, in_msg: bytes, out_msg: bytes) -> None
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iAttachment_v4
¶
Bases: iAttachment_v3
Class that wraps IAttachment v4 interface for use from Python
- Reference firebird.driver.interfaces iAttachment
Source code in firebird/driver/interfaces.py
encoding: str
instance-attribute
¶
Encoding used for string values
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
cancel_operation(option: int) -> None
¶
compile_request(blr: bytes) -> iRequest
¶
create_batch(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata, params: bytes) -> iBatch
¶
Prepares stmt and creates .iBatch interface ready to accept multiple sets
of input parameters in in_metadata format. Leaving in_metadata None makes
batch use default format for stmt. Parameters block may be passed to create_batch
making it possible to adjust batch behavior.
Source code in firebird/driver/interfaces.py
create_blob(transaction: iTransaction, id_: a.ISC_QUAD, bpb: bytes | None = None) -> iBlob
¶
Creates new blob, stores it's identifier in id, replaces isc_create_blob2()
Source code in firebird/driver/interfaces.py
detach() -> None
¶
Replaces isc_detach_database(). On success releases interface.
drop_database() -> None
¶
Replaces isc_drop_database(). On success releases interface.
execute(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata | None = None, in_buffer: bytes | None = None, out_metadata: iMessageMetadata | None = None, out_buffer: bytes | None = None) -> None
¶
Executes any SQL statement except returning multiple rows of data.
Partial analogue of isc_dsql_execute2() - in and out XSLQDAs replaced with
input and output messages with appropriate buffers.
Source code in firebird/driver/interfaces.py
execute_dyn(transaction: iTransaction, dyn: bytes) -> None
¶
get_idle_timeout() -> int
¶
get_info(items: bytes, buffer: bytes) -> None
¶
get_slice(transaction: iTransaction, id_: a.ISC_QUAD, sdl: bytes, param: bytes, slice_: bytes) -> int
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
get_statement_timeout() -> int
¶
open_blob(transaction: iTransaction, id_: a.ISC_QUAD, bpb: bytes | None = None) -> iBlob
¶
Opens existing blob, replaces isc_open_blob2()
Source code in firebird/driver/interfaces.py
open_cursor(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata, in_buffer: bytes, out_metadata: iMessageMetadata, cursor_name: str, cursor_flags: int) -> iResultSet
¶
Executes SQL statement potentially returning multiple rows of data.
Returns iResultSet interface which should be used to fetch that data. Format of
output data is defined by out_metadata parameter, leaving it NULL default format
may be used. Parameter cursor_name specifies name of opened cursor (analogue of
isc_dsql_set_cursor_name()). Parameter cursor_flags is needed to open
bidirectional cursor setting it's value to Istatement::CURSOR_TYPE_SCROLLABLE.
Source code in firebird/driver/interfaces.py
ping() -> None
¶
Checks connection status. If test fails the only operation possible with attachment is to close it.
prepare(transaction: iTransaction, stmt: str, dialect: int, flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement
¶
Replaces isc_dsql_prepare(). Additional parameter flags makes it
possible to control what information will be preloaded from engine at once
(i.e. in single network packet for remote operation).
Source code in firebird/driver/interfaces.py
put_slice(transaction: iTransaction, id_: a.ISC_QUAD, sdl: bytes, param: bytes, slice_: bytes) -> None
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
que_events(callback: iEventCallbackImpl, events: bytes) -> iEvents
¶
Replaces isc_que_events() call. Instead callback function with
void* parameter callback interface is used.
Source code in firebird/driver/interfaces.py
reconnect_transaction(id_: bytes) -> iTransaction
¶
Makes it possible to connect to a transaction in limbo. Id parameter contains transaction number in network format of given length.
Source code in firebird/driver/interfaces.py
release() -> int
¶
set_idle_timeout(timeout: int) -> None
¶
set_statement_timeout(timeout: int) -> None
¶
start_transaction(tpb: bytes) -> iTransaction
¶
Partially replaces isc_start_multiple(), to start >1 transaction
distributed transactions coordinator should be used, also possible to join 2
transactions into single distributed transaction
Source code in firebird/driver/interfaces.py
transact_request(transaction: iTransaction, blr: bytes, in_msg: bytes, out_msg: bytes) -> None
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iAttachment
¶
Bases: iAttachment_v4
Class that wraps IAttachment v5 interface for use from Python
Source code in firebird/driver/interfaces.py
encoding: str
instance-attribute
¶
Encoding used for string values
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
cancel_operation(option: int) -> None
¶
compile_request(blr: bytes) -> iRequest
¶
create_batch(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata, params: bytes) -> iBatch
¶
Prepares stmt and creates .iBatch interface ready to accept multiple sets
of input parameters in in_metadata format. Leaving in_metadata None makes
batch use default format for stmt. Parameters block may be passed to create_batch
making it possible to adjust batch behavior.
Source code in firebird/driver/interfaces.py
create_blob(transaction: iTransaction, id_: a.ISC_QUAD, bpb: bytes | None = None) -> iBlob
¶
Creates new blob, stores it's identifier in id, replaces isc_create_blob2()
Source code in firebird/driver/interfaces.py
detach() -> None
¶
Replaces isc_detach_database(). On success releases interface.
Source code in firebird/driver/interfaces.py
drop_database() -> None
¶
Replaces isc_drop_database(). On success releases interface.
execute(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata | None = None, in_buffer: bytes | None = None, out_metadata: iMessageMetadata | None = None, out_buffer: bytes | None = None) -> None
¶
Executes any SQL statement except returning multiple rows of data.
Partial analogue of isc_dsql_execute2() - in and out XSLQDAs replaced with
input and output messages with appropriate buffers.
Source code in firebird/driver/interfaces.py
execute_dyn(transaction: iTransaction, dyn: bytes) -> None
¶
get_idle_timeout() -> int
¶
get_info(items: bytes, buffer: bytes) -> None
¶
get_slice(transaction: iTransaction, id_: a.ISC_QUAD, sdl: bytes, param: bytes, slice_: bytes) -> int
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
get_statement_timeout() -> int
¶
open_blob(transaction: iTransaction, id_: a.ISC_QUAD, bpb: bytes | None = None) -> iBlob
¶
Opens existing blob, replaces isc_open_blob2()
Source code in firebird/driver/interfaces.py
open_cursor(transaction: iTransaction, stmt: str, dialect: int, in_metadata: iMessageMetadata, in_buffer: bytes, out_metadata: iMessageMetadata, cursor_name: str, cursor_flags: int) -> iResultSet
¶
Executes SQL statement potentially returning multiple rows of data.
Returns iResultSet interface which should be used to fetch that data. Format of
output data is defined by out_metadata parameter, leaving it NULL default format
may be used. Parameter cursor_name specifies name of opened cursor (analogue of
isc_dsql_set_cursor_name()). Parameter cursor_flags is needed to open
bidirectional cursor setting it's value to Istatement::CURSOR_TYPE_SCROLLABLE.
Source code in firebird/driver/interfaces.py
ping() -> None
¶
Checks connection status. If test fails the only operation possible with attachment is to close it.
prepare(transaction: iTransaction, stmt: str, dialect: int, flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement
¶
Replaces isc_dsql_prepare(). Additional parameter flags makes it
possible to control what information will be preloaded from engine at once
(i.e. in single network packet for remote operation).
Source code in firebird/driver/interfaces.py
put_slice(transaction: iTransaction, id_: a.ISC_QUAD, sdl: bytes, param: bytes, slice_: bytes) -> None
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
que_events(callback: iEventCallbackImpl, events: bytes) -> iEvents
¶
Replaces isc_que_events() call. Instead callback function with
void* parameter callback interface is used.
Source code in firebird/driver/interfaces.py
reconnect_transaction(id_: bytes) -> iTransaction
¶
Makes it possible to connect to a transaction in limbo. Id parameter contains transaction number in network format of given length.
Source code in firebird/driver/interfaces.py
release() -> int
¶
set_idle_timeout(timeout: int) -> None
¶
set_statement_timeout(timeout: int) -> None
¶
start_transaction(tpb: bytes) -> iTransaction
¶
Partially replaces isc_start_multiple(), to start >1 transaction
distributed transactions coordinator should be used, also possible to join 2
transactions into single distributed transaction
Source code in firebird/driver/interfaces.py
transact_request(transaction: iTransaction, blr: bytes, in_msg: bytes, out_msg: bytes) -> None
¶
Support of ISC API
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iService_v3
¶
Bases: iReferenceCounted
Class that wraps IService v3 interface for use from Python
- Reference firebird.driver.interfaces iService_v4
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
detach() -> None
¶
Close attachment to services manager, on success releases interface.
Replaces isc_service_detach().
query(send: bytes, receive: bytes, buffer: bytes) -> None
¶
Send and request information to/from service, with different receive
may be used for both running services and to obtain various server-wide information.
Replaces isc_service_query().
Source code in firebird/driver/interfaces.py
release() -> int
¶
start(spb: bytes) -> None
¶
Start utility in services manager. Replaces isc_service_start().
firebird.driver.interfaces.iService_v4
¶
Bases: iService_v3
Class that wraps IService v4 interface for use from Python
- Reference firebird.driver.interfaces iService
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
detach() -> None
¶
Close attachment to services manager, on success releases interface.
Replaces isc_service_detach().
query(send: bytes, receive: bytes, buffer: bytes) -> None
¶
Send and request information to/from service, with different receive
may be used for both running services and to obtain various server-wide information.
Replaces isc_service_query().
Source code in firebird/driver/interfaces.py
release() -> int
¶
start(spb: bytes) -> None
¶
Start utility in services manager. Replaces isc_service_start().
firebird.driver.interfaces.iService
¶
Bases: iService_v4
Class that wraps IService v5 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
cancel() -> None
¶
Cancel wait of current query() call. Supported only for embedded connections.
detach() -> None
¶
Close attachment to services manager, on success releases interface.
Replaces isc_service_detach().
query(send: bytes, receive: bytes, buffer: bytes) -> None
¶
Send and request information to/from service, with different receive
may be used for both running services and to obtain various server-wide information.
Replaces isc_service_query().
Source code in firebird/driver/interfaces.py
release() -> int
¶
start(spb: bytes) -> None
¶
Start utility in services manager. Replaces isc_service_start().
firebird.driver.interfaces.iXpbBuilder
¶
Bases: iDisposable
Class that wraps IXpbBuilder interface for use from Python
Source code in firebird/driver/interfaces.py
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 | |
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
clear() -> None
¶
dispose() -> None
¶
find_first(tag: int) -> bool
¶
find_next() -> bool
¶
get_bigint() -> int
¶
get_buffer() -> bytes
¶
Returns the parameters block.
get_buffer_length() -> int
¶
get_bytes() -> bytes
¶
Returns value of current clumplet as bytes.
Source code in firebird/driver/interfaces.py
get_int() -> int
¶
get_length() -> int
¶
get_string(*, encoding: str = 'ascii', errors: str = 'strict') -> str
¶
Returns value of current clumplet as string.
Source code in firebird/driver/interfaces.py
get_tag() -> int
¶
insert_bigint(tag: int, value: int) -> None
¶
Inserts a clumplet with value representing integer in network format.
insert_bytes(tag: int, value: bytes) -> None
¶
Inserts a clumplet with value containing passed bytes.
insert_int(tag: int, value: int) -> None
¶
Inserts a clumplet with value representing integer in network format.
insert_string(tag: int, value: str, *, encoding: str = 'ascii', errors: str = 'strict') -> None
¶
Inserts a clumplet with value containing passed string.
Source code in firebird/driver/interfaces.py
insert_tag(tag: int) -> None
¶
is_eof() -> bool
¶
move_next() -> None
¶
remove_current() -> None
¶
Blobs¶
firebird.driver.interfaces.iBlob_v3
¶
Bases: iReferenceCounted
Class that wraps IBlob interface for use from Python
- Reference firebird.driver.interfaces iBlob
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
cancel() -> None
¶
close() -> None
¶
get_info(items: bytes, buffer: bytes) -> None
¶
get_info2(code: BlobInfoCode) -> Any
¶
Returns information about BLOB
Source code in firebird/driver/interfaces.py
get_segment(size: int, buffer: a.c_void_p, bytes_read: a.Cardinal) -> StateResult
¶
Replaces isc_get_segment(). Unlike it never returns isc_segstr_eof
and isc_segment errors (that are actually not errors), instead returns completion
codes .StateResult.NO_DATA and .StateResult.SEGMENT, normal return is .StateResult.OK.
Source code in firebird/driver/interfaces.py
put_segment(length: int, buffer: Any) -> None
¶
release() -> int
¶
firebird.driver.interfaces.iBlob
¶
Bases: iBlob_v3
Class that wraps IBlob interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
cancel() -> None
¶
close() -> None
¶
get_info(items: bytes, buffer: bytes) -> None
¶
get_info2(code: BlobInfoCode) -> Any
¶
Returns information about BLOB
Source code in firebird/driver/interfaces.py
get_segment(size: int, buffer: a.c_void_p, bytes_read: a.Cardinal) -> StateResult
¶
Replaces isc_get_segment(). Unlike it never returns isc_segstr_eof
and isc_segment errors (that are actually not errors), instead returns completion
codes .StateResult.NO_DATA and .StateResult.SEGMENT, normal return is .StateResult.OK.
Source code in firebird/driver/interfaces.py
put_segment(length: int, buffer: Any) -> None
¶
release() -> int
¶
Transactions¶
firebird.driver.interfaces.iTransaction_v3
¶
Bases: iReferenceCounted
Class that wraps ITransaction interface for use from Python
- Reference firebird.driver.interfaces iTransaction
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
commit() -> None
¶
commit_retaining() -> None
¶
disconnect() -> None
¶
enter_dtc() -> iTransaction
¶
get_info(items: bytes, buffer: bytes) -> None
¶
join(transaction: iTransaction) -> iTransaction
¶
Joins current transaction and passed as parameter transaction into single distributed transaction (using Dtc). On success both current transaction and passed as parameter transaction are released and should not be used any more.
Source code in firebird/driver/interfaces.py
prepare(message: bytes | None = None) -> None
¶
release() -> int
¶
rollback() -> None
¶
rollback_retaining() -> None
¶
validate(attachment: iAttachment) -> iTransaction
¶
This method is used to support distributed transactions coordinator
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iTransaction
¶
Bases: iTransaction_v3
Class that wraps ITransaction interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
commit() -> None
¶
commit_retaining() -> None
¶
disconnect() -> None
¶
enter_dtc() -> iTransaction
¶
get_info(items: bytes, buffer: bytes) -> None
¶
join(transaction: iTransaction) -> iTransaction
¶
Joins current transaction and passed as parameter transaction into single distributed transaction (using Dtc). On success both current transaction and passed as parameter transaction are released and should not be used any more.
Source code in firebird/driver/interfaces.py
prepare(message: bytes | None = None) -> None
¶
release() -> int
¶
rollback() -> None
¶
rollback_retaining() -> None
¶
validate(attachment: iAttachment) -> iTransaction
¶
This method is used to support distributed transactions coordinator
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iDtcStart
¶
Bases: iDisposable
Class that wraps IDtcStart interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_attachment(attachment: iAttachment) -> None
¶
Adds attachment, transaction for it will be started with default TPB
add_with_tpb(attachment: iAttachment, tpb: bytes) -> None
¶
Adds attachment and TPB which will be used to start transaction for this attachment
Source code in firebird/driver/interfaces.py
dispose() -> None
¶
start() -> iTransaction
¶
Start distributed transaction for accumulated attachments. On successful return DtcStart interface is disposed automatically.
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iDtc
¶
Bases: iVersioned
Class that wraps IDtc interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
join(one: iTransaction, two: iTransaction) -> iTransaction
¶
Joins 2 independent transactions into distributed transaction. On success both transactions passed to join() are released and pointers to them should not be used any more.
Source code in firebird/driver/interfaces.py
Metadata¶
firebird.driver.interfaces.iMessageMetadata_v3
¶
Bases: iReferenceCounted
Class that wraps IMessageMetadata v3 interface for use from Python
- Reference firebird.driver.interfaces iMessageMetadata
Source code in firebird/driver/interfaces.py
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | |
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
get_alias(index: int) -> str
¶
get_builder() -> iMetadataBuilder
¶
Returns MetadataBuilder interface initialized with this message metadata
get_charset(index: int) -> int
¶
Returns character set for character field and text blob
get_count() -> int
¶
Returns number of fields/parameters in a message. In all calls, containing index parameter, it's value should be: 0 <= index < getCount().
Source code in firebird/driver/interfaces.py
get_field(index: int) -> str
¶
get_length(index: int) -> int
¶
get_message_length() -> int
¶
Returns length of message buffer (use it to allocate memory for the buffer)
get_null_offset(index: int) -> int
¶
Returns offset of null indicator for a field in message buffer
get_offset(index: int) -> int
¶
Returns offset of field data in message buffer (use it to access data in message buffer)
get_owner(index: int) -> str
¶
get_relation(index: int) -> str
¶
Returns relation name (from which given field is selected)
get_scale(index: int) -> int
¶
get_subtype(index: int) -> int
¶
Returns blob field subtype (0 - binary, 1 - text, etc.)
get_type(index: int) -> SQLDataType
¶
is_nullable(index: int) -> bool
¶
firebird.driver.interfaces.iMessageMetadata
¶
Bases: iMessageMetadata_v3
Class that wraps IMessageMetadata v4 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
get_alias(index: int) -> str
¶
get_aligned_length() -> int
¶
Returns length of message buffer taking into an account alignment requirements (use it to allocate memory for an array of buffers and navigate through that array).
Source code in firebird/driver/interfaces.py
get_alignment() -> int
¶
get_builder() -> iMetadataBuilder
¶
Returns MetadataBuilder interface initialized with this message metadata
get_charset(index: int) -> int
¶
Returns character set for character field and text blob
get_count() -> int
¶
Returns number of fields/parameters in a message. In all calls, containing index parameter, it's value should be: 0 <= index < getCount().
Source code in firebird/driver/interfaces.py
get_field(index: int) -> str
¶
get_length(index: int) -> int
¶
get_message_length() -> int
¶
Returns length of message buffer (use it to allocate memory for the buffer)
get_null_offset(index: int) -> int
¶
Returns offset of null indicator for a field in message buffer
get_offset(index: int) -> int
¶
Returns offset of field data in message buffer (use it to access data in message buffer)
get_owner(index: int) -> str
¶
get_relation(index: int) -> str
¶
Returns relation name (from which given field is selected)
get_scale(index: int) -> int
¶
get_subtype(index: int) -> int
¶
Returns blob field subtype (0 - binary, 1 - text, etc.)
get_type(index: int) -> SQLDataType
¶
is_nullable(index: int) -> bool
¶
firebird.driver.interfaces.iMetadataBuilder_v3
¶
Bases: iReferenceCounted
Class that wraps IMetadataBuilder v3 interface for use from Python
- Reference firebird.driver.interfaces iMetadataBuilder
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_field() -> int
¶
add_ref() -> None
¶
get_metadata() -> iMessageMetadata
¶
Returns MessageMetadata interface built by this builder
move_name_to_index(name: str, index: int) -> None
¶
Reorganize fields in a message - move field 'name' to given position
release() -> int
¶
remove(index: int) -> None
¶
set_charset(index: int, charset: int) -> None
¶
set_length(index: int, length: int) -> None
¶
set_scale(index: int, scale: int) -> None
¶
set_subtype(index: int, subtype: int) -> None
¶
set_type(index: int, field_type: SQLDataType) -> None
¶
truncate(count: int) -> None
¶
firebird.driver.interfaces.iMetadataBuilder
¶
Bases: iMetadataBuilder_v3
Class that wraps IMetadataBuilder v4 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_field() -> int
¶
add_ref() -> None
¶
get_metadata() -> iMessageMetadata
¶
Returns MessageMetadata interface built by this builder
move_name_to_index(name: str, index: int) -> None
¶
Reorganize fields in a message - move field 'name' to given position
release() -> int
¶
remove(index: int) -> None
¶
set_alias(index: int, alias: str) -> None
¶
set_charset(index: int, charset: int) -> None
¶
set_field(index: int, field: str) -> None
¶
set_length(index: int, length: int) -> None
¶
set_owner(index: int, owner: str) -> None
¶
set_relation(index: int, relation: str) -> None
¶
set_scale(index: int, scale: int) -> None
¶
set_subtype(index: int, subtype: int) -> None
¶
set_type(index: int, field_type: SQLDataType) -> None
¶
truncate(count: int) -> None
¶
SQL execution¶
firebird.driver.interfaces.iStatement_v3
¶
Bases: iReferenceCounted
Class that wraps IStatement v3 interface for use from Python
- Reference firebird.driver.interfaces iStatement_v4
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
execute(transaction: iTransaction, in_meta: iMessageMetadata, in_buffer: bytes, out_meta: iMessageMetadata, out_buffer: bytes) -> None
¶
Executes any SQL statement except returning multiple rows of data.
Partial analogue of isc_dsql_execute2() - in and out XSLQDAs replaced with input
and output messages with appropriate buffers.
Source code in firebird/driver/interfaces.py
free() -> None
¶
get_affected_records() -> int
¶
get_flags() -> StatementFlag
¶
Returns flags describing how this statement should be executed, simplified replacement of getType() method
Source code in firebird/driver/interfaces.py
get_info(items: bytes, buffer: bytes) -> None
¶
get_input_metadata() -> iMessageMetadata
¶
get_output_metadata() -> iMessageMetadata
¶
get_plan(detailed: bool) -> str
¶
get_type() -> StatementType
¶
Statement type, currently can be found only in firebird sources in dsql/dsql.h
open_cursor(transaction: iTransaction, in_meta: iMessageMetadata, in_buffer: bytes, out_meta: iMessageMetadata, flags: CursorFlag) -> iResultSet
¶
Executes SQL statement potentially returning multiple rows of data. Returns ResultSet interface which should be used to fetch that data. Format of output data is defined by outMetadata parameter, leaving it NULL default format may be used. Parameter flags is needed to open bidirectional cursor setting it's value to IStatement::CURSOR_TYPE_SCROLLABLE.
Source code in firebird/driver/interfaces.py
release() -> int
¶
firebird.driver.interfaces.iStatement_v4
¶
Bases: iStatement_v3
Class that wraps IStatement v4 interface for use from Python
- Reference firebird.driver.interfaces iStatement
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
create_batch(in_meta: iMessageMetadata, params: bytes) -> iBatch
¶
execute(transaction: iTransaction, in_meta: iMessageMetadata, in_buffer: bytes, out_meta: iMessageMetadata, out_buffer: bytes) -> None
¶
Executes any SQL statement except returning multiple rows of data.
Partial analogue of isc_dsql_execute2() - in and out XSLQDAs replaced with input
and output messages with appropriate buffers.
Source code in firebird/driver/interfaces.py
free() -> None
¶
get_affected_records() -> int
¶
get_flags() -> StatementFlag
¶
Returns flags describing how this statement should be executed, simplified replacement of getType() method
Source code in firebird/driver/interfaces.py
get_info(items: bytes, buffer: bytes) -> None
¶
get_input_metadata() -> iMessageMetadata
¶
get_output_metadata() -> iMessageMetadata
¶
get_plan(detailed: bool) -> str
¶
get_timeout() -> int
¶
get_type() -> StatementType
¶
Statement type, currently can be found only in firebird sources in dsql/dsql.h
open_cursor(transaction: iTransaction, in_meta: iMessageMetadata, in_buffer: bytes, out_meta: iMessageMetadata, flags: CursorFlag) -> iResultSet
¶
Executes SQL statement potentially returning multiple rows of data. Returns ResultSet interface which should be used to fetch that data. Format of output data is defined by outMetadata parameter, leaving it NULL default format may be used. Parameter flags is needed to open bidirectional cursor setting it's value to IStatement::CURSOR_TYPE_SCROLLABLE.
Source code in firebird/driver/interfaces.py
release() -> int
¶
set_cursor_name(name: str) -> None
¶
firebird.driver.interfaces.iStatement
¶
Bases: iStatement_v4
Class that wraps IStatement v4 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
create_batch(in_meta: iMessageMetadata, params: bytes) -> iBatch
¶
execute(transaction: iTransaction, in_meta: iMessageMetadata, in_buffer: bytes, out_meta: iMessageMetadata, out_buffer: bytes) -> None
¶
Executes any SQL statement except returning multiple rows of data.
Partial analogue of isc_dsql_execute2() - in and out XSLQDAs replaced with input
and output messages with appropriate buffers.
Source code in firebird/driver/interfaces.py
free() -> None
¶
get_affected_records() -> int
¶
get_flags() -> StatementFlag
¶
Returns flags describing how this statement should be executed, simplified replacement of getType() method
Source code in firebird/driver/interfaces.py
get_info(items: bytes, buffer: bytes) -> None
¶
get_input_metadata() -> iMessageMetadata
¶
get_output_metadata() -> iMessageMetadata
¶
get_plan(detailed: bool) -> str
¶
get_timeout() -> int
¶
get_type() -> StatementType
¶
Statement type, currently can be found only in firebird sources in dsql/dsql.h
open_cursor(transaction: iTransaction, in_meta: iMessageMetadata, in_buffer: bytes, out_meta: iMessageMetadata, flags: CursorFlag) -> iResultSet
¶
Executes SQL statement potentially returning multiple rows of data. Returns ResultSet interface which should be used to fetch that data. Format of output data is defined by outMetadata parameter, leaving it NULL default format may be used. Parameter flags is needed to open bidirectional cursor setting it's value to IStatement::CURSOR_TYPE_SCROLLABLE.
Source code in firebird/driver/interfaces.py
release() -> int
¶
set_cursor_name(name: str) -> None
¶
firebird.driver.interfaces.iResultSet_v3
¶
Bases: iReferenceCounted
Class that wraps IResultSet interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
close() -> None
¶
fetch_absolute(position: int, message: bytes) -> StateResult
¶
Fetch record by it's absolute position in result set
Source code in firebird/driver/interfaces.py
fetch_first(message: bytes) -> StateResult
¶
fetch_last(message: bytes) -> StateResult
¶
fetch_next(message: bytes) -> StateResult
¶
Fetch next record, replaces isc_dsql_fetch(). This method (and other fetch methods) returns completion code Status::RESULT_NO_DATA when EOF is reached, Status::RESULT_OK on success.
Source code in firebird/driver/interfaces.py
fetch_prior(message: bytes) -> StateResult
¶
fetch_relative(offset: int, message: bytes) -> StateResult
¶
Fetch record by position relative to current
get_metadata() -> iMessageMetadata
¶
Get metadata for messages in result set, specially useful when result set is opened by IAttachment::openCursor() call with NULL output metadata format parameter (this is the only way to obtain message format in this case)
Source code in firebird/driver/interfaces.py
is_bof() -> bool
¶
is_eof() -> bool
¶
release() -> int
¶
set_delayed_output_format(fmt: iMessageMetadata) -> None
¶
Important: This item is for ISC API emulation only. It may be gone in future versions. Please do not use it!
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iResultSet
¶
Bases: iResultSet_v4
Class that wraps IResultSet interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
close() -> None
¶
fetch_absolute(position: int, message: bytes) -> StateResult
¶
Fetch record by it's absolute position in result set
Source code in firebird/driver/interfaces.py
fetch_first(message: bytes) -> StateResult
¶
fetch_last(message: bytes) -> StateResult
¶
fetch_next(message: bytes) -> StateResult
¶
Fetch next record, replaces isc_dsql_fetch(). This method (and other fetch methods) returns completion code Status::RESULT_NO_DATA when EOF is reached, Status::RESULT_OK on success.
Source code in firebird/driver/interfaces.py
fetch_prior(message: bytes) -> StateResult
¶
fetch_relative(offset: int, message: bytes) -> StateResult
¶
Fetch record by position relative to current
get_info(items: bytes, buffer: bytes) -> None
¶
get_metadata() -> iMessageMetadata
¶
Get metadata for messages in result set, specially useful when result set is opened by IAttachment::openCursor() call with NULL output metadata format parameter (this is the only way to obtain message format in this case)
Source code in firebird/driver/interfaces.py
is_bof() -> bool
¶
is_eof() -> bool
¶
release() -> int
¶
set_delayed_output_format(fmt: iMessageMetadata) -> None
¶
Important: This item is for ISC API emulation only. It may be gone in future versions. Please do not use it!
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iBatch_v3
¶
Bases: iReferenceCounted
Class that wraps IBatch interface for use from Python
- Reference firebird.driver.interfaces iBatch
Source code in firebird/driver/interfaces.py
879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 | |
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add(count: int, in_buffer: bytes) -> None
¶
Adds count messages from inBuffer to the batch. Total size of messages that can be added to the batch is limited by TAG_BUFFER_BYTES_SIZE parameter of batch creation.
Source code in firebird/driver/interfaces.py
add_blob(length: int, in_buffer: bytes, id_: a.ISC_QUAD, params: bytes) -> None
¶
Adds single blob having length bytes from in_buffer to the batch,
blob identifier is located at id_ address. If blob should be created with
non-default parameters BPB may be passed (format matches one used in
~.iAttachment_v3.create_blob). Total size of inline blobs that can be added to the
batch (including optional BPBs, blob headers, segment sizes and taking into an
accoount alignment) is limited by TAG_BUFFER_BYTES_SIZE parameter of batch creation
(affects all blob-oriented methods except register_blob()).
Source code in firebird/driver/interfaces.py
add_blob_stream(length: int, in_buffer: bytes) -> None
¶
Adds blob data (this can be multiple objects or part of single blob) to the batch.
Header of each blob in the stream is aligned at get_blob_alignment() boundary
and contains 3 fields: first - 8-bytes blob identifier (in ISC_QUAD format),
second - 4-bytes length of blob, third - 4-bytes length of BPB. Blob header should
not cross boundaries of buffer in this function call. BPB data is placed right after
header, blob data goes next. Length of blob includes BPB (if it present). All data
may be distributed between multiple add_blob_stream() calls. Blob data in turn
may be structured in case of segmented blob, see chapter “Modifying data in a batch”
in Using_OO_API guide.
Source code in firebird/driver/interfaces.py
add_ref() -> None
¶
append_blob_data(length: int, in_buffer: bytes) -> None
¶
Extend last added blob: append length bytes taken from in_buffer to it.
cancel() -> None
¶
Clear messages and blobs buffers, return batch to a state it had right after creation.
Note
Being reference counted interface batch does not contain any special function to close it, please use release() for this purposes.
Source code in firebird/driver/interfaces.py
close() -> None
¶
Sets BPB which will be used for all blobs missing non-default BPB. Must be called before adding any message or blob to batch.
execute(transaction: iTransaction) -> iBatchCompletionState
¶
Execute batch with parameters passed to it in the messages. If parameter
MULTIERROR is not set in parameters block when creating the batch execution will be
stopped after first error, in MULTIERROR mode an unlimited number of errors can
happen, after an error execution is continued from the next message. This function
returns .iBatchCompletionState interface that contains all requested information
about the results of batch execution.
Source code in firebird/driver/interfaces.py
get_blob_alignment() -> int
¶
Returns required alignment for the data placed into the buffer of .add_blob_stream().
get_metadata() -> iMessageMetadata
¶
Returns format of metadata used in batch's messages.
register_blob(existing: a.ISC_QUAD, id_: a.ISC_QUAD)
¶
Makes it possible to use in batch blobs added using standard Blob interface.
This function contains 2 ISC_QUAD* parameters, it's important not to mix them -
first parameter (existing) is a blob identifier, already added out of batch scope,
second (id_) is blob identifier that will be placed in a message in this batch.
Source code in firebird/driver/interfaces.py
release() -> int
¶
set_default_bpb(bpb: bytes) -> None
¶
Sets BPB which will be used for all blobs missing non-default BPB. Must be called before adding any message or blob to batch.
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iBatch
¶
Bases: iBatch_v3
Class that wraps IBatch interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add(count: int, in_buffer: bytes) -> None
¶
Adds count messages from inBuffer to the batch. Total size of messages that can be added to the batch is limited by TAG_BUFFER_BYTES_SIZE parameter of batch creation.
Source code in firebird/driver/interfaces.py
add_blob(length: int, in_buffer: bytes, id_: a.ISC_QUAD, params: bytes) -> None
¶
Adds single blob having length bytes from in_buffer to the batch,
blob identifier is located at id_ address. If blob should be created with
non-default parameters BPB may be passed (format matches one used in
~.iAttachment_v3.create_blob). Total size of inline blobs that can be added to the
batch (including optional BPBs, blob headers, segment sizes and taking into an
accoount alignment) is limited by TAG_BUFFER_BYTES_SIZE parameter of batch creation
(affects all blob-oriented methods except register_blob()).
Source code in firebird/driver/interfaces.py
add_blob_stream(length: int, in_buffer: bytes) -> None
¶
Adds blob data (this can be multiple objects or part of single blob) to the batch.
Header of each blob in the stream is aligned at get_blob_alignment() boundary
and contains 3 fields: first - 8-bytes blob identifier (in ISC_QUAD format),
second - 4-bytes length of blob, third - 4-bytes length of BPB. Blob header should
not cross boundaries of buffer in this function call. BPB data is placed right after
header, blob data goes next. Length of blob includes BPB (if it present). All data
may be distributed between multiple add_blob_stream() calls. Blob data in turn
may be structured in case of segmented blob, see chapter “Modifying data in a batch”
in Using_OO_API guide.
Source code in firebird/driver/interfaces.py
add_ref() -> None
¶
append_blob_data(length: int, in_buffer: bytes) -> None
¶
Extend last added blob: append length bytes taken from in_buffer to it.
cancel() -> None
¶
Clear messages and blobs buffers, return batch to a state it had right after creation.
Note
Being reference counted interface batch does not contain any special function to close it, please use release() for this purposes.
Source code in firebird/driver/interfaces.py
close() -> None
¶
Sets BPB which will be used for all blobs missing non-default BPB. Must be called before adding any message or blob to batch.
execute(transaction: iTransaction) -> iBatchCompletionState
¶
Execute batch with parameters passed to it in the messages. If parameter
MULTIERROR is not set in parameters block when creating the batch execution will be
stopped after first error, in MULTIERROR mode an unlimited number of errors can
happen, after an error execution is continued from the next message. This function
returns .iBatchCompletionState interface that contains all requested information
about the results of batch execution.
Source code in firebird/driver/interfaces.py
get_blob_alignment() -> int
¶
Returns required alignment for the data placed into the buffer of .add_blob_stream().
get_info(items: bytes, buffer: bytes) -> None
¶
get_metadata() -> iMessageMetadata
¶
Returns format of metadata used in batch's messages.
register_blob(existing: a.ISC_QUAD, id_: a.ISC_QUAD)
¶
Makes it possible to use in batch blobs added using standard Blob interface.
This function contains 2 ISC_QUAD* parameters, it's important not to mix them -
first parameter (existing) is a blob identifier, already added out of batch scope,
second (id_) is blob identifier that will be placed in a message in this batch.
Source code in firebird/driver/interfaces.py
release() -> int
¶
set_default_bpb(bpb: bytes) -> None
¶
Sets BPB which will be used for all blobs missing non-default BPB. Must be called before adding any message or blob to batch.
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iBatchCompletionState
¶
Bases: iDisposable
Class that wraps IBatchCompletionState interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
dispose() -> None
¶
find_error(pos: int) -> int
¶
Finds next (starting with pos) message which processing caused an error. When
such message is missing NO_MORE_ERRORS constant is returned. Number of status vectors,
returned in this interface, is limited by the value of .DETAILED_ERRORS parameter
of batch creation.
Source code in firebird/driver/interfaces.py
get_size() -> int
¶
get_state(pos: int) -> int
¶
Returns the result of execution of message number pos. On any error with the
message this is .EXECUTE_FAILED constant, value returned on success depends upon
presence of .RECORD_COUNTS parameter of batch creation. When it present and has
non-zero value number of records inserted, updated or deleted during particular
message processing is returned, else .SUCCESS_NO_INFO constant is returned.
Source code in firebird/driver/interfaces.py
get_status(pos: int) -> iStatus
¶
Returns detailed information (full status vector) about an error that took place
when processing pos message.
Source code in firebird/driver/interfaces.py
Events¶
firebird.driver.interfaces.iEvents_v3
¶
Bases: iReferenceCounted
Class that wraps IEvents interface for use from Python
- Reference firebird.driver.interfaces iEvents
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iEvents
¶
Utilities¶
firebird.driver.interfaces.iTimerControl
¶
Bases: iVersioned
Class that wraps ITimerControl interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
start(timer: iTimerImpl, microseconds: int) -> None
¶
Start ITimer to alarm after given delay (in microseconds, 10-6 seconds). Timer will be waked up only once after this call.
Source code in firebird/driver/interfaces.py
stop(timer: iTimerImpl) -> None
¶
Stop ITimer. It's not an error to stop not started timer thus avoiding problems with races between stop() and timer alarm.
firebird.driver.interfaces.iUtil_v2
¶
Bases: iVersioned
Class that wraps IUtil v2 interface for use from Python
- Reference firebird.driver.interfaces iUtil
Source code in firebird/driver/interfaces.py
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | |
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
decode_date(date: a.ISC_DATE | bytes) -> datetime.date
¶
Replaces isc_decode_sql_date()
Source code in firebird/driver/interfaces.py
decode_time(atime: a.ISC_TIME | bytes) -> datetime.time
¶
Replaces isc_decode_sql_time()
Source code in firebird/driver/interfaces.py
dump_blob(blob_id: a.ISC_QUAD, attachment: iAttachment, transaction: iTransaction, filename: str, is_text: bool) -> None
¶
Save blob to file
Source code in firebird/driver/interfaces.py
encode_date(date: datetime.date) -> a.ISC_DATE
¶
encode_time(atime: datetime.time) -> a.ISC_TIME
¶
execute_create_database(stmt: str, dialect: int) -> iAttachment
¶
Execute “CREATE DATABASE ...” statement - ISC trick with NULL statement handle does not work with interfaces.
Source code in firebird/driver/interfaces.py
format_status(status: iStatus, encoding: str = a.err_encoding) -> str
¶
Replaces fb_interpret().
Source code in firebird/driver/interfaces.py
get_client_version() -> tuple[int, int]
¶
Returns the client library's major and minor version numbers.
get_fb_version(attachment: iAttachment, callback: iVersionCallbackImpl) -> None
¶
Produce long and beautiful report about firebird version used. It may be seen in ISQL when invoked with -Z switch.
Source code in firebird/driver/interfaces.py
get_perf_counters(attachment: iAttachment, counters_set: str) -> int
¶
Get statistics for given attachment
Source code in firebird/driver/interfaces.py
get_xpb_builder(kind: XpbKind, buffer: bytes | None = None) -> iXpbBuilder
¶
Returns XpbBuilder interface.
Source code in firebird/driver/interfaces.py
load_blob(blob_id: a.ISC_QUAD, attachment: iAttachment, transaction: iTransaction, filename: str, is_text: bool) -> None
¶
Load blob from file
Source code in firebird/driver/interfaces.py
set_offsets(metadata: iMessageMetadata, callback: iOffsetsCallbackImp) -> int
¶
Sets valid offsets in MessageMetadata. Performs calls to callback in OffsetsCallback for each field/parameter.
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iUtil
¶
Bases: iUtil_v2
Class that wraps IUtil v4 interface for use from Python
Source code in firebird/driver/interfaces.py
1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 | |
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
decode_date(date: a.ISC_DATE | bytes) -> datetime.date
¶
Replaces isc_decode_sql_date()
Source code in firebird/driver/interfaces.py
decode_time(atime: a.ISC_TIME | bytes) -> datetime.time
¶
Replaces isc_decode_sql_time()
Source code in firebird/driver/interfaces.py
decode_time_tz(timetz: a.ISC_TIME_TZ | bytes) -> datetime.time
¶
Decodes TIME WITH TIMEZONE from internal format to datetime.time with tzinfo.
Source code in firebird/driver/interfaces.py
decode_time_tz_ex(timetz: a.ISC_TIME_TZ_EX, hours: a.Cardinal, minutes: a.Cardinal, seconds: a.Cardinal, fractions: a.Cardinal, zone_bufer: bytes)
¶
TODO
Source code in firebird/driver/interfaces.py
decode_timestamp_tz(timestamptz: a.ISC_TIMESTAMP_TZ | bytes) -> datetime.datetime
¶
Decodes TIMESTAMP WITH TIMEZONE from internal format to datetime.datetime with tzinfo.
Source code in firebird/driver/interfaces.py
decode_timestamp_tz_ex(timestamptz: a.ISC_TIMESTAMP_TZ_EX, year: a.Cardinal, month: a.Cardinal, day: a.Cardinal, hours: a.Cardinal, minutes: a.Cardinal, seconds: a.Cardinal, fractions: a.Cardinal, zone_bufer: bytes)
¶
TODO
Source code in firebird/driver/interfaces.py
dump_blob(blob_id: a.ISC_QUAD, attachment: iAttachment, transaction: iTransaction, filename: str, is_text: bool) -> None
¶
Save blob to file
Source code in firebird/driver/interfaces.py
encode_date(date: datetime.date) -> a.ISC_DATE
¶
encode_time(atime: datetime.time) -> a.ISC_TIME
¶
encode_time_tz(time: datetime.time) -> bytes
¶
Encodes datetime.time with tzinfo into internal format for TIME WITH TIMEZONE.
Source code in firebird/driver/interfaces.py
encode_timestamp_tz(timestamp: datetime.datetime) -> bytes
¶
Encodes datetime.datetime with tzinfo into internal format for TIMESTAMP WITH TIMEZONE.
Source code in firebird/driver/interfaces.py
execute_create_database(stmt: str, dialect: int) -> iAttachment
¶
Execute “CREATE DATABASE ...” statement - ISC trick with NULL statement handle does not work with interfaces.
Source code in firebird/driver/interfaces.py
format_status(status: iStatus, encoding: str = a.err_encoding) -> str
¶
Replaces fb_interpret().
Source code in firebird/driver/interfaces.py
get_client_version() -> tuple[int, int]
¶
Returns the client library's major and minor version numbers.
get_decfloat16() -> iDecFloat16
¶
get_decfloat34() -> iDecFloat34
¶
get_fb_version(attachment: iAttachment, callback: iVersionCallbackImpl) -> None
¶
Produce long and beautiful report about firebird version used. It may be seen in ISQL when invoked with -Z switch.
Source code in firebird/driver/interfaces.py
get_int128() -> iInt128
¶
get_perf_counters(attachment: iAttachment, counters_set: str) -> int
¶
Get statistics for given attachment
Source code in firebird/driver/interfaces.py
get_xpb_builder(kind: XpbKind, buffer: bytes | None = None) -> iXpbBuilder
¶
Returns XpbBuilder interface.
Source code in firebird/driver/interfaces.py
load_blob(blob_id: a.ISC_QUAD, attachment: iAttachment, transaction: iTransaction, filename: str, is_text: bool) -> None
¶
Load blob from file
Source code in firebird/driver/interfaces.py
set_offsets(metadata: iMessageMetadata, callback: iOffsetsCallbackImp) -> int
¶
Sets valid offsets in MessageMetadata. Performs calls to callback in OffsetsCallback for each field/parameter.
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iDecFloat16
¶
Bases: iVersioned
Class that wraps IDecFloat16 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
from_bcd(value: BCD, into: a.FB_DEC16 = None) -> a.FB_DEC16
¶
Make decimal float value from BCD
Source code in firebird/driver/interfaces.py
from_str(value: str, into: a.FB_DEC16 = None) -> a.FB_DEC16
¶
Make decimal float value from string
Source code in firebird/driver/interfaces.py
to_bcd(value: a.FB_DEC16) -> BCD
¶
Convert decimal float value to BCD
Source code in firebird/driver/interfaces.py
to_str(value: a.FB_DEC16) -> str
¶
Convert decimal float value to string
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iDecFloat34
¶
Bases: iVersioned
Class that wraps IDecFloat34 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
from_bcd(value: BCD, into: a.FB_DEC34 = None) -> a.FB_DEC34
¶
Make decimal float value from BCD
Source code in firebird/driver/interfaces.py
from_str(value: str, into: a.FB_DEC34 = None) -> a.FB_DEC34
¶
Make decimal float value from string
Source code in firebird/driver/interfaces.py
to_bcd(value: a.FB_DEC34) -> BCD
¶
Convert decimal float value to BCD
Source code in firebird/driver/interfaces.py
to_str(value: a.FB_DEC34) -> str
¶
Convert decimal float value to string
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iInt128
¶
Bases: iVersioned
Class that wraps IInt128 interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
from_str(value: str, scale: int, into: a.FB_I128 = None) -> a.FB_I128
¶
Converts string to INT128
Source code in firebird/driver/interfaces.py
to_str(value: a.FB_I128, scale: int) -> str
¶
Converts INT128 to string
Source code in firebird/driver/interfaces.py
Other¶
firebird.driver.interfaces.iPluginManager
¶
Bases: iVersioned
IPluginManager interface wrapper. This is only STUB.
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iRequest_v3
¶
Bases: iReferenceCounted
Class that wraps IRequest interface for use from Python
- Reference firebird.driver.interfaces iRequest
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
free() -> None
¶
get_info(level: int, items: bytes, buffer: bytes) -> None
¶
receive(level: int, msg_type: int, message: bytes) -> None
¶
release() -> int
¶
send(level: int, msg_type: int, message: bytes) -> None
¶
start(transaction: iTransaction, level: int) -> None
¶
start_and_send(transaction: iTransaction, level: int, msg_type: int, message: bytes) -> None
¶
Information not available
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iRequest
¶
Bases: iRequest_v3
Class that wraps IRequest interface for use from Python
Source code in firebird/driver/interfaces.py
status: iStatus
property
¶
iStatus for interface
version: int
property
¶
Interface version
vtable
property
¶
Interface method table
add_ref() -> None
¶
free() -> None
¶
get_info(level: int, items: bytes, buffer: bytes) -> None
¶
receive(level: int, msg_type: int, message: bytes) -> None
¶
release() -> int
¶
send(level: int, msg_type: int, message: bytes) -> None
¶
start(transaction: iTransaction, level: int) -> None
¶
start_and_send(transaction: iTransaction, level: int, msg_type: int, message: bytes) -> None
¶
Information not available
Source code in firebird/driver/interfaces.py
Interface implementations¶
firebird.driver.interfaces.iVersionedImpl
¶
Base class for objects that implement IVersioned interface
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iReferenceCountedImpl
¶
Bases: iVersionedImpl
IReferenceCounted interface wrapper
Source code in firebird/driver/interfaces.py
add_ref() -> None
¶
firebird.driver.interfaces.iDisposableImpl
¶
Bases: iVersionedImpl
IDisposable interface wrapper
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iVersionCallbackImpl
¶
Bases: iVersionedImpl
Class that wraps IVersionCallback interface for use from Python
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iCryptKeyCallbackImpl
¶
Bases: iVersionedImpl
Class that wraps ICryptKeyCallback interface for use from Python
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iOffsetsCallbackImp
¶
Bases: iVersionedImpl
Class that wraps IOffsetsCallback interface for use from Python
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iEventCallbackImpl
¶
Bases: iReferenceCountedImpl
IEventCallback interface wrapper
Source code in firebird/driver/interfaces.py
firebird.driver.interfaces.iTimerImpl
¶
Bases: iReferenceCountedImpl
Class that wraps ITimer interface for use from Python