MedicOneSystems / MedicOneSystems/livewire-datatables

searchable doesn't work with numeric columns

Open
#371 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.