Skip to content
Explore

Try CrateDB Live

You can connect directly to CrateDB from your applications using standard PostgreSQL drivers or the HTTP endpoint.

For a full list of supported drivers and libraries, see this page.


Python

Python is one of the most common ways to interact with CrateDB, especially for analytics and AI use cases.

You can use:

  • psycopg2 (PostgreSQL driver)
  • asyncpg
  • SQLAlchemy

Example:

import psycopg2

conn = psycopg2.connect(
    host="<host>",
    port=5432,
    user="admin"
)

cur = conn.cursor()
cur.execute("<your query>")

print(cur.fetchone())

Java

Use any PostgreSQL-compatible JDBC driver.

Example connection string:

jdbc:postgresql://<host>:5432/doc 

.NET

CrateDB can be accessed using PostgreSQL-compatible .NET drivers such as Npgsql.

Example connection string:

Host=<host>;Port=5432;Username=admin;Database=crate