laravel4-datatables-package icon indicating copy to clipboard operation
laravel4-datatables-package copied to clipboard

Multiple Database compatibility

Open CaptainThunk opened this issue 11 years ago • 4 comments

Package uses numerous DB::Raw() statements through datatables.php, this causes incompatibility with sites with more than one defined database. They should be DB::Connection($dbkey)->Raw() Where $dbkey is the defined name of the database.

This is sometimes done, as in the count() function, although there's still a DB::Raw statement that needs to be rectified.

CaptainThunk avatar Oct 21 '14 18:10 CaptainThunk

I'm using multiple databases and raw without issue. Wouldn't raw just be returning a raw query anyways, and thus connection agnostic?

nesl247 avatar Nov 03 '14 14:11 nesl247

For me, I have 4 defined mysql databases, as it stands this plugin breaks because places in it where DB:Raw is used it looks for the default database (called 'mysql') which is not defined in my setup. When it's not specified, it falls back to the default.

CaptainThunk avatar Nov 03 '14 14:11 CaptainThunk

Why not just change the default? Not disagreeing with any changes that need to be done, just offering an option.

nesl247 avatar Nov 03 '14 14:11 nesl247

Because it could be one of the four databases used, none of them are 'default'.

CaptainThunk avatar Nov 03 '14 15:11 CaptainThunk