We recommend to use those drivers and adapters for the corresponding languages and frameworks.
Language | Driver/Adapter | Interface | Description |
---|---|---|---|
Golang | pgx | PG | A pure Go driver and toolkit for PostgreSQL. |
Java | PostgreSQL JDBC | PG | For connecting to CrateDB from any environment that supports it. |
Java | CrateDB legacy JDBC driver | PG | For connecting to CrateDB within special scenarios, in order to leverage more features of its type system. |
JavaScript, TypeScript | node-postgres | PG | A collection of Node.js modules for interfacing with a PostgreSQL database. [1] |
PHP | PHP PDO driver | HTTP | For connecting to CrateDB from PHP. |
PHP | PHP DBAL adapter | HTTP | For connecting to CrateDB from PHP, using DBAL and Doctrine. |
Python | DB-API driver | HTTP | For connecting to CrateDB from Python. [2] |
Python | SQLAlchemy dialect | HTTP | For connecting to CrateDB from Python, using SQLAlchemy. |
Python | asyncpg | PG | For connecting to CrateDB from Python. [3] |
Python | psycopg3 | PG | For connecting to CrateDB from Python. [3:1] |
Note: While we generally recommend the PostgreSQL interface (PG) for maximum compatibility in PostgreSQL environments, the HTTP interface supports CrateDB bulk operations and CrateDB BLOBs, which are not supported by the PostgreSQL protocol.
Language/Framework | Getting started tutorial / Basic code example |
---|---|
.NET/C# | Basic example for connecting to CrateDB and CrateDB Cloud using .NET (C#) |
Java | Basic example for connecting to CrateDB and CrateDB Cloud using JDBC |
Java | Apache Kafka, Apache Flink, and CrateDB |
Java | jOOQ example application with CrateDB and JDBC connectivity |