LinuxCommandLibrary

dolt-sql

execute SQL queries on versioned database

TLDR

Run SQL query

$ dolt sql -q "[SELECT * FROM table]"
copy
Start interactive SQL shell
$ dolt sql
copy
Execute SQL file
$ dolt sql < [script.sql]
copy
Run query with result format
$ dolt sql -q "[SELECT * FROM table]" -r [csv]
copy
Start MySQL-compatible server
$ dolt sql-server
copy
Batch mode execution
$ dolt sql -b -q "[INSERT INTO table VALUES (1, 'a')]"
copy

SYNOPSIS

dolt sql [options] [-q query]

DESCRIPTION

dolt sql provides SQL access to Dolt repositories. It supports MySQL-compatible SQL syntax for querying and modifying data in versioned tables.
The interactive shell offers tab completion and command history. Queries can read from any branch or commit using Dolt's SQL extensions, enabling time-travel queries across the repository history.
dolt sql-server starts a MySQL-compatible server allowing connections from standard MySQL clients, ORMs, and applications.

PARAMETERS

-q QUERY

SQL query to execute.
-r FORMAT
Result format: tabular, csv, json, null.
-b, --batch
Batch mode (no formatting).
-x, --result-format
Vertical result format.
--continue
Continue on error in batch mode.
--help
Display help information.

CAVEATS

Some MySQL features not fully supported. Write queries modify working set (need commit). Large result sets may be slow to render. Server mode requires port availability.

HISTORY

dolt sql provides the primary data interaction interface for Dolt, implementing MySQL compatibility to enable use with existing SQL tools and knowledge.

SEE ALSO

dolt(1), mysql(1), sqlite3(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community