Closed saulens22 closed 1 year ago
Thanks a lot for your contribution. I will review and test it with my projects that have datatables implemented in my office soon (next days) and will give feedback / merge it.
I am still finding bugs, hope I will squash them by that time
I should note that this is a quick and dirty workaround. It should be possible to get DB connection (or at least name) from the model itself, but as far as I know there are no static methods for that.
Is https://github.com/MedicOneSystems/livewire-datatables/pull/450 possibly fixing this issue ?
@saulens22 I have fixed a few of these in my fork (not maintained just so I could get something deployable). You are welcome to take a look at those mods, may help with direction you were headed in this PR. Most of the locations it should lookup the db conn it doesn't but there was a an easy way to get it from the model which is avail most places in the code.
When using non-default connection model, sort expression is still derived from default connection.
In my project, I use MySQL as default connection and SQLSRV as model connection. Sort queries always fail with
Incorrect syntax near '`'.
This PR is supposed to fix this problem. It might be possible that
DB::raw()
calls might be affected by similar problems, I will look into it.