1515from .profiles import profile_for_url , validate_connection_url
1616from ..core import UnsupportedOperationError
1717
18- SPECIFICATION_COMMIT = "e94ae8349d2b0dffe0c65e820b4b22b8c074b7b5"
19- SPECIFICATION_RELEASE : str | None = None
18+ SPECIFICATION_COMMIT = "d287c2cde9ade71f04e27dd012caec876901aed5"
19+ SPECIFICATION_RELEASE : str | None = "v0.1.0"
20+
21+ _DOLT_2_2_STABLE_VERSION = re .compile (r"2\.2\.(0|[1-9][0-9]*)" )
2022
2123SERVER_POLICIES = {
2224 "sqlite" : {
2830 "ci" : ["MySQL 8.4.11" , "MySQL 9.7.2" ],
2931 },
3032 "dolt" : {
31- "claimed" : ["Dolt 2.2.2" ],
32- "ci" : ["Dolt 2.2.2" ],
33+ "claimed" : ["Dolt 2.2.x" ],
34+ "range" : {
35+ "minimum_inclusive" : "2.2.2" ,
36+ "maximum_exclusive" : "2.3.0" ,
37+ },
38+ "ci" : ["Dolt 2.2.2" , "Dolt 2.2.3" ],
39+ "exact_ci" : ["2.2.2" , "2.2.3" ],
3340 },
3441 "mariadb" : {
3542 "claimed" : ["MariaDB 11.4.x" , "MariaDB 11.8.x" , "MariaDB 12.3.x" ],
@@ -115,9 +122,10 @@ def active_connection(database_url: str) -> dict[str, Any]:
115122 raw_product_version = _required_text_probe (
116123 connection , "select DOLT_VERSION()" , "DOLT_VERSION()" ,
117124 )
118- if raw_product_version . strip () != "2.2.2" :
125+ if not _dolt_version_supported ( raw_product_version ) :
119126 raise UnsupportedOperationError (
120- "The active Dolt product version must be exactly 2.2.2."
127+ "The active Dolt product version must be a canonical stable "
128+ "release in the supported range >=2.2.2,<2.3.0."
121129 )
122130 identity_source = "SELECT @@version, @@version_comment, DOLT_VERSION()"
123131 elif "mariadb" in identity_text :
@@ -153,7 +161,11 @@ def active_connection(database_url: str) -> dict[str, Any]:
153161 "profile" : profile_name ,
154162 "engine" : profile_name ,
155163 "product" : profile_name ,
156- "transport" : "mysql" if dialect in {"mysql" , "mariadb" } else dialect ,
164+ "transport" : (
165+ "mysql_compatible" if profile_name == "dolt"
166+ else "mysql" if dialect in {"mysql" , "mariadb" }
167+ else dialect
168+ ),
157169 "driver" : engine .dialect .driver ,
158170 "server_version" : _normalized_version (profile_name , raw_product_version ),
159171 "raw_server_version" : raw_product_version ,
@@ -325,13 +337,18 @@ def _profile(
325337 "profile" : name ,
326338 "engine" : name ,
327339 "dialect" : "mysql" if name == "dolt" else name ,
328- "transport" : "mysql " if name == "dolt" else name ,
340+ "transport" : "mysql_compatible " if name == "dolt" else name ,
329341 "specification_commit" : SPECIFICATION_COMMIT ,
330- "specification_status" : "release_candidate " ,
342+ "specification_status" : "released " ,
331343 "specification_release" : SPECIFICATION_RELEASE ,
332344 "driver" : "psycopg" if name == "postgresql" else "PyMySQL" if name in {"mysql" , "mariadb" , "dolt" } else "sqlite3" ,
333345 "claimed_server_versions" : policy ["claimed" ],
346+ "claimed_version_range" : policy .get ("range" ),
334347 "ci_tested_server_versions" : policy ["ci" ],
348+ ** (
349+ {"exact_ci_tested_versions" : policy ["exact_ci" ]}
350+ if "exact_ci" in policy else {}
351+ ),
335352 "theoretical_limits" : theoretical ,
336353 "proposed_adapter_limits" : proposed ,
337354 "observed_limits" : observed_limits ,
@@ -391,7 +408,7 @@ def _profile(
391408
392409def server_version_supported (profile : str , raw_version : str ) -> bool :
393410 if profile == "dolt" :
394- return raw_version . strip () == "2.2.2"
411+ return _dolt_version_supported ( raw_version )
395412 version = _version_tuple (raw_version )
396413 if profile == "sqlite" :
397414 return (3 , 24 ) <= version [:2 ] < (4 , 0 )
@@ -404,6 +421,12 @@ def server_version_supported(profile: str, raw_version: str) -> bool:
404421 return version [:width ] in allowed
405422
406423
424+ def _dolt_version_supported (raw_version : str ) -> bool :
425+ """Accept only canonical stable Dolt 2.2 patches at or above 2.2.2."""
426+ match = _DOLT_2_2_STABLE_VERSION .fullmatch (raw_version .strip ())
427+ return match is not None and match .group (1 ) not in {"0" , "1" }
428+
429+
407430def _matched_claim (profile : str , raw_version : str ) -> str | None :
408431 if not server_version_supported (profile , raw_version ):
409432 return None
0 commit comments