#########
Changelog
#########


Version 2.0
===========

.. important::

   This is initial release of new *"SweetBitter"* driver generation. 
   
   During this (v2) generation FDB driver will undergo a transition from development centered around Python 2.7 / Firebird 2.x to development centered around Python 3 / Firebird 3. There are some backward incompatible changes between v2 and v1 generation, and you may expect some also between individual releases of second generation. To *soften* this *bitter* pill, the second generation will have new functionality, enhancements and optimalizations gradually added into each public release. 
   
   **The second generation is also the last one that will directly support Python 2.7 and will be tested with Firebird 2.**
   
   The plan is to move forward with v3 generation (Python 3/Firebird 3+) as soon as v2 code base will become mature.

Improvements
------------

- Hooks.
- New modules for parsing Firebird trace & audit logs (:mod:`fdb.trace`), gstat output (:mod:`fdb.gstat`) and server log (:mod:`fdb.log`)
- Added :class:`fdb.utils.ObjectList` class for improved object collection manipulation.
- Modules :mod:`~fdb.monitor` and :mod:`~fdb.schema` now use new :class:`fdb.utils.ObjectList` for collections of information objects.
- Methods :meth:`fdb.Connection.database_info()` and :meth:`fdb.Transaction.transaction_info()` now distinguish between 
  text and binary strings with `result_type` code.
- Significant changes to documentation.

Other changes
-------------

