Skip to content

Add @ database revision delimiter for ORMs and drivers#10431

Merged
elianddb merged 29 commits intomainfrom
elian/10382
Feb 27, 2026
Merged

Add @ database revision delimiter for ORMs and drivers#10431
elianddb merged 29 commits intomainfrom
elian/10382

Conversation

@elianddb
Copy link
Copy Markdown
Contributor

@elianddb elianddb commented Feb 5, 2026

Fix #10382

  • Fix dolt SQL shell bug where the revision database in use would switch to main after a SQL statement:
10382/main> call dolt_branch('branch1');
+--------+
| status |
+--------+
| 0      |
+--------+
1 row in set (0.01 sec) 

10382/main> use `10382/branch1`;
Database Changed

10382/branch1> show databases;
+--------------------+
| Database           |
+--------------------+
| 10382              |
| 10382/branch1      |
| 10382/main         |
| ...                |
+--------------------+
10 rows in set (0.00 sec) 


10382/main>
  • Add support for new @ character as delimiter for database revision names and remove @ use in normal database names.
  • Fix dolt_status table to report status in detached heads.
  • Fix Dolt shell to not report an error when switching to a detached head.
  • Add support to Dolt shell for new @ delimiter for database revisions.

MySQL ORMs (e.g., Prisma) and drivers have trouble parsing the / character in database names for their connection URLs. Dolt's database revisions (i.e., branches and commits) system requires the use of / in order to access a database revision. Consequently, this makes revisions inaccessible via ORMs and drivers under certain interfaces, as seen in the issue above.

As a result, the @ symbol now serves as a delimiter alias when accessing database revisions in Dolt. Any database-related queries that contain the @ delimiter will resolve their strings to the / counterpart. Keep in mind the database in-use will be reflected in the @ format. However, no new databases are created or stored, and you can still use the / name version.

The following covered side effects exist to keep compatibility with MySQL ORMs and drivers that use their connection URLs' database for internal tables.

⚠️The @ character is no longer supported for normal databases to avoid conflicts with revision databases.

⚠️Using the @ version of a revision database name will appear in the same format in dependent functions. This can also affect certain tables like information_schema.tables indirectly, where table_info.table_schema will resolve to the @ name when in use.

SELECT database();
+----------------+
| DATABASE()     |
+----------------+
| mydb@branch1   |
+----------------+

⚠️ This side effect also applies with the dolt_show_branch_databases system variable. When SHOW DATABASES; is called, the current revision database using the @ format will omit its / counterpart.

mydb/branch1> set dolt_show_branch_databases = 1;
Query OK, 0 rows affected (0.00 sec)
mydb/branch1> show databases;
+--------------------+
| Database           |
+--------------------+
| 10382              |
| 10382/main         |
| information_schema |
| mydb               |
| mydb@branch1       |
| mydb/main          |
| mysql              |
+--------------------+
7 rows in set (0.00 sec) 

The information_schema and other examples can be found in #10431 integration tests.

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
0991ee1 ok 5937471
version total_tests
0991ee1 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
d794c29 ok 5937471
version total_tests
d794c29 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
8c308a8 ok 5937471
version total_tests
8c308a8 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
6130d23 ok 5937471
version total_tests
6130d23 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
1924c1f ok 5937471
version total_tests
1924c1f 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
60b266a ok 5937471
version total_tests
60b266a 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
5c14e09 ok 5937471
version total_tests
5c14e09 5937471
correctness_percentage
100.0

@elianddb elianddb force-pushed the elian/10382 branch 2 times, most recently from 2ddb7ec to c8cd751 Compare February 7, 2026 03:32
@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
c8cd751 ok 5937471
version total_tests
c8cd751 5937471
correctness_percentage
100.0

@elianddb elianddb changed the title Add @ database revision name delimiter for ORMs and drivers Add @ database revision delimiter for ORMs and drivers Feb 9, 2026
@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
b164642 ok 5937471
version total_tests
b164642 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
4e02f70 ok 5937471
version total_tests
4e02f70 5937471
correctness_percentage
100.0

