MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 258 forks source link

Token unknown when using with FirebirdDatabase #199

Open renansteles opened 3 years ago

renansteles commented 3 years ago

Hi! Congratulations for the package! I'm trying to use the package with firebird database and having this problem

SQLSTATE[HY000]: General error: -104 Dynamic SQL Error SQL error code = -104 Token unknown - line 1, column 176 (SQL: select "CLIENT"."ID" as "ID" , "CLIENT"."NAME" as "NAME" from "CLIENT" order by ID desc ROWS 10)`

I guess the problem is the ` onID`. Exist an way to resolve this problem?? Thanks!!

marksalmon commented 3 years ago

I'm afraid I don't know anything about firebase.

The was a PR that fixed a similar problem

if ($column->select instanceof Expression) {
    $sep_string = config('database.default') === 'pgsql' ? '"' : '`';
    return new Expression($column->select->getValue().' AS '.$sep_string.$column->name.$sep_string);
}

You could try something similar, but you would have to make a PR and test it yourself.

IlhamriSKY commented 2 years ago

Is there a more detailed explanation of this?

I have changed that line of code. but this error appears. General error: -104 Dynamic SQL Error SQL error code = -104 Token unknown - line 1

then after I tried to change the line in https://github.com/MedicOneSystems/livewire-datatables/pull/202 regarding this. Class name must be a valid object or a string this error appears.

found problem, cant get connection driver from $dbTable = config( "database.connections.". optional($this->modelInstance)->getConnectionName() .".driver", config('database.default'), );