livewire-datatables icon indicating copy to clipboard operation
livewire-datatables copied to clipboard

Token unknown when using with FirebirdDatabase

Open renansteles opened this issue 3 years ago • 2 comments

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 `` on ID. Exist an way to resolve this problem?? Thanks!!

renansteles avatar May 30 '21 23:05 renansteles

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.

marksalmon avatar Jul 03 '21 22:07 marksalmon

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'), );

IlhamriSKY avatar Nov 23 '21 05:11 IlhamriSKY