Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

EloquentQueryProvider

Open Chumper opened this issue 10 years ago • 3 comments

We should have a replacement ready for the old QueryEngine, so a user can pass a query builder or similar to the datatable.

What i found was really 'annoying' was the small little details i had to put into the old QueryEngine to make the search work across different databases.

So i would like to include search functionality behaviour as method on this provider so the user can implement it as needed.

I also see a problem if the user pre selected any data and then passes it to the EloquentQueryProvider. E.g. if a user passes all users sorted by name to the datatable but skips the first 10 we have a problem, because the initial dataset can change.

So when a user orders by id (and the user skips the first 10 and passes it to the provider) then there is a changed dataset where different 10 users are missing.

Also should we override the skip and take parameter of the user?

Chumper avatar Oct 30 '15 07:10 Chumper

We should consider allowing a maximum value for skip and limit.

For example, I don't want users to be able to export all of my data by just having them provide me with a $largeNumber for the take parameter.

But I don't think this needs to be handled in the QueryProvider, I think this should be done somewhere else, that way the providers don't need to worry about handling minimum and maximum parameters, it happens somewhere in a level above.

timgws avatar Mar 02 '16 09:03 timgws

Are you specifically talking about https://github.com/Chumper/Datatable/pull/267?

I also see a problem if the user pre selected any data and then passes it to the EloquentQueryProvider.

E.g. if a user passes all users sorted by name to the datatable but skips the first 10 we have a problem, because the initial dataset can change.

I don't see that as a bug - I see that as a feature :) By definition, if you are doing filtering & ordering, the datatable should represent what is in the database. If that means unexpectedly showing and hiding different rows from users, then so be it :)

I am sure if it's a problem that we will hear about it.

timgws avatar Feb 06 '17 02:02 timgws

I was not talking about any issue specifically, that was just my impression when working on the old 'QueryEngine`.

Sounds good, I think with the current eloquent there should be quite some possibilities.

Chumper avatar Feb 06 '17 09:02 Chumper