SQL Extensions Index#

A flat index of every Dolt-specific SQL extension — every stored procedure, function, system table, and system variable — on a single page. Press ⌘F / Ctrl-F and search by keyword when you don’t know what kind of construct exposes the feature you’re looking for.

The list is grouped by extension kind:

  • Procedures — invoked with CALL; each one mirrors a dolt CLI command and is the only way to perform that operation from a SQL session.
  • Functions — invoked with SELECT; includes both scalar functions (return a single value) and table functions (used in a FROM clause to expose a view of repository state).
  • System Tables — queryable tables that expose repository state (commits, diffs, status, conflicts, …).
  • System Variables — session and global settings that change Dolt’s behavior.

If you’d rather browse by use case, see the Dolt cheat sheet.

Procedures#

Stored procedures expose the imperative side of dolt — anything that modifies state (commit, push, merge, branch, etc.). Invoke with CALL. Full details: Procedures.

NameDescription
DOLT_ADD()Stage working changes for the next commit.
DOLT_BACKUP()Manage backup remotes and run backups.
DOLT_BRANCH()Create, delete, rename, or copy a branch.
DOLT_CHECKOUT()Switch the session to a different branch, or restore a table from HEAD.
DOLT_CHERRY_PICK()Apply a single commit from another branch to the current branch.
DOLT_CLEAN()Discard untracked tables in the working set.
DOLT_CLONE()Clone a remote database into the current Dolt environment.
DOLT_COMMIT()Create a new commit from staged changes.
DOLT_COMMIT_HASH_OUT()Like DOLT_COMMIT(), but writes the new commit hash to an OUT parameter — handy from scripts that need the hash without re-querying.
DOLT_CONFLICTS_RESOLVE()Resolve a merge conflict by taking the --ours or --theirs side.
DOLT_FETCH()Update remote-tracking refs without merging.
DOLT_GC()Reclaim disk space by removing unreferenced chunks.
DOLT_MERGE()Merge another branch into the current branch.
DOLT_PULL()Fetch from and merge a remote branch in one step.
DOLT_PURGE_DROPPED_DATABASES()Permanently delete dropped databases held in the recovery area.
DOLT_PUSH()Update remote refs with local commits.
DOLT_REBASE()Replay the current branch’s commits on top of a different base.
DOLT_REMOTE()Add, remove, or list named remotes.
DOLT_RESET()Move HEAD (and optionally the working set) to a different commit.
DOLT_REVERT()Create a new commit that undoes a prior commit.
DOLT_RM()Remove a table from the working set.
DOLT_STASH()Save working-set changes to a side stack and restore HEAD.
DOLT_STATS_FLUSH()Block until in-progress statistics writes have flushed.
DOLT_STATS_GC()Block until a statistics garbage-collection signal completes.
DOLT_STATS_INFO()Print the current state of the statistics provider.
DOLT_STATS_ONCE()Run a single statistics collection cycle.
DOLT_STATS_PURGE()Clear the stats queue and cache and disable the collector.
DOLT_STATS_RESTART()Restart the statistics collector thread.
DOLT_STATS_STOP()Clear the stats queue and stop the collector thread.
DOLT_STATS_WAIT()Block on a full statistics queue cycle.
DOLT_TAG()Create, list, or delete a tag at a commit.
DOLT_UNDROP()Restore a recently dropped database from the recovery area.
DOLT_UPDATE_COLUMN_TAG()Reassign the internal tag identifier of a column.
DOLT_VERIFY_CONSTRAINTS()Walk the working set and record any constraint violations.

Functions#

Functions cover the read side: inspecting repository state, computing diffs, and looking up identifiers. Invoke scalar functions with SELECT … FROM and table functions in a FROM clause. Full details: Functions.

NameKindDescription
ACTIVE_BRANCH()scalarName of the session’s current branch.
DOLT_BRANCH_STATUS()tablePer-table modification status for the current branch.
DOLT_DIFF()tableRow-level diff between two commits (or two refs) for a given table.
DOLT_DIFF_STAT()tableNumeric summary (rows added/modified/removed) of the diff between two commits.
DOLT_DIFF_SUMMARY()tablePer-table summary of which tables changed between two commits.
DOLT_HASHOF()scalarCommit hash of a ref.
DOLT_HASHOF_DB()scalarHash representing the entire database’s working set.
DOLT_HASHOF_TABLE()scalarHash of a single table’s current contents.
DOLT_JSON_DIFF()scalarJSON-formatted diff between two JSON values.
DOLT_LOG()tableFiltered commit log, the function equivalent of dolt log.
DOLT_MERGE_BASE()scalarCommit hash of the merge base between two refs.
DOLT_PATCH()tableSQL patch statements representing the diff between two commits.
DOLT_PREVIEW_MERGE_CONFLICTS()tableRow-level conflicts a merge would produce, without performing the merge.
DOLT_PREVIEW_MERGE_CONFLICTS_SUMMARY()tablePer-table conflict counts a merge would produce.
DOLT_QUERY_DIFF()tableDiff between two query results expressed as rows.
DOLT_REFLOG()tableLocal history of ref updates (the dolt reflog equivalent).
DOLT_SCHEMA_DIFF()tableSchema-only diff between two commits.
DOLT_TEST_RUN()tableRun the configured commit-verification test groups against the working set.
DOLT_VERSION()scalarVersion string of the running dolt binary.
HAS_ANCESTOR()scalarTrue if one ref is an ancestor of another.
LAST_INSERT_UUID()scalarUUID generated by the most recent INSERT (Dolt’s UUID-column analog of LAST_INSERT_ID()).

