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 with object value - support Mysql and Postgres #508

Merged
merged 3 commits into from
Feb 11, 2024

Conversation

Idokah
Copy link
Collaborator

@Idokah Idokah commented Feb 4, 2024

today, we are allowing querying nested fields, but not full objects - i.e.
this wouldn't work:
{fieldName: { $eq: {someKey: "a"}}}
this is working:
{fieldName.someKey: { $eq: "a"}}

we need to support it in order to support filtering encrypted fields (and filtering any other object field and find by value that is an object)

@Idokah Idokah changed the title allow query full object mysql Query with object value Feb 4, 2024
@Idokah Idokah changed the title Query with object value Query with object value - support Mysql and Postgres Feb 4, 2024
@Idokah Idokah requested review from MXPOL and guyrotem February 4, 2024 13:44
@@ -19,6 +19,8 @@ export default class DataProvider implements IDataProvider {
const { sortExpr } = this.filterParser.orderBy(sort)
const projectionExpr = this.filterParser.selectFieldsFor(projection)
const sql = `SELECT ${projectionExpr} FROM ${escapeIdentifier(collectionName)} ${filterExpr} ${sortExpr} OFFSET $${offset} LIMIT $${offset + 1}`
console.log({ sqlExpression: sql, parameters: [...parameters, skip, limit] })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it pls

@Idokah Idokah merged commit 24d6168 into master Feb 11, 2024
17 checks passed
@Idokah Idokah deleted the query-full-objects branch February 11, 2024 12:42
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

Successfully merging this pull request may close these issues.

2 participants