loopbackio / loopbackio/loopback-connector-postgresql

Doesn't scramble the where correctly

Open
#494 0 comments 0 reactions 1 assignee View on GitHub

@frbuceta is already working on this.

Since Feb 25, 2022.

bug
Dominant language
JavaScript
Stars
118
Forks
184
Avg merge
1d 22h
Merged PRs (30d)
5

Description

Steps to reproduce

A call is made in Loopback 4 but it doesn't resolve the where correctly.

curl --location -g --request GET '127.0.0.1:3000/articles?filter[include][0]=attributes&filter[limit]=25&filter[where][attributes][or][0][name]=COLECCIÓN&filter[where][attributes][or][0][value][inq][0]=MARVEL&filter[where][attributes][or][0][value][inq][1]=SUPERHÉROES'

Current Behavior

  loopback:connector:postgresql SQL: SELECT "id","name","value","article_id" FROM "public"."attributes" WHERE (("name"=$1 AND "value"=$2)) ORDER BY "id"
  loopback:connector:postgresql Parameters: ["COLECCIÓN","[object Object]"] +6s

Expected Behavior

SQL: SELECT "id","name","value","article_id" FROM "public"."attributes" WHERE (("name"=$1 AND "value" in ($2, $3))) ORDER BY "id"
Parameters: ["COLECCIÓN","MARVEL","SUPERHÉROES"] +6s

Additional information

linux x64 16.14.0
├── loopback-connector-postgresql@5.5.0

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.