Python Driver

NodeDB speaks PostgreSQL's wire protocol, so any Python PostgreSQL driver works.

psycopg2

import psycopg2

conn = psycopg2.connect(host="localhost", port=6432, dbname="nodedb")
cur = conn.cursor()

cur.execute("SELECT * FROM users WHERE age > %s", (30,))
rows = cur.fetchall()

conn.close()

asyncpg

import asyncpg

conn = await asyncpg.connect("postgresql://localhost:6432/nodedb")
rows = await conn.fetch("SELECT * FROM users WHERE age > $1", 30)
await conn.close()

SQLAlchemy

from sqlalchemy import create_engine

engine = create_engine("postgresql://localhost:6432/nodedb")
with engine.connect() as conn:
    result = conn.execute("SELECT * FROM users LIMIT 10")

ORMs

Django, SQLAlchemy ORM, Prisma, and other PostgreSQL-compatible ORMs work with NodeDB's pgwire protocol.

View page sourceLast updated on Apr 16, 2026 by Farhan Syah