uranusjr commented on code in PR #52330: URL: https://github.com/apache/airflow/pull/52330#discussion_r3837721018
########## providers/apache/arrow/docs/connections/adbc.rst: ########## @@ -0,0 +1,199 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. _howto/connection:adbc: + +ADBC connection +=============== + +The ADBC connection type enables connection to any database that has an +`Arrow Database Connectivity (ADBC) <https://arrow.apache.org/adbc/>`__ driver, +such as PostgreSQL, SQLite, DuckDB, Snowflake, BigQuery, and Flight SQL servers. + +Connections of this type are used by :class:`~airflow.providers.apache.arrow.hooks.adbc.AdbcHook`, +which builds on top of :class:`~airflow.providers.common.sql.hooks.sql.DbApiHook` and transfers +data as Apache Arrow :class:`~pyarrow.RecordBatch` objects for efficient, zero-copy bulk loads. + +Default Connection ID +--------------------- + +``adbc_default`` + +Configuring the Connection +-------------------------- + +Connection URL (Host field) + The database URI passed to the driver. For drivers that use a standard + connection string (e.g. ``postgresql://user:pass@host:5432/db`` or + ``file::memory:``), put it here. If the value contains ``::`` the hook + passes it through unchanged; otherwise the ``adbc://`` scheme prefix is + replaced with the dialect name. + +Login / Password + Convenience fields. When set, Airflow builds a URI of the form + ``<dialect>://login:password@host/schema`` that is merged into + ``db_kwargs["uri"]``. Driver-specific URIs in the Host field take + precedence. + +Extra (JSON) + A JSON object with the following recognized keys: + + ``driver`` *(string)* + Python package name of the ADBC driver to load, e.g. + ``"adbc_driver_postgresql"`` or ``"adbc_driver_sqlite"``. + When omitted the hook derives the name from the dialect as + ``adbc_driver_<dialect>``. + + ``entrypoint`` *(string, optional)* + Fully-qualified Python symbol used as the driver entrypoint, e.g. + ``"adbc_driver_sqlite.dbapi.connect"``. Most drivers do not need + this; it is only required when the automatic entrypoint discovery + built into ``adbc_driver_manager`` cannot locate the function. + + ``dialect`` *(string, optional)* + SQL dialect name used to build the URI scheme and derive the + default driver name. Defaults to ``"default"``. + + ``db_kwargs`` *(object, optional)* + Keyword arguments forwarded verbatim to the ADBC + ``AdbcDatabase`` constructor (database-level connection settings). + ``uri`` is always injected automatically from the Host field and + must not be repeated here. Common keys: + + .. list-table:: + :header-rows: 1 + :widths: 30 15 55 + + * - Key + - Type + - Description + * - ``username`` + - string + - Database user name (alternative to encoding it in the URI). + * - ``password`` + - string + - Database password (alternative to encoding it in the URI). + * - ``adbc.connection.autocommit`` + - bool + - Enable autocommit at the database level (driver-dependent). Review Comment: The database-level flag would not be `adbc.connection.autocommit` but driver-dependent (e.g. `adbc.sqlite.*`). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
