{
  "schema_version": 2,
  "id": "integrate/redis-adbc-driver/install",
  "title": "Install and connect",
  "url": "https://redis.io/docs/latest/integrate/redis-adbc-driver/install/",
  "summary": "Install the Redis ADBC driver and check your connection to Redis.",
  "tags": [
    "docs",
    "integrate",
    "oss",
    "rs",
    "rc"
  ],
  "last_updated": "2026-11-17T10:18:45Z",
  "page_type": "content",
  "content_hash": "a7da92e67b10bcdf45d2c29567a42ba2fc33a26bf562e25aac7c811c0ae4f054",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The Redis ADBC driver ships as the `adbc-driver-redis` Python package. The\npackage bundles the native driver, so you don't need to build anything. Other\ntools that load ADBC drivers by name, such as DuckDB, can use the same library\nafter you register it."
    },
    {
      "id": "before-you-start",
      "title": "Before you start",
      "role": "content",
      "text": "You need:\n\n- Python 3.12 or later, on Linux (x86-64 or ARM64, glibc 2.28 or later) or\n  macOS on Apple silicon (macOS 15 or later). There are no wheels for other\n  platforms.\n- A Redis database with the Query Engine (Search) enabled. See the\n  [requirements](https://redis.io/docs/latest/integrate/redis-adbc-driver#requirements)\n  for supported deployments."
    },
    {
      "id": "install-the-package",
      "title": "Install the package",
      "role": "setup",
      "text": "1. Create and activate a virtual environment:\n\n    [code example]\n\n1. Install the driver with its DB-API extra. DB-API is Python's standard\n   database interface, and the extra adds the `dbapi` module and its\n   dependencies:\n\n    [code example]\n\n1. Check the installation without connecting to Redis:\n\n    [code example]\n\n   The `doctor` command prints `OK`, `SKIP`, or `FAIL` for each check. It\n   exits with 0 when the checks pass, 1 when a check fails, and 2 when its\n   arguments are invalid.\n\nInstalling the package doesn't start a Redis server."
    },
    {
      "id": "connect-to-redis",
      "title": "Connect to Redis",
      "role": "content",
      "text": "The driver connects with a Redis URI. Set it in your environment rather than\nin code, so that credentials stay out of your source files and shell history.\n\n| Connection | URI |\n| :-- | :-- |\n| No TLS | `redis://<host>:<port>/0` |\n| TLS with certificate verification | `rediss://<host>:<port>/0` |\n| With credentials | `redis://<username>:<password>@<host>:<port>/0` |\n\nIf a username or password contains reserved characters then you must URL-encode them. Use\nyour deployment's actual host and port rather than assuming 6379. Only\ndatabase 0 is supported on a cluster, and the project has tested only\ndatabase 0 on standalone servers.\n\n1. Set the URI:\n\n    [code example]\n\n1. Check the connection:\n\n    [code example]\n\n   The connection check opens a normal driver connection, confirms that Search\n   is available, and runs `SELECT 1`. It doesn't create tables or write data.\n   If it prints `FAIL`, check the URI, network access, the\n   [server requirements](https://redis.io/docs/latest/integrate/redis-adbc-driver#requirements),\n   and the user's ACL permissions.\n\nA plaintext connection check doesn't test TLS. To test TLS, run `doctor` with\nyour `rediss://` URI. If your server uses a certificate from a private\ncertificate authority, pass its PEM bundle with `--ca-file`:\n\n[code example]\n\nIf the database uses [ACLs](https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl),\nthen the user needs a specific set of commands and key patterns. See\n[ACL users](https://redis.github.io/redis-adbc-driver/docs/driver-reference/#acl-users)\nin the driver reference."
    },
    {
      "id": "use-the-driver-from-other-tools",
      "title": "Use the driver from other tools",
      "role": "content",
      "text": "Tools that load ADBC drivers by name, such as DuckDB, need a driver manifest\nthat points to the library in the Python package.\n\n1. Register the driver for your user:\n\n    [code example]\n\n   Use `--venv` to register it for the active virtual environment only, or\n   `--directory <manifest-directory>` for a custom location. If you use a\n   custom directory, add it to the `ADBC_DRIVER_PATH` environment variable of\n   the tool that loads the driver.\n\n1. Check that both the `redis` and `rediss` driver names work against your\n   server:\n\n    [code example]\n\nThe manifests contain absolute paths into the installed package. Keep the\nvirtual environment in place, and run the registration command again if you\nmove or replace it.\n\nIf you don't use Python, the project provides a native installer that\ndownloads, verifies, and registers a release of the library. See\n[Install, upgrade and uninstall the native driver](https://redis.github.io/redis-adbc-driver/docs/native-installation/)."
    },
    {
      "id": "run-a-query-from-code",
      "title": "Run a query from code",
      "role": "content",
      "text": "This example connects to Redis and runs `SELECT 1`. The Python version uses the\npackage's DB-API module. The Go version loads the registered driver by name\nwith the ADBC driver manager, so\n[register the driver](#use-the-driver-from-other-tools) first. It needs\nGo 1.25 or later with cgo enabled, and a C compiler.\n\n**Python:**\n\nCreate a file named `select_one.py`:\n\n[code example]\n\nRun it:\n\n[code example]\n\n[code example]\n\n**Go:**\n\nCreate a module and add the driver manager:\n\n[code example]\n\nCreate a file named `main.go`:\n\n[code example]\n\nDownload the dependencies and run it:\n\n[code example]\n\n[code example]\n\nIf the driver isn't registered, the program fails with an error that lists\nthe directories where the driver manager looked for it.\n\n\n\nThe driver also works from other languages and from tools that load ADBC\ndrivers. The project's\n[integration guides](https://redis.github.io/redis-adbc-driver/docs/integrations/)\ncover them."
    },
    {
      "id": "next-steps",
      "title": "Next steps",
      "role": "content",
      "text": "- [Query Redis with SQL and Arrow](https://redis.io/docs/latest/integrate/redis-adbc-driver/quick-start)\n- [Data tool guides](https://redis.io/docs/latest/integrate/redis-adbc-driver#data-tools)"
    }
  ],
  "examples": [
    {
      "id": "install-the-package-ex0",
      "language": "bash",
      "code": "python3 -m venv .venv\n    . .venv/bin/activate",
      "section_id": "install-the-package"
    },
    {
      "id": "install-the-package-ex1",
      "language": "bash",
      "code": "python -m pip install 'adbc-driver-redis[dbapi]'",
      "section_id": "install-the-package"
    },
    {
      "id": "install-the-package-ex2",
      "language": "bash",
      "code": "python -m adbc_driver_redis doctor --offline",
      "section_id": "install-the-package"
    },
    {
      "id": "connect-to-redis-ex0",
      "language": "bash",
      "code": "export REDIS_URI='redis://<host>:<port>/0'",
      "section_id": "connect-to-redis"
    },
    {
      "id": "connect-to-redis-ex1",
      "language": "bash",
      "code": "python -m adbc_driver_redis doctor",
      "section_id": "connect-to-redis"
    },
    {
      "id": "connect-to-redis-ex2",
      "language": "bash",
      "code": "python -m adbc_driver_redis doctor --ca-file <path-to-ca.pem>",
      "section_id": "connect-to-redis"
    },
    {
      "id": "use-the-driver-from-other-tools-ex0",
      "language": "bash",
      "code": "python -m adbc_driver_redis install-manifest --user",
      "section_id": "use-the-driver-from-other-tools"
    },
    {
      "id": "use-the-driver-from-other-tools-ex1",
      "language": "bash",
      "code": "python -m adbc_driver_redis doctor --check-manifests",
      "section_id": "use-the-driver-from-other-tools"
    },
    {
      "id": "run-a-query-from-code-ex0",
      "language": "python",
      "code": "import os\n\nfrom adbc_driver_redis import dbapi\n\nwith dbapi.connect(os.environ[\"REDIS_URI\"]) as conn:\n    with conn.cursor() as cur:\n        cur.execute(\"SELECT 1 AS one\")\n        print(cur.fetch_arrow_table())",
      "section_id": "run-a-query-from-code"
    },
    {
      "id": "run-a-query-from-code-ex1",
      "language": "bash",
      "code": "python select_one.py",
      "section_id": "run-a-query-from-code"
    },
    {
      "id": "run-a-query-from-code-ex2",
      "language": "text",
      "code": "pyarrow.Table\none: int32\n----\none: [[1]]",
      "section_id": "run-a-query-from-code"
    },
    {
      "id": "run-a-query-from-code-ex3",
      "language": "bash",
      "code": "go mod init example.com/adbc-query\ngo get github.com/apache/arrow-adbc/go/adbc@v1.12.0",
      "section_id": "run-a-query-from-code"
    },
    {
      "id": "run-a-query-from-code-ex4",
      "language": "go",
      "code": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/apache/arrow-adbc/go/adbc\"\n\t\"github.com/apache/arrow-adbc/go/adbc/drivermgr\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tvar drv drivermgr.Driver\n\tdb, err := drv.NewDatabase(map[string]string{\n\t\t\"driver\":          \"redis\",\n\t\tadbc.OptionKeyURI: os.Getenv(\"REDIS_URI\"),\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer db.Close()\n\n\tconn, err := db.Open(ctx)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer conn.Close()\n\n\tstmt, err := conn.NewStatement()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer stmt.Close()\n\n\tif err := stmt.SetSqlQuery(\"SELECT 1 AS one\"); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treader, _, err := stmt.ExecuteQuery(ctx)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer reader.Release()\n\n\tfor reader.Next() {\n\t\tfmt.Println(reader.RecordBatch())\n\t}\n\tif err := reader.Err(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}",
      "section_id": "run-a-query-from-code"
    },
    {
      "id": "run-a-query-from-code-ex5",
      "language": "bash",
      "code": "go mod tidy\ngo run .",
      "section_id": "run-a-query-from-code"
    },
    {
      "id": "run-a-query-from-code-ex6",
      "language": "text",
      "code": "record:\n  schema:\n  fields: 1\n    - one: type=int32, nullable\n  rows: 1\n  col[0][one]: [1]",
      "section_id": "run-a-query-from-code"
    }
  ]
}
