Skip to content

Your first query

Each tab connects to a server on localhost:31337 as the administrator hardcharger with password change-me (as in the quickstart), runs one query with a bind parameter, and prints the result.

from adbc_driver_hardcharger import dbapi as hardcharger
with hardcharger.connect(uri="hardcharger://localhost?tls=false",
username="hardcharger", password="change-me") as conn:
with conn.cursor() as cur:
cur.execute(operation="SELECT 42 AS answer, ? AS greeting", parameters=["hello"])
print(cur.fetch_arrow_table().to_pylist())
[{'answer': 42, 'greeting': 'hello'}]

hardcharger://localhost means HTTPS on port 31337; ?tls=false is plain HTTP for your own machine. Install the driver.

  1. The client exchanged the password for a bearer token (POST /warp/v1/auth/token).
  2. It opened a session, the server-side state of one connection (POST /warp/v1/sessions).
  3. It submitted the statement with its bind parameter. The value travelled as a value, never spliced into the SQL, and the result streamed back as Arrow in the same response.

The drivers do all of this for you, and more: retries, resumable downloads, cancel and partitioned reads. Warp SQL in one page explains the model.