firebird.driver.config

This module contains firebird-driver configuration. Uses configuration classes from firebird-base package.

Classes

DriverConfig

class firebird.driver.config.DriverConfig(name)

Bases: firebird.base.config.Config

Driver configuration.

get_database(name)

Return database configuration.

Return type

DatabaseConfig

get_server(name)

Return server configuration.

Return type

ServerConfig

read(filenames, encoding=None)

Read configuration from a filename or an iterable of filenames.

Files that cannot be opened are silently ignored; this is designed so that you can specify an iterable of potential configuration file locations (e.g. current directory, user’s home directory, systemwide directory), and all existing configuration files in the iterable will be read. A single filename may also be given.

Return list of successfully read files.

read_dict(dictionary)

Read configuration from a dictionary.

Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in order.

All types held in the dictionary are converted to strings during reading, including section names, option names and keys.

Return type

None

read_file(f)

Read configuration from a file-like object.

The f argument must be iterable, returning one line at a time.

read_string(string)

Read configuration from a given string.

Return type

None

register_database(name, config=None)

Register database.

Parameters
  • name (str) – Database name.

  • config (Optional[str]) – Optional database configuration string in ConfigParser format in [name] section.

Returns

For newly registered database

Return type

DatabaseConfig

Raises

ValueError – If database is already registered.

register_server(name, config=None)

Register server.

Parameters
  • name (str) – Server name.

  • config (Optional[str]) – Optional server configuration string in ConfigParser format in [name] section.

Returns

For newly registered server

Return type

ServerConfig

Raises

ValueError – If server is already registered.

databases: ConfigListOption

Registered databases

db_defaults: DatabaseConfig

Default database configuration (‘firebird.db.defaults’)

fb_client_library: StrOption

Path to Firebird client library

server_defaults: ServerConfig

Default server configuration (‘firebird.server.defaults’)

servers: ConfigListOption

Registered servers

stream_blob_threshold: IntOption

BLOB size threshold. Bigger BLOB will be returned as stream BLOBs.

ServerConfig

class firebird.driver.config.ServerConfig(name)

Bases: firebird.base.config.Config

Server configuration.

auth_plugin_list: StrOption

List of authentication plugins override

config: StrOption

Configuration override

host: StrOption

Server host machine specification

password: StrOption

Default user password, default is envar ISC_PASSWORD or None if not specified

port: StrOption

Port used by Firebird server

trusted_auth: BoolOption

False

Type

Use trusted authentication, default

user: StrOption

Defaul user name, default is envar ISC_USER or None if not specified

DatabaseConfig

class firebird.driver.config.DatabaseConfig(name)

Bases: firebird.base.config.Config

Database configuration.

auth_plugin_list: StrOption

List of authentication plugins override

cache_size: IntOption

Page cache size override for database connection

charset: StrOption

Character set for database connection

config: StrOption

Configuration override

database: StrOption

Database file specification or alias

db_cache_size: IntOption

Database create option. Page cache size override for database.

db_charset: StrOption

Database create option. Character set for the database.

db_sql_dialect: IntOption

Database create option. SQL dialect for the database.

dsn: StrOption

Database connection string

dummy_packet_interval: IntOption

Dummy packet interval for this database connection

forced_writes: BoolOption

Database create option. Write mode (True = sync/False = async).

no_linger: BoolOption

Do not use linger for database connection

page_size: IntOption

Database create option. Page size to be used.

password: StrOption

Default user password, default is envar ISC_PASSWORD or None if not specified

protocol: EnumOption

Protocol to be used for database

reserve_space: BoolOption

Database create option. Data page space usage (True = reserve space, False = Use all space).

role: StrOption

User role

server: StrOption

Name of server where database is located

sql_dialect: IntOption

3

Type

SQL Dialect for database connection, default

sweep_interval: IntOption

Database create option. Sweep interval for the database.

timeout: IntOption

Connection timeout

trusted_auth: BoolOption

False

Type

Use trusted authentication, default

user: StrOption

Defaul user name, default is envar ISC_USER or None if not specified

utf8filename: BoolOption

Database filename should be passed in UTF8

Globals

driver_config

firebird.driver.config.driver_config: firebird.driver.config.DriverConfig = <firebird.driver.config.DriverConfig object>

Driver configuration.