Skip to content

Conversation

iBotPeaches
Copy link
Contributor

The Problem

When you use MSSQL your database driver key is sqlsrv. These keys sometimes line up with the name in sql-formatter that its using for dialect. Sometimes they do not. In the case of MSSQL users you'll get a crash viewing a query. This broke after the addition of proper dialect formatting in #1620

Error: Parse error: Unexpected "[users" at line 1 column 8.
This likely happens because you're using the default "sql" dialect.
If possible, please select a more specific dialect (like sqlite, postgresql, etc).
    at iX.createParseError (9fcadd56-8880-46d7-8…a45676313fd:99:2350)

The Solution

Much like pgsql is mapped to the sql-formatter specific naming of postgresql, we do the same for sqlsrv which is described by author as proper dialect (transactsql) here.

Auditing rest of supported Laravel DBs and we should be set now.

Provided Dialect Laravel DB Type
sqlite sqlite
mysql mysql
mariadb mariadb
postgresql pgsql
transactsql / tsql sqlsrv

now fixed :)

Screenshot 2025-09-03 at 6 14 32 PM

Meta

@taylorotwell taylorotwell merged commit dcb22ec into laravel:5.x Sep 4, 2025
18 checks passed
@iBotPeaches iBotPeaches deleted the support-mssql branch September 4, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error on query detail view (SQL Server)
2 participants