System Tables#

System tables expose repository state — commits, branches, diffs, conflicts, status — as ordinary tables you can SELECT and JOIN. Per-user-table tables (e.g. dolt_diff_$TABLENAME) substitute the user table’s name for $TABLENAME. Full details: System Tables.

NameDescription
dolt_backupsConfigured backup remotes.
dolt_blame_$tablenameLast-modifying commit for each row of a user table.
dolt_branch_activityRecent activity timestamps for each branch.
dolt_branch_controlPer-user branch-modification permission rules.
dolt_branch_namespace_controlPer-user rules for which branch names a user may create.
dolt_branchesAll local branches with their HEAD hash and commit metadata.
dolt_column_diffPer-column history of which commits touched which column.
dolt_commit_ancestorsParent-commit relationships across the commit graph.
dolt_commit_diff_$TABLENAMERow-level diff for a user table between two specific commits.
dolt_commitsEvery commit in the database with hash, author, message, and timestamp.
dolt_conflictsPer-table conflict counts for the active merge.
dolt_conflicts_$TABLENAMERow-level conflicts for a single user table during an active merge.
dolt_constraint_violationsPer-table count of constraint violations in the working set.
dolt_constraint_violations_$TABLENAMERow-level constraint violations for a single user table.
dolt_diffDatabase-wide history of which tables changed in which commits.
dolt_diff_$TABLENAMERow-level history of a single user table.
dolt_docsSpecial README.md / LICENSE.md contents managed by Dolt.
dolt_history_$TABLENAMEA user table’s contents as of every commit in history.
dolt_ignoreTable-name patterns that should be ignored from staging.
dolt_logCommit log table (the system-table form of dolt log).
dolt_merge_statusState of any in-progress merge on the current branch.
dolt_nonlocal_tablesTables that live outside the local Dolt repository.
dolt_proceduresUser-defined stored procedures registered in the database.
dolt_query_catalogSaved queries created with dolt sql --save.
dolt_rebasePlan/state of an in-progress interactive rebase.
dolt_remote_branchesRemote-tracking branches and their tip commits.
dolt_remotesConfigured remotes (URLs and fetch specs).
dolt_schema_conflictsSchema-level conflicts produced by an active merge.
dolt_schemasStored schema fragments (views, triggers, events).
dolt_stashesStack of stashed working-set states.
dolt_statisticsIndex histograms used by the query planner.
dolt_statusWorking-set status (staged / unstaged / untracked).
dolt_status_ignoredWorking-set entries hidden by dolt_ignore.
dolt_tagsNamed refs (tags) defined in the database.
dolt_testsCommit-verification test groups configured for the database.
dolt_workspace_$TABLENAMEPer-user-table view of pending modifications in the working set.

System Variables#

Session and global settings that change Dolt’s behavior. Most affect either commit/transaction semantics or replication. Full details: System Variables.

NameDescription
dolt_allow_commit_conflictsPermit committing a working set with unresolved conflicts.
dolt_async_replicationPush to the replication remote asynchronously instead of synchronously.
dolt_author_dateOverride the author date stamped on the next commit.
dolt_author_emailOverride the author email on the next commit.
dolt_author_nameOverride the author name on the next commit.
dolt_commit_verification_groupsTest groups that must pass before a commit / merge / rebase is accepted.
dolt_committer_dateOverride the committer date on the next commit.
dolt_committer_emailOverride the committer email on the next commit.
dolt_committer_nameOverride the committer name on the next commit.
dolt_dont_merge_jsonTreat JSON columns as opaque blobs during three-way merges.
dolt_force_transaction_commitForce the transaction commit even when it would violate constraints.
dolt_log_levelDolt’s server-side log verbosity.
dolt_override_schemaUse a specific schema name regardless of the working-set HEAD.
dolt_read_replica_force_pullForce read replicas to fast-forward even on history divergence.
dolt_read_replica_remoteConfigure this server as a read replica of the named remote.
dolt_replicate_all_headsReplicate every branch instead of an explicit list.
dolt_replicate_headsComma-separated list of branches to replicate.
dolt_replicate_to_remoteConfigure this server as a primary that replicates to the named remote.
dolt_replication_remote_url_templateURL template used when replicating to dynamically-named remotes.
dolt_show_branch_databasesList one virtual database per branch in SHOW DATABASES.
dolt_show_system_tablesInclude dolt_* system tables in SHOW TABLES.
dolt_skip_replication_errorsDon’t fail commits when replication to the remote fails.
dolt_stats_branchesBranches whose statistics get auto-collected.
dolt_stats_enabledEnable or disable statistics collection.
dolt_stats_gc_enabledEnable or disable the statistics garbage collector.
dolt_stats_gc_intervalInterval between statistics GC cycles (default 1 hour).
dolt_stats_job_intervalDelay between statistics collection processing steps.
dolt_stats_memory_onlyRun statistics collection in memory only (no on-disk persistence).
dolt_stats_pausedPause the statistics collector without disabling it.
dolt_transaction_commitAutomatically create a Dolt commit at the end of each SQL transaction.
dolt_transaction_commit_messageMessage used for auto-generated transaction commits.