aarondfrancis / fast-paginate

A fast implementation of offset/limit pagination for Laravel.
MIT License
1.21k stars 56 forks source link

Error with UUID Column in Notifications Column #17

Closed seanfoushee closed 2 years ago

seanfoushee commented 2 years ago

I have a new issue now that #16 solved the orderBy error. When utilizing fastPaginate with a table using a UUID column the sub query fails:

production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column '53b79b97' in 'where clause' (SQL: select * from notifications where notifications.notifiable_type = App\Models\User and notifications.notifiable_id = 3 and notifications.notifiable_id is not null and notifications.id in (53b79b97-d794-4260-9b74-c4e78d01d870) order by created_at desc limit 11 offset 0)

Note the column the query is attempting to read is the first part of the UUID in the notifications table. I assume escaping the ids in the case they're not integers would be the solution.

aarondfrancis commented 2 years ago

@seanfoushee ah, good call. Can you check #18 and see if that works for you?

seanfoushee commented 2 years ago

@aarondfrancis that fixed it! Thanks.

aarondfrancis commented 2 years ago

Great! Published v0.1.5