@apicity/dolthub
DoltHub API provider for executing SQL and managing Dolt databases.
Runtime dependencies:
zod@^4.6.6— request schemas attached to every POST endpoint as.schema
Installation
npm install @apicity/dolthub
# or
pnpm add @apicity/dolthub
Quick Start
import { createDoltHub } from "@apicity/dolthub";
const dolthub = createDoltHub({ apiToken: process.env.DOLTHUB_API_KEY! });
API Reference
23 endpoints across 4 groups. Each method mirrors an upstream URL path.
databases
POST dolthub.api.v2.databases.branches.create
POST https://www.dolthub.com/api/v2/databases/{owner}/{database}/branches
Cost tier: cheap
const res = await dolthub.api.v2.databases.branches.create({ /* ... */ });
GET dolthub.api.v2.databases.branches.list
GET https://www.dolthub.com/api/v2/databases/{owner}/{database}/branches{query}
Cost tier: cheap
const res = await dolthub.api.v2.databases.branches.list({ /* ... */ });
POST dolthub.api.v2.databases.create
POST https://www.dolthub.com/api/v2/databases
Cost tier: cheap
const res = await dolthub.api.v2.databases.create({ /* ... */ });
POST dolthub.api.v2.databases.forks.create
POST https://www.dolthub.com/api/v2/databases/{owner}/{database}/forks
Cost tier: cheap
const res = await dolthub.api.v2.databases.forks.create({ /* ... */ });
POST dolthub.api.v2.databases.pulls.create
POST https://www.dolthub.com/api/v2/databases/{owner}/{database}/pulls
Cost tier: cheap
const res = await dolthub.api.v2.databases.pulls.create({ /* ... */ });
GET dolthub.api.v2.databases.pulls
GET https://www.dolthub.com/api/v2/databases/{owner}/{database}/pulls/{pullNumber}
Cost tier: cheap
const res = await dolthub.api.v2.databases.pulls.get({ /* ... */ });
GET dolthub.api.v2.databases.pulls.list
GET https://www.dolthub.com/api/v2/databases/{owner}/{database}/pulls{query}
Cost tier: cheap
const res = await dolthub.api.v2.databases.pulls.list({ /* ... */ });
POST dolthub.api.v2.databases.pulls.merge
POST https://www.dolthub.com/api/v2/databases/{owner}/{database}/pulls/{pullNumber}/merge
Cost tier: cheap
const res = await dolthub.api.v2.databases.pulls.merge({ /* ... */ });
GET dolthub.api.v2.databases.sql.read
GET https://www.dolthub.com/api/v2/databases/{owner}/{database}/sql{query}
Cost tier: cheap
const res = await dolthub.api.v2.databases.sql.read({ /* ... */ });
POST dolthub.api.v2.databases.sql.write
POST https://www.dolthub.com/api/v2/databases/{owner}/{database}/sql-writes
Cost tier: cheap
const res = await dolthub.api.v2.databases.sql.write({ /* ... */ });
operations
GET dolthub.api.v2.operations
GET https://www.dolthub.com/api/v2/operations/{operationId}
Cost tier: cheap
const res = await dolthub.api.v2.operations.get({ /* ... */ });
user
GET dolthub.api.v2.user
GET https://www.dolthub.com/api/v2/user
Cost tier: cheap
const res = await dolthub.api.v2.user.get();
v1alpha1
POST dolthub.v1alpha1.branches.create
POST https://www.dolthub.com/api/v1alpha1/{owner}/{database}/branches
Cost tier: cheap
const res = await dolthub.v1alpha1.branches.create({ /* ... */ });
GET dolthub.v1alpha1.branches.list
GET https://www.dolthub.com/api/v1alpha1/{owner}/{database}/branches
Cost tier: cheap
const res = await dolthub.v1alpha1.branches.list({ /* ... */ });
POST dolthub.v1alpha1.database.create
POST https://www.dolthub.com/api/v1alpha1/database
Cost tier: cheap
const res = await dolthub.v1alpha1.database.create({ /* ... */ });
POST dolthub.v1alpha1.pulls.create
POST https://www.dolthub.com/api/v1alpha1/{owner}/{database}/pulls
Cost tier: cheap
const res = await dolthub.v1alpha1.pulls.create({ /* ... */ });
GET dolthub.v1alpha1.pulls
GET https://www.dolthub.com/api/v1alpha1/{owner}/{database}/pulls/{pullId}
Cost tier: cheap
const res = await dolthub.v1alpha1.pulls.get({ /* ... */ });
GET dolthub.v1alpha1.pulls.list
GET https://www.dolthub.com/api/v1alpha1/{owner}/{database}/pulls{query}
Cost tier: cheap
const res = await dolthub.v1alpha1.pulls.list({ /* ... */ });
POST dolthub.v1alpha1.pulls.merge
POST https://www.dolthub.com/api/v1alpha1/{owner}/{database}/pulls/{pullId}/merge
Cost tier: cheap
const res = await dolthub.v1alpha1.pulls.merge({ /* ... */ });
GET dolthub.v1alpha1.sql.read
GET https://www.dolthub.com/api/v1alpha1/{owner}/{database}{refPath}{query}
Cost tier: cheap
const res = await dolthub.v1alpha1.sql.read({ /* ... */ });
POST dolthub.v1alpha1.sql.write
POST https://www.dolthub.com/api/v1alpha1/{owner}/{database}/write/{fromBranch}/{toBranch}{query}
Cost tier: cheap
const res = await dolthub.v1alpha1.sql.write({ /* ... */ });
GET dolthub.v1alpha1.sql.writePoll
GET https://www.dolthub.com/api/v1alpha1/{owner}/{database}/write{query}
Cost tier: cheap
const res = await dolthub.v1alpha1.sql.writePoll({ /* ... */ });
GET dolthub.v1alpha1.user
GET https://www.dolthub.com/api/v1alpha1/user
Cost tier: cheap
const res = await dolthub.v1alpha1.user.get();
Part of the apicity monorepo.
License
MIT — see LICENSE.