@elianddb elianddb requested a review from macneale4 February 9, 2026 22:00
…n `dolt_enable_revision_delimiter_alias` system variable
…ng compatible `@` delimiter, and amend Dockerfile documentation
…ion database changing on statement in dolt sql shell

# Conflicts:
#	.gitignore
@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
26c2de9 ok 5937471
version total_tests
26c2de9 5937471
correctness_percentage
100.0

Copy link
Copy Markdown
Contributor

@macneale4 macneale4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like all the mash up of changes here. Updating all the ORM testing infra in the same change with this dolt logic just seems like it's going to cause trouble. Introduce the changes in bit size chunks.

@elianddb elianddb force-pushed the elian/10382 branch 3 times, most recently from d1f6918 to b58353d Compare February 26, 2026 21:27
@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.56 0.56 0.0
groupby_scan 9.91 10.09 1.82
index_join 1.82 1.82 0.0
index_join_scan 1.37 1.34 -2.19
index_scan 22.28 22.28 0.0
oltp_point_select 0.27 0.27 0.0
oltp_read_only 5.28 5.28 0.0
select_random_points 0.54 0.53 -1.85
select_random_ranges 0.55 0.55 0.0
table_scan 22.69 22.28 -1.81
types_table_scan 66.84 66.84 0.0
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.32 6.32 0.0
oltp_insert 3.13 3.13 0.0
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.13 3.13 0.0
oltp_write_only 6.09 5.99 -1.64
types_delete_insert 6.79 6.79 0.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 61.08 61.08 0.0
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt 41d9b25 37.33 dolt ca74006 37.21 -0.32

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.56 0.56 0.0
groupby_scan 10.09 10.09 0.0
index_join 1.86 1.86 0.0
index_join_scan 1.34 1.34 0.0
index_scan 22.28 22.28 0.0
oltp_point_select 0.27 0.28 3.7
oltp_read_only 5.28 5.28 0.0
select_random_points 0.54 0.54 0.0
select_random_ranges 0.56 0.55 -1.79
table_scan 22.28 22.28 0.0
types_table_scan 68.05 66.84 -1.78
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.43 6.32 -1.71
oltp_insert 3.13 3.13 0.0
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.13 3.13 0.0
oltp_write_only 6.09 6.09 0.0
types_delete_insert 6.91 6.91 0.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.56 0.56 0.0
groupby_scan 10.09 10.09 0.0
index_join 1.86 1.82 -2.15
index_join_scan 1.34 1.34 0.0
index_scan 22.28 22.28 0.0
oltp_point_select 0.27 0.27 0.0
oltp_read_only 5.28 5.28 0.0
select_random_points 0.54 0.54 0.0
select_random_ranges 0.55 0.55 0.0
table_scan 22.28 22.28 0.0
types_table_scan 66.84 66.84 0.0
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.32 6.43 1.74
oltp_insert 3.13 3.13 0.0
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.13 3.13 0.0
oltp_write_only 6.09 6.09 0.0
types_delete_insert 6.91 6.79 -1.74

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.56 0.56 0.0
groupby_scan 10.09 10.09 0.0
index_join 1.86 1.82 -2.15
index_join_scan 1.34 1.34 0.0
index_scan 22.28 22.28 0.0
oltp_point_select 0.27 0.27 0.0
oltp_read_only 5.28 5.28 0.0
select_random_points 0.54 0.54 0.0
select_random_ranges 0.56 0.55 -1.79
table_scan 22.28 22.69 1.84
types_table_scan 66.84 68.05 1.81
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.43 6.32 -1.71
oltp_insert 3.13 3.13 0.0
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.13 3.13 0.0
oltp_write_only 6.09 6.09 0.0
types_delete_insert 6.91 6.91 0.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 61.08 61.08 0.0
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt 41d9b25 37.33 dolt fc371e0 37.54 0.56

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
418e448 ok 5937471
version total_tests
418e448 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 61.08 61.08 0.0
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt 41d9b25 37.82 dolt 418e448 37.32 -1.32

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.56 0.56 0.0
groupby_scan 9.91 10.09 1.82
index_join 1.82 1.86 2.2
index_join_scan 1.37 1.34 -2.19
index_scan 22.69 22.28 -1.81
oltp_point_select 0.27 0.27 0.0
oltp_read_only 5.28 5.28 0.0
select_random_points 0.54 0.54 0.0
select_random_ranges 0.55 0.56 1.82
table_scan 22.69 22.28 -1.81
types_table_scan 68.05 66.84 -1.78
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.32 6.32 0.0
oltp_insert 3.07 3.13 1.95
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.13 3.13 0.0
oltp_write_only 6.09 6.09 0.0
types_delete_insert 6.79 6.79 0.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
b6eaad2 ok 5937471
version total_tests
b6eaad2 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 61.08 61.08 0.0
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt 332c6a3 37.85 dolt b6eaad2 37.94 0.24

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.56 0.56 0.0
groupby_scan 10.09 9.91 -1.78
index_join 1.82 1.86 2.2
index_join_scan 1.34 1.34 0.0
index_scan 21.89 21.89 0.0
oltp_point_select 0.27 0.27 0.0
oltp_read_only 5.28 5.28 0.0
select_random_points 0.54 0.54 0.0
select_random_ranges 0.55 0.55 0.0
table_scan 22.69 22.28 -1.81
types_table_scan 66.84 65.65 -1.78
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.32 6.32 0.0
oltp_insert 3.13 3.13 0.0
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.13 3.13 0.0
oltp_write_only 5.99 6.09 1.67
types_delete_insert 6.91 6.91 0.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
710564a ok 5937471
version total_tests
710564a 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@elianddb DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 62.19 62.19 0.0
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt dec6184 36.91 dolt 710564a 37.16 0.68

