{"record":{"id":"1292aa03cb70f96d","repo":"pola-rs/polars","slug":"currently-no-support-for-self-driver-name-r-conn","errorCode":null,"errorMessage":"Currently no support for {self.driver_name!r} connection {self.cursor!r}","messagePattern":"Currently no support for (.+?) connection (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/database/_executor.py","lineNumber":648,"sourceCode":"            self._from_arrow,  # init from arrow-native data (where support exists)\n            self._from_rows,  # row-wise fallback (sqlalchemy, dbapi2, pyodbc, etc)\n        ):\n            frame = frame_init(\n                batch_size=batch_size,\n                iter_batches=iter_batches,\n                schema_overrides=schema_overrides,\n                infer_schema_length=infer_schema_length,\n            )\n            if frame is not None:\n                if defer_cursor_close:\n                    frame_cursor = CloseAfterFrameIter(frame, cursor=self.cursor)\n                    frame = (df for df in frame_cursor)\n                return frame\n\n        msg = (\n            f\"Currently no support for {self.driver_name!r} connection {self.cursor!r}\"\n        )\n        raise NotImplementedError(msg)\n","sourceCodeStart":630,"sourceCodeEnd":649,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/database/_executor.py#L630-L649","documentation":"to_polars dispatches to a driver-specific fast path (arrow-native fetch methods, SQLAlchemy, DBAPI fetchall) based on the cursor's type; if the connected driver is not among the supported ones, it raises NotImplementedError naming the driver and cursor. The library has no ingestion strategy for that driver yet.","triggerScenarios":"Using pl.read_database with an exotic/unsupported DBAPI driver (e.g. niche drivers or wrappers whose cursor lacks the fetch methods polars special-cases) so no fast path or fallback applies.","commonSituations":"New or uncommon database drivers; custom cursor wrappers; drivers installed in versions that changed their cursor API; connecting via an ODBC/JDBC bridge polars doesn't recognise.","solutions":["Use a mainstream driver (psycopg2, pyodbc, cx_Oracle/oracledb, mysqlclient, sqlite3) or SQLAlchemy, which polars supports","Prefer pl.read_database_uri with engine=\"connectorx\" or \"adbc\" for exotic databases — it bypasses DBAPI entirely","Fetch rows yourself with cursor.fetchall() and build the frame via pl.DataFrame(rows, schema=..., orient=\"row\")","Check/upgrade py-polars version; driver support expands over time"],"exampleFix":"// before\ndf = pl.read_database(query, exotic_conn)  # NotImplementedError\n// after\nrows = exotic_conn.cursor().execute(query).fetchall()\ndf = pl.DataFrame(rows, orient=\"row\")\n// or\ndf = pl.read_database_uri(query, \"exotic://user:pw@host/db\", engine=\"connectorx\")","handlingStrategy":"fallback","validationCode":"SUPPORTED = (\"psycopg2\",\"psycopg\",\"pyodbc\",\"mysqlclient\",\"pymysql\",\"sqlite3\",\"oracledb\",\"cx_Oracle\")\nif getattr(conn, \"__driver_name__\", type(conn).__module__.split('.')[0]) not in SUPPORTED:\n    # plan B: fetch rows manually or use connectorx/adbc via read_database_uri\n    ...","typeGuard":"def is_arrow_native_cursor(cur) -> bool:\n    return any(hasattr(cur, m) for m in (\"fetch_arrow_table\", \"fetch_df\", \"fetchall\", \"fetchmany\"))","tryCatchPattern":"try:\n    df = pl.read_database(query, conn)\nexcept NotImplementedError:\n    rows = conn.cursor().execute(query).fetchall()\n    df = pl.DataFrame(rows, orient=\"row\")","preventionTips":["Prefer documented drivers or SQLAlchemy engines with read_database","Use pl.read_database_uri(engine=\"connectorx\"/\"adbc\") for databases without DBAPI support","Pin and test driver versions in CI to catch API changes early"],"tags":["database","unsupported-driver","not-implemented","polars"],"backgroundTag":"incompatible-source-type","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}