.. module:: firebird.driver.types
    :synopsis: Firebird driver types

=====================
firebird.driver.types
=====================

Exceptions
==========

Next exceptions are required by Python DB API 2.0

`Error` is imported from `firebird.base.types`.

.. autoexception:: Error
.. autoexception:: InterfaceError
.. autoexception:: DatabaseError
.. autoexception:: DataError
.. autoexception:: OperationalError
.. autoexception:: IntegrityError
.. autoexception:: InternalError
.. autoexception:: ProgrammingError
.. autoexception:: NotSupportedError
.. autoexception:: FirebirdWarning

This is the exception inheritance layout::

    StandardError
    |__UserWarning
        |__FirebirdWarning
    |__Error
        |__InterfaceError
        |__DatabaseError
            |__DataError
            |__OperationalError
            |__IntegrityError
            |__InternalError
            |__ProgrammingError
            |__NotSupportedError

Other constants and types required by Python DB API 2.0 specification
=====================================================================

Globals
-------

.. autodata:: apilevel
   :no-value:

.. autodata:: threadsafety
   :no-value:

.. autodata:: paramstyle
   :no-value:

Helper constants for work with :attr:`.Cursor.description` content
------------------------------------------------------------------

- DESCRIPTION_NAME
- DESCRIPTION_TYPE_CODE
- DESCRIPTION_DISPLAY_SIZE
- DESCRIPTION_INTERNAL_SIZE
- DESCRIPTION_PRECISION
- DESCRIPTION_SCALE
- DESCRIPTION_NULL_OK

Types
-----

.. autodata:: STRING
   :no-value:

.. autodata:: BINARY
   :no-value:

.. autodata:: NUMBER
   :no-value:

.. autodata:: DATETIME
   :no-value:

.. autodata:: ROWID
   :no-value:

Constructors for data types
---------------------------

.. autodata:: Date
.. autodata:: Time
.. autodata:: Timestamp
.. autofunction:: DateFromTicks
.. autofunction:: TimeFromTicks
.. autofunction:: TimestampFromTicks
.. autodata:: Binary

Types for type hints
====================

.. autodata:: DESCRIPTION
.. autodata:: CB_OUTPUT_LINE
.. autoclass:: Transactional

Enums
=====

.. autoclass:: NetProtocol
.. autoclass:: DirectoryCode
.. autoclass:: XpbKind
.. autoclass:: StateResult
.. autoclass:: PageSize
.. autoclass:: DBKeyScope
.. autoclass:: InfoItemType
.. autoclass:: SrvInfoCode
.. autoclass:: BlobInfoCode
.. autoclass:: DbInfoCode
.. autoclass:: Features
.. autoclass:: ReplicaMode
.. autoclass:: StmtInfoCode
.. autoclass:: TraInfoCode
.. autoclass:: TraInfoIsolation
.. autoclass:: TraInfoReadCommitted
.. autoclass:: TraInfoAccess
.. autoclass:: TraAccessMode
.. autoclass:: TraIsolation
.. autoclass:: TraReadCommitted
.. autoclass:: Isolation
.. autoclass:: TraLockResolution
.. autoclass:: TableShareMode
.. autoclass:: TableAccessMode
.. autoclass:: DefaultAction
.. autoclass:: StatementType
.. autoclass:: SQLDataType
.. autoclass:: DPBItem
.. autoclass:: TPBItem
.. autoclass:: SPBItem
.. autoclass:: BPBItem
.. autoclass:: BlobType
.. autoclass:: BlobStorage
.. autoclass:: ServerAction
.. autoclass:: SrvDbInfoOption
.. autoclass:: SrvRepairOption
.. autoclass:: SrvBackupOption
.. autoclass:: SrvRestoreOption
.. autoclass:: SrvNBackupOption
.. autoclass:: SrvTraceOption
.. autoclass:: SrvPropertiesOption
.. autoclass:: SrvValidateOption
.. autoclass:: SrvUserOption
.. autoclass:: DbAccessMode
.. autoclass:: DbSpaceReservation
.. autoclass:: DbWriteMode
.. autoclass:: ShutdownMode
.. autoclass:: OnlineMode
.. autoclass:: ShutdownMethod
.. autoclass:: TransactionState
.. autoclass:: DbProvider
.. autoclass:: DbClass
.. autoclass:: Implementation
.. autoclass:: ImpCPU
.. autoclass:: ImpOS
.. autoclass:: ImpCompiler
.. autoclass:: CancelType
.. autoclass:: DecfloatRound
.. autoclass:: DecfloatTraps

Flags
=====

.. autoclass:: StateFlag
.. autoclass:: PreparePrefetchFlag
.. autoclass:: StatementFlag
.. autoclass:: CursorFlag
.. autoclass:: ConnectionFlag
.. autoclass:: EncryptionFlag
.. autoclass:: ServerCapability
.. autoclass:: SrvRepairFlag
.. autoclass:: SrvStatFlag
.. autoclass:: SrvBackupFlag
.. autoclass:: SrvRestoreFlag
.. autoclass:: SrvNBackupFlag
.. autoclass:: SrvPropertiesFlag
.. autoclass:: ImpFlags

Dataclasses
===========

.. autoclass:: ItemMetadata
   :no-members:

.. autoclass:: TableAccessStats
   :no-members:

.. autoclass:: UserInfo
   :no-members:

.. autoclass:: BCD
   :no-members:

.. autoclass:: TraceSession
   :no-members:

Helper functions
================

.. autofunction:: get_timezone
