Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Telescope #950

Open
elvispdosreis opened this issue Jun 12, 2024 · 0 comments
Open

Query Telescope #950

elvispdosreis opened this issue Jun 12, 2024 · 0 comments

Comments

@elvispdosreis
Copy link

elvispdosreis commented Jun 12, 2024

the query was completely different and complex, despite bringing the result

query telescope

{
 "filter": 
  {
   "cidade.id": "3549805",
   "nome": "santa"
  }
}
select
  "id",
  "nome",
  "cidade_id",
  "bairro_id"
from
  "geral"."logradouros"
where
  LOWER("geral"."logradouros"."nome") LIKE ? ESCAPE '\' and exists (select * from "geral"."cidades" where "geral"."logradouros"."cidade_id" = "geral"."cidades"."id" and "geral"."cidades"."id" = ' % santa % ') and "geral"."logradouros"."deleted_at" is null order by "geral"."logradouros"."id" asc limit 51
 public function index(): JsonResponse
    {
        $logradouro = Logradouro::select(['id', 'nome', 'cidade_id', 'bairro_id']);
        $logradouro = QueryBuilder::for($logradouro);
        $logradouro->allowedFilters(
            AllowedFilter::exact('id'),
            AllowedFilter::partial('nome', null, false),
            AllowedFilter::exact('cidade.id'),
            AllowedFilter::exact('bairro.id'),
            AllowedFilter::scope('keyword'),
        );

        return response()->json($logradouro->cursorPaginate(50)->withQueryString());
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant