Skip to content

Releases: MonetDB/pymonetdb

1.9.0 - 2025-11-13

13 Nov 09:34

Choose a tag to compare

New features since 1.8.5

  • Added support for the inet4 and inet6 types added in the upcoming MonetDB Dec2025 release.

  • Added support for Python 3.14.

  • All INFO level log messages have been downgraded to DEBUG except for info messages sent by the server.

  • Include py.typed to silence mypy warnings in Python code that depend on pymonetdb.

Version number policy

  • From now on pymonetdb version numbers will follow Semantic Versioning. This means the third part of the version number is reserved for bug fixes, the middle part for backward compatible changes and the first for backward incompatible changes.

1.8.5 - 2025-08-14

14 Aug 15:27

Choose a tag to compare

New features since 1.8.4

  • The 'connect_timeout' parameter now applies to the whole process of finding a server and logging in, instead of just setting the socket timeout during socket.connect().

    This is useful because sometimes socket.connect() may succeed even though the server is in fact hanging.

  • All logging messages are now at DEBUG level. There used to be one INFO message "Established connection to..." but it was emitted too early, before login. Logging everything as DEBUG seems more consistent.

Bug fixes

  • The decision whether a result set needs to be closed or not was accidentally based on the size of the previous result set, not the current. This could cause unclosed result sets to pile up until the connection was closed.

  • When scanning Unix Domain sockets, errors are to be expected. Until now, all exceptions were intercepted and if no connection could be made, the last one was rethrown. This caused important errors such as 'invalid credentials' to be masked by later less interesting errors. This has been fixed by only postponing OSErrors and 'no such database'.

1.8.4 - 2025-02-04

04 Feb 15:42

Choose a tag to compare

Bug fixes

  • Fix MAPI protocol corruption bug caused by socket.send() being used in some places rather than socket.sendall().

  • When disconnecting, check that the socket hasn't already been closed and dropped, for example by _sabotage().

1.8.3 - 2024-10-30

30 Oct 13:13

Choose a tag to compare

Bug fixes only.

  • Avoid double close of filetransfer Upload object. This was always an error but with Python 3.13 it started to cause warnings.

  • Fix error message when 'core' attributes like 'host' and 'port' are used as URL query parameters

1.8.2

29 Aug 07:52

Choose a tag to compare

New features since 1.8.1

  • CLIENTINFO: At connect time, tell the server more about the connecting client: hostname, application name, pymonetdb version, process id and an optional remark. This information will show up in the sys.sessions table. Configurable with the new settings client_info, client_application and client_remark.

Bug fixes

  • Use the right directory when scanning for Unix Domain sockets.

  • Minor fixes to make the test suite pass with MonetDB Jun2020:

    • Always announce FILETRANS capability, allowing it to work with older MonetDB versions.

    • Support result set format of PREPARE statements on older MonetDB versions.

  • Restore connect_timeout=-1 to how it was before 1.8.0. However, avoid setting the socket to non-blocking mode. See Issue #127.

1.8.1

22 Apr 14:22

Choose a tag to compare

changes since 1.8.0

  • Restore behavior where sockdir can be changed by setting host to something that starts with a slash. Mtest.py relies on this.

1.8.0

15 Apr 11:29

Choose a tag to compare

changes since 1.7.2

  • Incompatible change: If multiple queries are executed at once, the first result set is returned rather than the last. For example, Cursor.execute("SELECT 1; SELECT 2") used to return 2 but now returns 1.

  • Add support for Cursor.nextset to allow retrieving result sets other than the first.

  • Add support for encrypted connections using TLS. This can be enabled using the tls parameter of pymonetdb.connect() or by using a monetdbs:// URL.

  • Add support for monetdb:// and monetdbs:// URLs. See MonetDB URLs for details. The mapi:monetdb:// URLs are now deprecated.

  • Support for Python 3.6 has been dropped

1.7.1

22 Sep 09:01

Choose a tag to compare

changes since 1.7.0

  • Bug fix: let TimeTzFromTicks and TimestampTzFromTicks use the correct time zone

  • Feature: add support for the named parameter syntax that will be introduced in
    the next major version of MonetDB AFTER Jun2023. (Not Jun2023 itself.)

Example of the named parameters:

import pymonetdb

# classic behavior: paramstyle pyformat
assert pymonetdb.paramstyle == 'pyformat'

with pymonetdb.connect('demo') as conn, conn.cursor() as cursor:
    parameters = dict(number=42, fruit="ban'ana")
    cursor.execute("SELECT %(number)s, %(fruit)s", parameters)
    assert cursor.fetchone() == (42, "ban'ana")

# enable named parameters
pymonetdb.paramstyle = 'named'

with pymonetdb.connect('demo') as conn, conn.cursor() as cursor:
    parameters = dict(number=42, fruit="ban'ana")
    cursor.execute("SELECT :number, :fruit", parameters)
    assert cursor.fetchone() == (42, "ban'ana")

1.7.0

20 Jun 10:12

Choose a tag to compare

Changes since 1.6.4

  • Add support for a new, binary result set format. This makes transferring large result sets much faster, often by a factor 3 or more. Only works in combination with MonetDB version Jun2023 or later. This is enabled by default but can be controlled with the binary parameter.

  • Automatically transfer large result sets in batches that grow progressively larger. This behavior can be controlled with the replysize and maxprefetch parameters. See the section on 'Result set batch size' in the documentation.

  • Add optional binary, replysize and maxprefetch parameters to the MAPI URL syntax, equivalent to the pymonetdb.connect() parameters mentioned above.

  • Allow to use Connection and Cursor as context managers, for example:

    with pymonetdb.connect(db') as conn, conn.cursor() as cursor:
        cursor.execute("SELECT 42")
  • Let Cursor.execute() return None for DDL statements such as CREATE and DROP, not -1. Note that PEP 249 leaves the return value of Cursor.execute() deliberately unspecified.

  • Preserve precision of INTERVAL SECOND values, do not round them to whole seconds.

  • Raise a more readable exception on DATE and TIMESTAMP values whose year is zero or negative.

  • At connect time, prime the connection with a number of NUL bytes. This serves two purposes: it prevents a hang when accidentally connecting to a TLS-protected server, and interestingly, it slightly improves connection setup speed.

  • Various other optimizations

1.6.4

03 Mar 10:34

Choose a tag to compare

changes since 1.6.3

  • Correctly handle result of PREPARE statement, leave id of the prepared statement in Cursor.lastrowid for use in subsequent EXEC statement.

  • Fix COPY ON CLIENT bug with filenames that contain spaces.

  • Fix bug where not all server side result sets were closed if multiple statements were passed to one Cursor.execute() call, leading to a resource leak until the connection was closed.

  • Rename Cursor.nextset(), the Python DB API reserves that name for something else.