{"record":{"id":"04d8f82c7ba46a67","repo":"pola-rs/polars","slug":"the-connectorx-engine-does-not-support-use-of-e","errorCode":null,"errorMessage":"the 'connectorx' engine does not support use of `execute_options`","messagePattern":"the 'connectorx' engine does not support use of `execute_options`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/database/functions.py","lineNumber":502,"sourceCode":"    >>> df = pl.read_database_uri(\n    ...     \"SELECT * FROM employees WHERE hourly_rate BETWEEN ? AND ?\",\n    ...     \"sqlite:///:memory:\",\n    ...     engine=\"adbc\",\n    ...     execute_options={\"parameters\": (40, 20)},\n    ... )  # doctest: +SKIP\n    \"\"\"\n    from polars.io.database._utils import _read_sql_adbc, _read_sql_connectorx\n\n    if not isinstance(uri, str):\n        msg = f\"expected connection to be a URI string; found {qualified_type_name(uri)!r}\"\n        raise TypeError(msg)\n    elif engine is None:\n        engine = \"connectorx\"\n\n    if engine == \"connectorx\":\n        if execute_options:\n            msg = \"the 'connectorx' engine does not support use of `execute_options`\"\n            raise ValueError(msg)\n        if pre_execution_query:\n            issue_unstable_warning(\n                \"the 'pre-execution-query' parameter is considered unstable.\"\n            )\n        return _read_sql_connectorx(\n            query,\n            connection_uri=uri,\n            partition_on=partition_on,\n            partition_range=partition_range,\n            partition_num=partition_num,\n            protocol=protocol,\n            schema_overrides=schema_overrides,\n            pre_execution_query=pre_execution_query,\n        )\n    elif engine == \"adbc\":\n        if not isinstance(query, str):\n            msg = f\"only a single SQL query string is accepted for adbc, got a {qualified_type_name(query)!r} type\"\n            raise ValueError(msg)","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/io/database/functions.py#L484-L520","documentation":"Raised by read_database_uri() when engine='connectorx' and execute_options is supplied. The connectorx engine takes no per-execution options; parameter binding and similar execution knobs are only supported by the adbc engine.","triggerScenarios":"pl.read_database_uri(query, uri, engine='connectorx', execute_options={'parameters': (...)})","commonSituations":"Switching engines for performance while keeping parameterized-query code; code copied from an adbc example run against the default (connectorx) engine.","solutions":["Remove execute_options when using connectorx, or","Switch to engine='adbc' if you need execute_options like parameter binding"],"exampleFix":"# before\npl.read_database_uri(q, uri, engine=\"connectorx\", execute_options={\"parameters\": (40, 20)})\n\n# after\npl.read_database_uri(q, uri, engine=\"adbc\", execute_options={\"parameters\": (40, 20)})","handlingStrategy":"validation","validationCode":"engine = engine or \"connectorx\"\nif execute_options and engine == \"connectorx\":\n    engine = \"adbc\"  # or drop execute_options","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Encode the rule 'parameters => adbc' in your DB helper layer","Keep engine choice explicit at every call site instead of defaulted","Remember connectorx handles multi-query/partitioning; adbc handles execute_options"],"tags":["database","connectorx","engine","validation"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}