firebird.driver.fbapi¶
This module contains low-level ctypes interface to
Firebird client library (fbclient.so/dll).
Constants¶
Type codes¶
- SQL_TEXT
- SQL_VARYING
- SQL_SHORT
- SQL_LONG
- SQL_FLOAT
- SQL_DOUBLE
- SQL_D_FLOAT
- SQL_TIMESTAMP
- SQL_BLOB
- SQL_ARRAY
- SQL_QUAD
- SQL_TYPE_TIME
- SQL_TYPE_DATE
- SQL_INT64
- SQL_BOOLEAN
- SQL_NULL
- SUBTYPE_NUMERIC
- SUBTYPE_DECIMAL
Internal type codes (for example used by ARRAY descriptor)¶
- blr_text
- blr_text2
- blr_short
- blr_long
- blr_quad
- blr_float
- blr_double
- blr_d_float
- blr_timestamp
- blr_varying
- blr_varying2
- blr_blob
- blr_cstring
- blr_cstring2
- blr_blob_id
- blr_sql_date
- blr_sql_time
- blr_int64
- blr_blob2
- blr_domain_name
- blr_domain_name2
- blr_not_nullable
- blr_column_name
- blr_column_name2
- blr_bool
- blr_dec64
- blr_dec128
- blr_dec_fixed
- blr_sql_time_tz
- blr_timestamp_tz
- blr_ex_time_tz
- blr_ex_timestamp_tz
Types¶
firebird.driver.fbapi.Int
module-attribute
¶
firebird.driver.fbapi.IntPtr
module-attribute
¶
firebird.driver.fbapi.Int64
module-attribute
¶
firebird.driver.fbapi.Int64Ptr
module-attribute
¶
firebird.driver.fbapi.QWord
module-attribute
¶
firebird.driver.fbapi.STRING
module-attribute
¶
firebird.driver.fbapi.ISC_LONG
module-attribute
¶
firebird.driver.fbapi.ISC_LONG_PTR
module-attribute
¶
firebird.driver.fbapi.ISC_ULONG
module-attribute
¶
firebird.driver.fbapi.ISC_SHORT
module-attribute
¶
firebird.driver.fbapi.ISC_USHORT
module-attribute
¶
firebird.driver.fbapi.ISC_UCHAR
module-attribute
¶
firebird.driver.fbapi.ISC_INT64
module-attribute
¶
firebird.driver.fbapi.ISC_UINT64
module-attribute
¶
firebird.driver.fbapi.ISC_DATE
module-attribute
¶
firebird.driver.fbapi.ISC_TIME
module-attribute
¶
firebird.driver.fbapi.FB_DEC16
module-attribute
¶
firebird.driver.fbapi.FB_DEC16Ptr
module-attribute
¶
firebird.driver.fbapi.FB_DEC34
module-attribute
¶
firebird.driver.fbapi.FB_DEC34Ptr
module-attribute
¶
firebird.driver.fbapi.FB_I128
module-attribute
¶
firebird.driver.fbapi.FB_I128Ptr
module-attribute
¶
firebird.driver.fbapi.ISC_QUAD
¶
firebird.driver.fbapi.ISC_QUAD_PTR
module-attribute
¶
firebird.driver.fbapi.FB_API_HANDLE
module-attribute
¶
firebird.driver.fbapi.FB_API_HANDLE_PTR
module-attribute
¶
firebird.driver.fbapi.ISC_STATUS
module-attribute
¶
firebird.driver.fbapi.ISC_STATUS_PTR
module-attribute
¶
firebird.driver.fbapi.ISC_STATUS_ARRAY
module-attribute
¶
firebird.driver.fbapi.ISC_STATUS_ARRAY_PTR
module-attribute
¶
firebird.driver.fbapi.ISC_ARRAY_BOUND
¶
firebird.driver.fbapi.ISC_ARRAY_DESC
¶
ISC_ARRAY_DESC
Source code in firebird/driver/fbapi.py
firebird.driver.fbapi.ISC_ARRAY_DESC_PTR
module-attribute
¶
firebird.driver.fbapi.RESULT_VECTOR
module-attribute
¶
firebird.driver.fbapi.ISC_TIME_TZ
¶
firebird.driver.fbapi.ISC_TIME_TZ_EX
¶
firebird.driver.fbapi.ISC_TIMESTAMP
¶
firebird.driver.fbapi.ISC_TIMESTAMP_TZ
¶
firebird.driver.fbapi.ISC_TIMESTAMP_TZ_EX
¶
firebird.driver.fbapi.TraceCounts
¶
firebird.driver.fbapi.PerformanceInfo
¶
Variables¶
firebird.driver.fbapi.err_encoding
module-attribute
¶
Encoding used to decode error messages from Firebird.
Functions¶
firebird.driver.fbapi.has_api() -> bool
¶
firebird.driver.fbapi.load_api(filename: str | Path | FirebirdProvider | None = None) -> None
¶
Initializes bindings to Firebird Client Library unless they are already initialized.
Called automatically by get_api().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str | Path | FirebirdProvider | None
|
Client library filename or runtime provider. When omitted, the configured filename is used, or the driver locates a system client library. |
None
|
A supplied provider sets FIREBIRD to its root before loading the client library if
the variable is unset or resolves to a different directory.
Hooks
Event HookType.HOOK_API_LOADED: Executed after api is initialized.
Hook routine must have signature: hook_func(api). Any value returned by
hook is ignored.
Source code in firebird/driver/fbapi.py
firebird.driver.fbapi.get_api() -> FirebirdAPI
¶
Classes¶
firebird.driver.fbapi.FirebirdAPI
¶
Firebird Client API interface object. Loads Firebird Client Library and
exposes fb_get_master_interface(). Uses ctypes
for bindings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
FirebirdProvider | str | Path | None
|
Client library filename or runtime provider. When omitted, the driver locates a system client library. |
None
|
provider
|
FirebirdProvider | None
|
Runtime provider supplied by keyword, as an alternative to |
None
|
When a runtime provider is supplied, FIREBIRD is set to its root before loading the
client library if the variable is unset or resolves to a different directory.
Attributes:
| Name | Type | Description |
|---|---|---|
provider |
`.FirebirdProvider`
|
Runtime provider used to load this API |
client_library |
`ctypes.CDLL`
|
Loaded Firebird client library |
client_library_name |
`~pathlib.Path`
|
Path to loaded Firebird client library |
master |
iMaster
|
Firebird API IMaster interface |
util |
iUtil
|
Firebird API IUtil interface |
Methods:
| Name | Description |
|---|---|
fb_get_master_interface |
This function is used to obtain primary Firebird interface, required to access all the rest of interfaces. Has no parameters and always succeeds. Returns:
|
fb_get_database_handle |
Helper function that returns database handle for specified IAttachment interface. Arguments:
status ( Returns:
|
fb_get_transaction_handle |
Helper function that returns database handle for specified ITransaction interface. Arguments:
status ( Returns:
|
fb_interpret |
Helper function that fills buffer with text for errors noted in ISC status. Arguments:
buffer ( Returns:
|
fb_sqlstate |
Helper function that returns SQLSTATE for ISC_STATUS. Arguments:
status ( Returns:
|
isc_sqlcode |
Helper function that returns SQLCODE for ISC_STATUS. Arguments:
status ( Returns:
|
isc_array_lookup_bounds |
Old API function. |
isc_array_put_slice |
Old API function. |
isc_array_get_slice |
Old API function. |
isc_que_events |
Old API function. |
isc_event_counts |
Old API function. |
isc_cancel_events |
Old API function. |
isc_compile_request |
Old API function. |
isc_start_request |
Old API function. |
isc_release_request |
Old API function. |
isc_receive |
Old API function. |
isc_start_and_send |
Old API function. |
isc_send |
Old API function. |
isc_open_blob2 |
Old API function. |
isc_blob_info |
Old API function. |
isc_create_blob2 |
Old API function. |
isc_get_segment |
Old API function. |
isc_put_segment |
Old API function. |
isc_close_blob |
Old API function. |
Source code in firebird/driver/fbapi.py
1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 | |
client_library: ctypes.CDLL
instance-attribute
¶
Firebird client library
client_library_name: Path
instance-attribute
¶
Firebird client library name
fb_get_database_handle
instance-attribute
¶
Firebird API
fb_get_master_interface
instance-attribute
¶
Firebird API
fb_get_transaction_handle
instance-attribute
¶
Firebird API
fb_interpret
instance-attribute
¶
Firebird API
fb_shutdown_callback
instance-attribute
¶
Firebird API
fb_sqlstate
instance-attribute
¶
Firebird API
isc_array_get_slice
instance-attribute
¶
Firebird API
isc_array_lookup_bounds
instance-attribute
¶
Firebird API
isc_array_put_slice
instance-attribute
¶
Firebird API
isc_blob_info
instance-attribute
¶
Firebird API
isc_cancel_events
instance-attribute
¶
Firebird API
isc_close_blob
instance-attribute
¶
Firebird API
isc_compile_request
instance-attribute
¶
Firebird API
isc_create_blob2
instance-attribute
¶
Firebird API
isc_event_counts
instance-attribute
¶
Firebird API
isc_get_segment
instance-attribute
¶
Firebird API
isc_open_blob2
instance-attribute
¶
Firebird API
isc_put_segment
instance-attribute
¶
Firebird API
isc_que_events
instance-attribute
¶
Firebird API
isc_receive
instance-attribute
¶
Firebird API
isc_release_request
instance-attribute
¶
Firebird API
isc_send
instance-attribute
¶
Firebird API
isc_sqlcode
instance-attribute
¶
Firebird API
isc_start_and_send
instance-attribute
¶
Firebird API
isc_start_request
instance-attribute
¶
Firebird API
provider: FirebirdProvider
property
¶
Runtime provider used by this API, available after initialization.
isc_event_block(event_buffer: bytes, result_buffer: bytes, *args) -> int
¶
Convenience wrapper for isc_event_block() API function. Injects variable
number of parameters into C_isc_event_block call.