Skip to content

ENSDb integration

For special use cases that go beyond what the ENS Omnigraph exposes — you can query the live onchain state of both ENSv1 and ENSv2 directly via SQL.

ENSDb is a bi-directional integration standard for any EnsDbWriter and EnsDbReader implementations to coordinate around the live unified onchain state of ENSv1 and ENSv2 in a carefully-crafted standardized data model within a PostgreSQL database. Because ENSDb builds on Postgres, you can use any language with a Postgres driver — TypeScript, Python, Rust, Go, and more.

Inspirations for what you can build with ENSDb

Section titled “Inspirations for what you can build with ENSDb”

Custom APIs

Build specialized GraphQL or REST APIs tailored to your use case. Query exactly the data you need with full SQL power.

Analytics & Dashboards

Create real-time dashboards and analytics pipelines. Better than Dune — you have the live ENS state locally with sub-second query latency.

CLIs & Developer Tools

Build command-line tools for ENS operations. Query domains, and any specialized lookup — all from your terminal.

Event-Based Engines

Build reactive systems that respond to ENS state changes. Respond to registration lifecycle updates, ownership transfers, resolver updates.

Data Pipelines

Feed ENS data into your existing data infrastructure. Sync to data warehouses, trigger webhooks, populate search indexes.

AI Agents

Build AI agents that can query ENS state and perform actions based on that data.

Example: fetch ENSv2 domains with the ENSDb SDK

Section titled “Example: fetch ENSv2 domains with the ENSDb SDK”
import { EnsDbReader } from "@ensnode/ensdb-sdk";
import { eq } from "drizzle-orm";
const ensDbReader = new EnsDbReader(ensDbConnectionString, ensIndexerSchemaName);
const { ensDb, ensIndexerSchema } = ensDbReader;
const v2Domains = await ensDb
.select()
.from(ensIndexerSchema.domain)
.where(eq(ensIndexerSchema.domain.type, "ENSv2Domain"));
SELECT * FROM ensindexer_0.domains
WHERE type = 'ENSv2Domain'
LIMIT 10;