MedicOneSystems / MedicOneSystems/livewire-datatables

SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near '`'.

Open
#344 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

hello, I'm using sql server on my project

In LivewireDatatable.php, I changed
$sep_string = config('database.default') === 'pgsql' ? '"' : '`';
with
$sep_string = config('database.default') === 'pgsql' ? '"' : "'";

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in LivewireDatatable.php at the $sep_string assignment and reproduce the reported SQL Server syntax error using the database configuration described in the issue. Compare the identifier quoting used for PostgreSQL and SQL Server, then verify that the resulting datatable query no longer fails near the backtick without regressing the existing database behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php, sql
Domain
backend, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.