@elianddb elianddb requested a review from macneale4 February 27, 2026 02:04
@elianddb elianddb dismissed macneale4’s stale review February 27, 2026 02:05

Reviewed by Zach

@elianddb elianddb merged commit e330cdd into main Feb 27, 2026
25 of 26 checks passed
@github-actions
Copy link
Copy Markdown

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 0.62
adds_updates_deletes 60000 60000 60000 3.18
deletes_only 0 60000 0 1.57
updates_only 0 0 60000 1.96

@github-actions
Copy link
Copy Markdown

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.05 1.8
batching batch sql 10000 1 0.07 1.71
batching by line sql 10000 1 0.07 1.71
blob 1 blob 200000 1 0.92 3.98 4.28
blob 2 blobs 200000 1 0.89 4.58 4.43
blob no blob 200000 1 0.87 2.82 2.79
col type datetime 200000 1 0.84 2.58 2.56
col type varchar 200000 1 0.68 3.65 3.62
config width 2 cols 200000 1 0.78 2.88 2.71
config width 32 cols 200000 1 1.93 3.09 2.87
config width 8 cols 200000 1 0.96 2.85 3.07
pk type float 200000 1 0.86 2.48 2.36
pk type int 200000 1 0.77 2.69 2.56
pk type varchar 200000 1 1.7 1.57 1.48
row count 1.6mm 1600000 1 5.79 2.92 2.81
row count 400k 400000 1 1.46 2.84 2.75
row count 800k 800000 1 2.93 2.86 2.75
secondary index four index 200000 1 3.81 1.28 1.07
secondary index no secondary 200000 1 0.89 2.78 2.76
secondary index one index 200000 1 1.13 2.58 2.35
secondary index two index 200000 1 2 1.79 1.73
sorting shuffled 1mm 1000000 0 5.06 2.79 2.64
sorting sorted 1mm 1000000 1 5.04 2.82 2.65

@github-actions
Copy link
Copy Markdown

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.18
dolt_blame_commit_filter system table 1.19
dolt_commit_ancestors_commit_filter system table 0.61
dolt_commits_commit_filter system table 1.1
dolt_diff_log_join_from_commit system table 2.65
dolt_diff_log_join_to_commit system table 2.73
dolt_diff_table_from_commit_filter system table 1.3
dolt_diff_table_to_commit_filter system table 1.24
dolt_diffs_commit_filter system table 1.06
dolt_history_commit_filter system table 1.42
dolt_log_commit_filter system table 1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prisma migrate and push does not respect specified branch in a connection string

5 participants