duckdb icon indicating copy to clipboard operation
duckdb copied to clipboard

Python DBAPI 2.0 Compatibility

Open Mause opened this issue 4 years ago • 2 comments

I figured it might be worth documenting some of the gaps that I've found while trying to build out the sqlalchemy driver for duckdb

The specification is available here: https://peps.python.org/pep-0249/

  • [x] description throws an exception instead of returning None when no result set is open (fixed in https://github.com/duckdb/duckdb/pull/1963)
  • [x] description is missing mandatory type_code value (https://github.com/duckdb/duckdb/pull/1990)
  • [ ] missing fetchmany method on cursor
  • [ ] Throw exceptions per standard, rather than using std::runtime_error for everything (working on this myself in https://github.com/duckdb/duckdb/pull/4075)
  • [ ] Missing the extension lastrowid (raised in https://github.com/duckdb/duckdb/issues/3976)

Mause avatar Jul 08 '21 05:07 Mause

This is related to https://github.com/duckdb/duckdb/issues/469 as well

Mause avatar Jul 08 '21 08:07 Mause

@Mause Yeah, I noticed this when I started trying to port the SQLite tests. I think there are two things in play, there's compatibility with the DB-API and compatibility with SQLite (which isn't completely conformant, and implements some of the extensions as well). I had a go at trying to build a pure Python wrapper which was more conformant, but I've unfortunately been waylaid with other things: https://github.com/thesketh/pyduckdb

thesketh avatar Jul 14 '21 13:07 thesketh

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Aug 02 '23 00:08 github-actions[bot]

This issue was closed because it has been stale for 30 days with no activity.

github-actions[bot] avatar Sep 02 '23 00:09 github-actions[bot]