MedicOneSystems / MedicOneSystems/livewire-datatables
searchable doesn't work with numeric columns
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
Laravel 8
posgre
any way to use searchable() method with numeric columns??
when I use like this it throws exception
NumberColumn::name('id')
->label('ID')
->searchable()
->defaultSort('desc')
->sortBy('id'),
SQLSTATE[42883]: Undefined function: 7 ERROR: function lower(bigint) does not exist LINE 1: ...ount(*) as aggregate from "mytable" where (((LOWER(mytab... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. (SQL: select count(*) as aggregate from "mytable" where (((LOWER(mytable.id) like %5%))))
any solution?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Reproduce the NumberColumn::name('id')->searchable() case on Laravel 8 with PostgreSQL, then trace the query-building path that produces LOWER(id). Done means numeric-column searches no longer apply LOWER to bigint and the generated query succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php, postgresql
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100