firebird.driver.interfaces¶
This module contains interface wrappers for Firebird new API.
Classes¶
iVersionedMeta¶
Firebird API Interface wrappers¶
iVersioned¶
iReferenceCounted¶
iDisposable¶
- class firebird.driver.interfaces.iDisposable(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
IDisposable interface wrapper
- VERSION = 2¶
iStatus¶
- class firebird.driver.interfaces.iStatus(intf)¶
Bases:
firebird.driver.interfaces.iDisposable
Class that wraps IStatus interface for use from Python
- get_errors()¶
Returns errors vector
- Return type
LP_c_long_Array_20
- get_warning()¶
Returns warnings vector
- Return type
LP_c_long_Array_20
- set_errors(value)¶
Set contents of errors vector, length is defined by value context
- Return type
- set_errors2(length, value)¶
Set contents of errors vector with length explicitly specified in a call
- Return type
- set_warning2(length, value)¶
Set contents of warnings vector with length explicitly specified in a call
- Return type
- set_warnings(value)¶
Set contents of warnings vector, length is defined by value context
- Return type
- VERSION = 3¶
iPluginBase¶
- class firebird.driver.interfaces.iPluginBase(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
IPluginBase interface wrapper
- get_owner()¶
Returns owner
- Return type
- VERSION = 3¶
iConfigEntry¶
- class firebird.driver.interfaces.iConfigEntry(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IConfigEntry interface for use from Python
- get_sub_config(status)¶
Treats sub-entries as separate configuration file and returns IConfig interface for it
- Return type
- VERSION = 3¶
iConfig¶
- class firebird.driver.interfaces.iConfig(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IConfig interface for use from Python
- find(name)¶
Find entry by name
- Return type
- find_pos(name, pos)¶
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.- Return type
- find_value(name, value)¶
Find entry by name and value
- Return type
- VERSION = 3¶
iFirebirdConf_v3¶
- class firebird.driver.interfaces.iFirebirdConf_v3(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IFirebirdConf v3 interface for use from Python
- get_key(name)¶
Returns key for configuration parameter.
Note
If parameter with given name does not exists, returns 0xffffffff.
- Return type
- VERSION = 3¶
iFirebirdConf¶
- class firebird.driver.interfaces.iFirebirdConf(intf)¶
Bases:
firebird.driver.interfaces.iFirebirdConf_v3
Class that wraps IFirebirdConf v4 interface for use from Python
- VERSION = 4¶
iPluginManager¶
- class firebird.driver.interfaces.iPluginManager(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
IPluginManager interface wrapper. This is only STUB.
- VERSION = 2¶
iConfigManager_v2¶
- class firebird.driver.interfaces.iConfigManager_v2(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
Class that wraps IConfigManager v2 interface for use from Python
- get_database_conf(database)¶
Returns interface to access db-specific configuration. Takes into an account firebird.conf and appropriate part of databases.conf.
- Return type
- get_directory(dirspec)¶
Returns location of appropriate directory in current firebird instance
- Return type
- get_firebird_conf()¶
Returns interface to access default configuration values (from firebird.conf)
- Return type
- get_plugin_config(plugin)¶
Returns interface to access named plugin configuration
- Return type
- get_root_directory()¶
Returns root directory of current instance, in single-instance case usually matches install directory
- Return type
- VERSION = 2¶
iConfigManager¶
- class firebird.driver.interfaces.iConfigManager(intf)¶
Bases:
firebird.driver.interfaces.iConfigManager_v2
Class that wraps IConfigManager v3 interface for use from Python
- VERSION = 3¶
iBlob¶
- class firebird.driver.interfaces.iBlob(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IBlob interface for use from Python
- get_segment(size, buffer, bytes_read)¶
Replaces
isc_get_segment()
. Unlike it never returnsisc_segstr_eof
andisc_segment
errors (that are actually not errors), instead returns completion codes IStatus::RESULT_NO_DATA and IStatus::RESULT_SEGMENT, normal return is IStatus::RESULT_OK.- Return type
- VERSION = 3¶
iTransaction¶
- class firebird.driver.interfaces.iTransaction(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps ITransaction interface for use from Python
- enter_dtc()¶
This method is used to support distributed transactions coordinator
- Return type
- join(transaction)¶
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.
- Return type
- validate(attachment)¶
This method is used to support distributed transactions coordinator
- Return type
- VERSION = 3¶
iMessageMetadata_v3¶
- class firebird.driver.interfaces.iMessageMetadata_v3(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IMessageMetadata v3 interface for use from Python
- get_builder()¶
Returns MetadataBuilder interface initialized with this message metadata
- Return type
- get_count()¶
Returns number of fields/parameters in a message. In all calls, containing index parameter, it’s value should be: 0 <= index < getCount().
- Return type
- get_message_length()¶
Returns length of message buffer (use it to allocate memory for the buffer)
- Return type
- get_null_offset(index)¶
Returns offset of null indicator for a field in message buffer
- Return type
- get_offset(index)¶
Returns offset of field data in message buffer (use it to access data in message buffer)
- Return type
- get_type(index)¶
Returns field SQL type
- Return type
- VERSION = 3¶
iMessageMetadata¶
iMetadataBuilder_v3¶
- class firebird.driver.interfaces.iMetadataBuilder_v3(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IMetadataBuilder v3 interface for use from Python
- get_metadata()¶
Returns MessageMetadata interface built by this builder
- Return type
- move_name_to_index(name, index)¶
Reorganize fields in a message – move field “name” to given position
- Return type
- VERSION = 3¶
iMetadataBuilder¶
- class firebird.driver.interfaces.iMetadataBuilder(intf)¶
Bases:
firebird.driver.interfaces.iMetadataBuilder_v3
Class that wraps IMetadataBuilder v4 interface for use from Python
- VERSION = 4¶
iResultSet¶
- class firebird.driver.interfaces.iResultSet(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IResultSet interface for use from Python
- fetch_absolute(position, message)¶
Fetch record by it’s absolute position in result set
- Return type
- fetch_first(message)¶
Fetch first record
- Return type
- fetch_last(message)¶
Fetch last record
- Return type
- fetch_next(message)¶
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.
- Return type
- fetch_prior(message)¶
Fetch previous record
- Return type
- fetch_relative(offset, message)¶
Fetch record by position relative to current
- Return type
- get_metadata()¶
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)
- Return type
- VERSION = 3¶
iStatement_v3¶
- class firebird.driver.interfaces.iStatement_v3(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IStatement v3 interface for use from Python
- execute(transaction, in_meta, in_buffer, out_meta, out_buffer)¶
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.- Return type
- get_flags()¶
Returns flags describing how this statement should be executed, simplified replacement of getType() method
- Return type
- get_input_metadata()¶
Returns parameters metadata
- Return type
- get_output_metadata()¶
Returns output values metadata
- Return type
- get_type()¶
Statement type, currently can be found only in firebird sources in
dsql/dsql.h
- Return type
- open_cursor(transaction, in_meta, in_buffer, out_meta, flags)¶
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.
- Return type
- VERSION = 3¶
iStatement¶
- class firebird.driver.interfaces.iStatement(intf)¶
Bases:
firebird.driver.interfaces.iStatement_v3
Class that wraps IStatement v4 interface for use from Python
- VERSION = 4¶
iBatch¶
iBatchCompletionState¶
- class firebird.driver.interfaces.iBatchCompletionState(intf)¶
Bases:
firebird.driver.interfaces.iDisposable
Class that wraps IBatchCompletionState interface for use from Python
- VERSION = 3¶
iRequest¶
- class firebird.driver.interfaces.iRequest(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IRequest interface for use from Python
- VERSION = 3¶
iEvents¶
- class firebird.driver.interfaces.iEvents(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IEvents interface for use from Python
- VERSION = 3¶
iAttachment_v3¶
- class firebird.driver.interfaces.iAttachment_v3(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IAttachment v3 interface for use from Python
- create_blob(transaction, id_, bpb=None)¶
Creates new blob, stores it’s identifier in id, replaces
isc_create_blob2()
- Return type
- execute(transaction, stmt, dialect, in_metadata=None, in_buffer=None, out_metadata=None, out_buffer=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.- Return type
- open_blob(transaction, id_, bpb=None)¶
Opens existing blob, replaces
isc_open_blob2()
- Return type
- open_cursor(transaction, stmt, dialect, in_metadata, in_buffer, out_metadata, cursor_name, cursor_flags)¶
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.- Return type
- ping()¶
Checks connection status. If test fails the only operation possible with attachment is to close it.
- Return type
- prepare(transaction, stmt, dialect, flags=PreparePrefetchFlag.METADATA)¶
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).- Return type
- que_events(callback, events)¶
Replaces
isc_que_events()
call. Instead callback function with void* parameter callback interface is used.- Return type
- reconnect_transaction(id_)¶
Makes it possible to connect to a transaction in limbo. Id parameter contains transaction number in network format of given length.
- Return type
- start_transaction(tpb)¶
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- Return type
- VERSION = 3¶
iAttachment¶
- class firebird.driver.interfaces.iAttachment(intf)¶
Bases:
firebird.driver.interfaces.iAttachment_v3
Class that wraps IAttachment v4 interface for use from Python
- VERSION = 4¶
iService¶
- class firebird.driver.interfaces.iService(intf)¶
Bases:
firebird.driver.interfaces.iReferenceCounted
Class that wraps IService interface for use from Python
- detach()¶
Close attachment to services manager, on success releases interface. Replaces
isc_service_detach()
.- Return type
- query(send, receive, buffer)¶
Send and request information to/from service, with different
receive
may be used for both running services and to obtain various server-wide information. Replacesisc_service_query()
.- Return type
- VERSION = 3¶
iProvider¶
- class firebird.driver.interfaces.iProvider(intf)¶
Bases:
firebird.driver.interfaces.iPluginBase
Class that wraps IProvider interface for use from Python
- attach_database(filename, dpb=None, encoding='ascii')¶
Replaces
isc_attach_database()
- Return type
- create_database(filename, dpb, encoding='ascii')¶
Replaces
isc_create_database()
- Return type
- set_dbcrypt_callback(callback)¶
Sets database encryption callback interface that will be used for following database and service attachments
- Return type
- VERSION = 4¶
iDtcStart¶
- class firebird.driver.interfaces.iDtcStart(intf)¶
Bases:
firebird.driver.interfaces.iDisposable
Class that wraps IDtcStart interface for use from Python
- add_attachment(attachment)¶
Adds attachment, transaction for it will be started with default TPB
- Return type
- add_with_tpb(attachment, tpb)¶
Adds attachment and TPB which will be used to start transaction for this attachment
- Return type
- start()¶
Start distributed transaction for accumulated attachments. On successful return DtcStart interface is disposed automatically.
- Return type
- VERSION = 3¶
iDtc¶
- class firebird.driver.interfaces.iDtc(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
Class that wraps IDtc interface for use from Python
- join(one, two)¶
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.
- Return type
- VERSION = 2¶
iTimerControl¶
- class firebird.driver.interfaces.iTimerControl(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
Class that wraps ITimerControl interface for use from Python
- start(timer, microseconds)¶
Start ITimer to alarm after given delay (in microseconds, 10-6 seconds). Timer will be waked up only once after this call.
- Return type
- stop(timer)¶
Stop ITimer. It’s not an error to stop not started timer thus avoiding problems with races between stop() and timer alarm.
- Return type
- VERSION = 2¶
iXpbBuilder¶
- class firebird.driver.interfaces.iXpbBuilder(intf)¶
Bases:
firebird.driver.interfaces.iDisposable
Class that wraps IXpbBuilder interface for use from Python
- get_string(*, encoding='ascii', errors='strict')¶
Returns value of current clumplet as string.
- Return type
- insert_bigint(tag, value)¶
Inserts a clumplet with value representing integer in network format.
- Return type
- insert_int(tag, value)¶
Inserts a clumplet with value representing integer in network format.
- Return type
- insert_string(tag, value, *, encoding='ascii', errors='strict')¶
Inserts a clumplet with value containing passed string.
- Return type
- VERSION = 3¶
iUtil_v2¶
- class firebird.driver.interfaces.iUtil_v2(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
Class that wraps IUtil v2 interface for use from Python
- execute_create_database(stmt, dialect)¶
Execute “CREATE DATABASE …” statement – ISC trick with NULL statement handle does not work with interfaces.
- Return type
- get_client_version()¶
Returns integer, containing major version in byte 0 and minor version in byte 1
- Return type
- get_fb_version(attachment, callback)¶
Produce long and beautiful report about firebird version used. It may be seen in ISQL when invoked with -Z switch.
- Return type
- get_xpb_builder(kind, buffer=None)¶
Returns XpbBuilder interface.
- Return type
- load_blob(blob_id, attachment, transaction, filename, is_text)¶
Load blob from file
- Return type
- set_offsets(metadata, callback)¶
Sets valid offsets in MessageMetadata. Performs calls to callback in OffsetsCallback for each field/parameter.
- Return type
- VERSION = 2¶
iUtil¶
- class firebird.driver.interfaces.iUtil(intf)¶
Bases:
firebird.driver.interfaces.iUtil_v2
Class that wraps IUtil v4 interface for use from Python
- decode_time_tz(timetz)¶
Decodes TIME WITH TIMEZONE from internal format to datetime.time with tzinfo.
- Return type
- decode_time_tz_ex(timetz, hours, minutes, seconds, fractions, zone_bufer)¶
TODO
- decode_timestamp_tz(timestamptz)¶
Decodes TIMESTAMP WITH TIMEZONE from internal format to datetime.datetime with tzinfo.
- Return type
- decode_timestamp_tz_ex(timestamptz, year, month, day, hours, minutes, seconds, fractions, zone_bufer)¶
TODO
- encode_time_tz(time)¶
Encodes datetime.time with tzinfo into internal format for TIME WITH TIMEZONE.
- Return type
- encode_timestamp_tz(timestamp)¶
Encodes datetime.datetime with tzinfo into internal format for TIMESTAMP WITH TIMEZONE.
- Return type
- get_decfloat16()¶
Returns iDecFloat16 interface.
- Return type
- get_decfloat34()¶
Returns iDecFloat34 interface.
- Return type
- STR_SIZE = 200¶
- VERSION = 4¶
iDecFloat16¶
- class firebird.driver.interfaces.iDecFloat16(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
Class that wraps IDecFloat16 interface for use from Python
- BCD_SIZE = 16¶
- STR_SIZE = 24¶
- VERSION = 2¶
iDecFloat34¶
- class firebird.driver.interfaces.iDecFloat34(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
Class that wraps IDecFloat34 interface for use from Python
- from_bcd(value, into=None)¶
Make decimal float value from BCD
- Return type
c_ulong_Array_2
- from_str(value, into=None)¶
Make decimal float value from string
- Return type
c_ulong_Array_2
- BCD_SIZE = 34¶
- STR_SIZE = 43¶
- VERSION = 2¶
iInt128¶
iMaster¶
- class firebird.driver.interfaces.iMaster(intf)¶
Bases:
firebird.driver.interfaces.iVersioned
Class that wraps IMaster interface for use from Python
- get_config_manager()¶
Get instance of
iConfigManager
interface.- Return type
- get_dispatcher()¶
Get instance of
iProvider
interface, implemented by yValve (main provider instance).- Return type
- get_metadata_builder(fieldCount)¶
Get instance of
iMetadataBuilder
interface.- Return type
- get_plugin_manager()¶
Get instance of
iPluginManager
interface.- Return type
- get_timer_control()¶
Get instance of
iTimerControl
interface.- Return type
- register_attachment(provider, attachment)¶
Information not available
- Return type
- register_transaction(attachment, transaction)¶
Information not available
- Return type
- VERSION = 2¶
Interface implementations¶
iVersionedImpl¶
iReferenceCountedImpl¶
iDisposableImpl¶
- class firebird.driver.interfaces.iDisposableImpl¶
Bases:
firebird.driver.interfaces.iVersionedImpl
IDisposable interface wrapper
- VERSION = 2¶
iVersionCallbackImpl¶
- class firebird.driver.interfaces.iVersionCallbackImpl¶
Bases:
firebird.driver.interfaces.iVersionedImpl
Class that wraps IVersionCallback interface for use from Python
- VERSION = 2¶
iCryptKeyCallbackImpl¶
- class firebird.driver.interfaces.iCryptKeyCallbackImpl¶
Bases:
firebird.driver.interfaces.iVersionedImpl
Class that wraps ICryptKeyCallback interface for use from Python
- VERSION = 2¶
iOffsetsCallbackImp¶
- class firebird.driver.interfaces.iOffsetsCallbackImp¶
Bases:
firebird.driver.interfaces.iVersionedImpl
Class that wraps IOffsetsCallback interface for use from Python
- VERSION = 2¶
iEventCallbackImpl¶
- class firebird.driver.interfaces.iEventCallbackImpl¶
Bases:
firebird.driver.interfaces.iReferenceCountedImpl
IEventCallback interface wrapper
- VERSION = 3¶
iTimerImpl¶
- class firebird.driver.interfaces.iTimerImpl¶
Bases:
firebird.driver.interfaces.iReferenceCountedImpl
Class that wraps ITimer interface for use from Python
- VERSION = 3¶