Open saulens22 opened 2 years ago
When using PostgreSQL there is the same error:
SQLSTATE[42703]: Undefined column: 7 ERROR: column "checkbox_attribute" does not exist
In the src/Http/Livewire/LivewireDatatables.php
i fixed it with some very dirty code to make it work...
return $query->whereRaw(explode(' ', $query->columns[0])[0] . ' IN (' . implode(',', $this->selected) . ')');
Using
SQLSRV
model and trying to export selected records to any format I get the following error:SQLSTATE[42S22]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'checkbox_attribute'.
Generated query (simplified):
As I found out,
SQLSRV
has a bit different order of operations, so it doesn't know aboutcheckbox_attribute
alias:Quick and dirty workaround would be to wrap query into subquery like this:
I'm not sure how to deal with it in simplified way as it would require maintaining different code for different DB engines. Anyway, I'm open to do the testing.