- Exception fdb.Warning removed as duplicate to standard Warning exception.
- Changes to make pylint more happy about fdb code.
- Parameter `result_type` in methods :meth:`fdb.Transaction.transaction_info()` and :meth:`fdb.Connection.database_info()` now does not support value 's' for string results as these converted strings to unicode in Python 3 which does not makes sense (it's always binary data, at least partially). Instead new value 'b' is introduced for binary string results.
- Reworked Visitor Pattern support in :mod:`~fdb.schema` module, added classes :class:`fdb.utils.Visitable` and :class:`fdb.utils.Visitor`.
- Method :meth:`fdb.schema.Schema.reload` now takes as parameter numeric metadata category code(s) instead string name.
- Cleanup of unused constants

Bugs Fixed
----------

- (PYFB-72) - exception_from_status function gives an UnicodeDecodeError
- (PYFB-73) - Buffer filled with zero-characters is returned instead of actual content of page when page number more than 64 K
- (Unregistered) - BOOLEAN arrays were not supported
- (Unregistered) - Issues with Python 3 and Windows compatibility from latest 1.x versions.

Version 1.8
===========

- In relation to (PYFB-71_) a better memory exhaustion safeguard was implemented for materialized blobs. See :ref:`Working with BLOBs <working_with_blobs>` for details.
- Added service support for backup and restore from/to local byte stream. See :meth:`~fdb.services.Connection.local_backup()` and :meth:`~fdb.services.Connection.local_restore()` for details.
- Added attribute :attr:`fdb.schema.TableColumn.id` (RDB$FIELD_ID)
- Added method :meth:`fdb.BlobReader.get_info()`.

Version 1.7
===========

- (PYFB-66_) - Port parameter for connect and create_database is not used
- (PYFB-69_) - Can not connect to FB services if set ISC_USER & ISC_PASSWORD by os.environ[...]
- (PYFB-70_) - executemany(operation, seq_of_parameters) appears to run slower than it should
- Number of fixes to DDL generators in schema module
- Added support for :class:`~fdb.schema.Filter` and :class:`~fdb.schema.BackupHistory` in schema module.
- Added DDL scripts generator :meth:`~fdb.schema.Schema.get_metadata_ddl`.

Version 1.6.1
=============

- (PYFB-68_) - Add support for isc_spb_sts_table option
- (PYFB-67_) - Cursor fails after use with executemany(). ReferenceError: weakly-referenced object no longer exists

Version 1.6
===========

- New: Extended support for database and transaction info (new attributes and functions on :class:`~fdb.Connection` and
  :class:`~fdb.Transaction`, fixes and improvements to :meth:`~fdb.Connection.db_info` and :meth:`~fdb.Connection.database_info`).
- Fix: Missing character sets for automatic translations.
- (PYFB-64_) - cursor.description throws ReferenceError after executemany INSERT 

Version 1.5.1
=============

- New :func:`~fdb.connect()` parameters: no_gc, no_db_triggers and no_linger.
- Direct support for *with* statement (PEP8) in :class:`~fdb.Connection` class.

Version 1.5
===========

- Initial support for Firebird 3.0

  - BOOLEAN datatype
  - IDENTITY datatype (in schema)
  - Database linger
  - Preserve SHADOW on DROP
  - DDL triggers
  - New and extended system tables
  - New and extended monitoring tables
  - GBAK statistics (service)
  - On-line validation (service)

- (PYFB-60_) Cursor: executemany(operation, seq_of_parameters) does PREPARE of <operation> for each parameter from <seq_of_parameters>

Version 1.4.11
==============

- (PYFB-58_) Severe performance loss and minor memory leak

Version 1.4.10
==============

- (PYFB-54_) Windows 7x64 and FB2.5.2x32 Python2.7: Error in Registry Path. FDB driver does not find the library fbclient.dll
- (PYFB-55_) get_sql_for incorrect generate sql query for Views
- (PYFB-56_) schema.reload typing mistake for views
- (PYFB-57_) role.privileges does not return correct privilege list


Version 1.4.9
=============

- (PYFB-51_) <procedure>.get_sql_for('<re>create') returns invalid output parameters
- (PYFB-52_) isc_info* types which are _DATABASE_INFO_CODES_WITH_COUNT_RESULTS raises TypeError: 'float' object cannot be interpreted as an integer 

Version 1.4.8
=============

- Enhancement to automatic client library location detection on POSIX. Now it also looks at LD_LIBRARY_PATH dir if specified.

Version 1.4.7
=============

- Forgoten debug printout removed. Annoying for Python 2.x users, fatal for 3.x users.

Version 1.4.6
=============

Bugs Fixed
----------

- (PYFB-50_) Exception ReferenceError: 'weakly-referenced object no longer exists' in PreparedStatement and Cursor

Version 1.4.5
=============

Bugs Fixed
----------

- (PYFB-49_) Memory and DB resource leak due to circular references.

Version 1.4.4
=============

Improvements
------------

- (PYFB-47_) Firebird client library path added as optinal parameter to :func:`fdb.connect` and :func:`fdb.create_database`.

Bugs Fixed
----------

- Additional fix related to PYFB-43_
- Additional correction for unregistered problem with circular ref. between PS and Cursor when explicit PS is executed.


Version 1.4.3
=============

Bugs Fixed
----------

- Previous fix for PYFB-43_ was incomplete, corrected.


Version 1.4.2
=============

Improvements
------------

- In relation to PYFB-43_ I had to make a **backward incompatible change** to event processing API. Starting from this version
  `EventConduit` does not automatically starts collection of events upon creation, but it's now necessary to call 
  :meth:`~fdb.EventConduit.begin` method. To mitigate the inconvenience, EventConduit now supports context manager
  protocol that ensures calls to begin() and close() via `with` statement.
- In relation to PYFB-39_ I have decided to drop support for implicitly cached and reused prepared statements. I never
  liked this feature as I think it's a sneaky method how to put some performance to badly written applications that 
  in worst case may lead to significant resource consumption on server side when developers are not only lazy but also stupid.
  It was implemented for the sake of compatibility with KInterbasDB. 

  **This change has no impact on API, but may affect performance of your applications.**

Bugs Fixed
----------

- PYFB-44_ - Inserting a datetime.date into a TIMESTAMP column does not work
- PYFB-42_ - Python 3.4 and FDB - backup throws an exception
- Unregistered - Fixes in monitor.TransactionInfo


Version 1.4.1
=============

Improvements
------------

- PYFB-40_ - fbclient.dll is not found if not in path.
  Aside from registry lookup, client library isn't loaded until first call to :func:`fdb.connect`, :func:`fdb.create_database`
  or :func:`fdb.load_api` (which now supports optional specification of Firebird Client Library to load). 
- Adjustments for Firebird 3.0 (Alpha1)
- Properties :attr:`~fdb.services.Connection.version` and :attr:`~fdb.services.Connection.engine_version` added to :class:`fdb.services.Connection`

Bugs Fixed
----------

- Unregistered - isolation_level parameter for fdb.connection has no effect.
- Unregistered - Information gathered from monitoring tables is not properly dropped upon refresh request.

Version 1.4
===========

New Features
------------

- :mod:`fdb.schema` submodule extended with support for user privileges.

Improvements
------------

- :meth:`fdb.services.User.load_information` method to load information about user from server.
- :mod:`fdb.ibase` content cleanup and additions.
- :mod:`fdb.blr` submodule with BLR definitions.

Bugs Fixed
----------

- PYFB-37_ - Unicode Strings incorrect not allowed for insertion into BLOB SubType 1.


Version 1.3
===========

New Features
------------

- :mod:`fdb.monitor` submodule for access to / work with monitoring tables.
- New :attr:`fdb.Connection.monitor` property for access to monitoring tables.

Improvements
------------

- :attr:`~fdb.schema.Schema.closed` property and :meth:`~fdb.schema.Schema.clear` method for Schema.
- Unit tests reworked.

Bugs Fixed
----------

- Unregistered: Bug in :meth:`fdb.schema.Schema.close` and :meth:`fdb.schema.Schema.bind`.

Version 1.2
===========

New Features
------------

- :mod:`fdb.schema` submodule for access to / work with database metadata.
- :mod:`fdb.utils` submodule with various helper classes and functions.
- New :attr:`fdb.Connection.schema` property for access to database schema.
- New :class:`~fdb.ConnectionWithSchema` connection class that provides more direct access 
  to database schema than `Connection`.
- New :attr:`fdb.Connection.firebird_version`, :attr:`fdb.Connection.version` and 
  :attr:`fdb.Connection.engine_version` properties.
- New `Connection.ods` read only property that returns ODS version number of connected database.
  There are also new module-level constants `ODS_FB_20`, `ODS_FB_21` and `ODS_FB_25`.
- New :attr:`fdb.Connection.query_transaction` property. This is ReadOnly ReadCommitted transaction 
  that could be active indefinitely without blocking garbage collection. It’s used internally to query 
  metadata, but it’s generally useful.

Improvements
------------

- Optional PEP 249 (Python DB API 2.0) Extensions

  - `Connection.Error`, `Connection.ProgrammingError`, etc.

    All exception classes defined by the DB API standard are exposed on the Connection objects 
    as attributes (in addition to being available at module scope).
  - `Cursor.connection`

    This read-only attribute return a reference to the Connection object on which the cursor was created.

- `Cursor.transaction` read-only attribute returns a reference to the Transaction object on which the cursor 
  was created.
- Optimized wekref management, especially for `PreparedStatement`.
- `create_database` now supports two methods for database screation. You can specify CREATE DATABASE statement
  (as before) or provide set of named database parameters (SQL statement is created automatically from them).
- Functions `connection` and `create_database` now take optional keyword parameter `connection_class` to
  obtain instances of different class instead `Connection`.
- Support for legacy (pre-2.5) shutdown mode with mode `fdb.services.SHUT_LEGACY`.
- :meth:`fdb.Cursor.executemany` returns `self`, so it could be used directly as iterator.
- Documentation inprovements.

Bugs Fixed
----------

- Unregistered: `buffers` parameter of `fdb.connection` doesn't support values greater than 255.
- Unregistered: Lowercase character set name passed to `fdb.connect` may result in wrong funcion of automatic
  data conversions and other failures (exceptions raised).

Version 1.1.1
=============

Bugs Fixed
----------

- PYFB-35_ - Call to fetch after a sql statement without a result should raise exception
- PYFB-34_ - Server resources not released on PreparedStatement destruction

Version 1.1
===========

New Features
------------

- :ref:`Context Manager <transaction-context-manager>` for transactions.

Bugs Fixed
----------

- PYFB-30_ - BLOBs are truncated at first zero byte

Version 1.0
===========

Improvements
------------

- Removed dependency on fbclient library to be present at import time (PYFB-24)

Bugs Fixed
----------

- PYFB-25_ - Truncate long text from VARCHAR(5000)

Version 0.9.9
=============

New Features
------------

- Firebird ARRAY support.

Other changes
-------------

- Cursor.execute() returns Self, so it could be used as iterator.
- Reading output from Services now uses more efficient method to get data
  from server.

Bugs Fixed
----------

- Fix: precision_cache in Connection works as intended.

Version 0.9.1
=============

Just bugfixes to make FDB work on P3K again.

Version 0.9
===========

New Features
------------

- Documentation; both in-source (in Sphinx autodoc format) and Sphinx (html)
- Services API completely reworked

Other changes
-------------

- Unregistered bugs fixed.
- Various optimizations and cleanup
- Object reference graph optimalizations
- Many new tests in test suite

Version 0.8.5
=============

New Features
------------

- Support for Firebird stream BLOBs (see ReleaseNotes for details)
- Documentation (stub, from KInterbasDB 3.3.0)

Bugs Fixed
----------

- Fix for PYFB-17_ and PYFB-18_ (see our JIRA tracker for details)
- Fixes for automatic unicode conversions + refactoring
- Some optimizations


Version 0.8
===========

New Features
------------

- (PYFB-8_) - Support for Firebird Event Notifications

Bugs Fixes
----------

- (PYFB-16_) - database_info (isc_info_firebird_version) fails opn amd64 linux
- (PYFB-15_) - more than 2 consecutive cursor open execute and iter fail


Version 0.7.2
=============

New Features
------------

- Python 3 Support (thanks to Philippe Makowski)
- Support for Distributed Transactions

And as always, some (unregistered) bugs fixed.

Version 0.7.1
=============

Bug fixes.

Version 0.7
===========

Initial release.

Almost feature-complete (ready for 95% of users), but it could be still buggy (it’s beta!), and the 
code wasn’t optimized for size and speed. In all other ways it’s ready for wide testing.

What’s missing
--------------

- Distributed transactions
- ARRAY support
- EVENTs support
- Stream BLOBs
- TRACE service
- Documentation (but you can use KInterbasDB one as FDB is as close to it as possible).
- Python 3.x support (haven’t had time to test it, but it shouldn’t be hard to make it work there)

.. _PYFB-8: http://tracker.firebirdsql.org/browse/PYFB-8
.. _PYFB-15: http://tracker.firebirdsql.org/browse/PYFB-15
.. _PYFB-16: http://tracker.firebirdsql.org/browse/PYFB-16
.. _PYFB-17: http://tracker.firebirdsql.org/browse/PYFB-17
.. _PYFB-18: http://tracker.firebirdsql.org/browse/PYFB-18
.. _PYFB-24: http://tracker.firebirdsql.org/browse/PYFB-24
.. _PYFB-25: http://tracker.firebirdsql.org/browse/PYFB-25
.. _PYFB-30: http://tracker.firebirdsql.org/browse/PYFB-30
.. _PYFB-34: http://tracker.firebirdsql.org/browse/PYFB-34
.. _PYFB-35: http://tracker.firebirdsql.org/browse/PYFB-35
.. _PYFB-37: http://tracker.firebirdsql.org/browse/PYFB-37
.. _PYFB-39: http://tracker.firebirdsql.org/browse/PYFB-39
.. _PYFB-40: http://tracker.firebirdsql.org/browse/PYFB-40
.. _PYFB-42: http://tracker.firebirdsql.org/browse/PYFB-42
.. _PYFB-43: http://tracker.firebirdsql.org/browse/PYFB-43
.. _PYFB-44: http://tracker.firebirdsql.org/browse/PYFB-44
.. _PYFB-47: http://tracker.firebirdsql.org/browse/PYFB-47
.. _PYFB-49: http://tracker.firebirdsql.org/browse/PYFB-49
.. _PYFB-50: http://tracker.firebirdsql.org/browse/PYFB-50
.. _PYFB-51: http://tracker.firebirdsql.org/browse/PYFB-51
.. _PYFB-52: http://tracker.firebirdsql.org/browse/PYFB-52
.. _PYFB-54: http://tracker.firebirdsql.org/browse/PYFB-54
.. _PYFB-55: http://tracker.firebirdsql.org/browse/PYFB-55
.. _PYFB-56: http://tracker.firebirdsql.org/browse/PYFB-56
.. _PYFB-57: http://tracker.firebirdsql.org/browse/PYFB-57
.. _PYFB-58: http://tracker.firebirdsql.org/browse/PYFB-58
.. _PYFB-60: http://tracker.firebirdsql.org/browse/PYFB-60
.. _PYFB-64: http://tracker.firebirdsql.org/browse/PYFB-64
.. _PYFB-66: http://tracker.firebirdsql.org/browse/PYFB-66
.. _PYFB-67: http://tracker.firebirdsql.org/browse/PYFB-67
.. _PYFB-68: http://tracker.firebirdsql.org/browse/PYFB-68
.. _PYFB-69: http://tracker.firebirdsql.org/browse/PYFB-69
.. _PYFB-70: http://tracker.firebirdsql.org/browse/PYFB-70
.. _PYFB-71: http://tracker.firebirdsql.org/browse/PYFB-71
