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

Markduckworth/or queries #6694

Merged
merged 13 commits into from
Nov 22, 2022
Merged

Markduckworth/or queries #6694

merged 13 commits into from
Nov 22, 2022

Conversation

MarkDuckworth
Copy link
Contributor

@MarkDuckworth MarkDuckworth commented Oct 13, 2022

This is the implementation of Firestore OR Queries without the public API. The public API will be released later.

Several minor API changes are included in this release: Functions in the Firestore package that return QueryConstraints (for example: where(...), limit(...), and orderBy(...)) now return a more specific type, which extends QueryConstraint. This is a non-breaking change that will support OR Queries.

Minor version bumps are included for Firebase and @firebase/firestore.

@changeset-bot
Copy link

changeset-bot bot commented Oct 13, 2022

🦋 Changeset detected

Latest commit: 95679e3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Minor
firebase Minor
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 13, 2022

Size Report 1

Affected Products

  • @firebase/database

    TypeBase (a9add5e)Merge (2843522)Diff
    browser248 kB247 kB-763 B (-0.3%)
    esm5276 kB275 kB-802 B (-0.3%)
    main281 kB281 kB-802 B (-0.3%)
    module248 kB247 kB-763 B (-0.3%)
  • @firebase/database-compat/standalone

    TypeBase (a9add5e)Merge (2843522)Diff
    main370 kB369 kB-802 B (-0.2%)
  • @firebase/firestore

    TypeBase (a9add5e)Merge (2843522)Diff
    browser266 kB272 kB+6.32 kB (+2.4%)
    esm5330 kB339 kB+9.03 kB (+2.7%)
    main531 kB545 kB+13.7 kB (+2.6%)
    module266 kB272 kB+6.32 kB (+2.4%)
    react-native266 kB272 kB+6.32 kB (+2.4%)
  • @firebase/firestore-compat

    TypeBase (a9add5e)Merge (2843522)Diff
    esm527.6 kB27.6 kB+49 B (+0.2%)
  • @firebase/firestore-lite

    TypeBase (a9add5e)Merge (2843522)Diff
    browser82.4 kB85.9 kB+3.46 kB (+4.2%)
    esm598.6 kB104 kB+5.12 kB (+5.2%)
    main139 kB146 kB+6.96 kB (+5.0%)
    module82.4 kB85.9 kB+3.46 kB (+4.2%)
    react-native82.6 kB86.1 kB+3.46 kB (+4.2%)
  • bundle

    21 size changes

    TypeBase (a9add5e)Merge (2843522)Diff
    database (Append to a list of data)148 kB148 kB+103 B (+0.1%)
    database (Filtering data)147 kB147 kB+103 B (+0.1%)
    database (Listen for child events)163 kB163 kB+551 B (+0.3%)
    database (Listen for value events + Detach listeners)163 kB163 kB+551 B (+0.3%)
    database (Listen for value events)163 kB163 kB+551 B (+0.3%)
    database (Read data once)162 kB163 kB+551 B (+0.3%)
    database (Save data as transactions)165 kB165 kB+551 B (+0.3%)
    database (Sort data)148 kB148 kB+103 B (+0.1%)
    database (Write data)147 kB147 kB+103 B (+0.1%)
    firestore (Persistence)276 kB281 kB+4.22 kB (+1.5%)
    firestore (Query Cursors)213 kB220 kB+6.55 kB (+3.1%)
    firestore (Query)214 kB217 kB+3.23 kB (+1.5%)
    firestore (Read data once)202 kB204 kB+1.87 kB (+0.9%)
    firestore (Realtime updates)205 kB207 kB+1.87 kB (+0.9%)
    firestore (Transaction)186 kB188 kB+1.67 kB (+0.9%)
    firestore (Write data)186 kB188 kB+1.67 kB (+0.9%)
    firestore-lite (Query Cursors)71.5 kB81.0 kB+9.47 kB (+13.2%)
    firestore-lite (Query)74.7 kB77.2 kB+2.43 kB (+3.3%)
    firestore-lite (Read data once)59.1 kB59.1 kB+7 B (+0.0%)
    firestore-lite (Transaction)83.7 kB83.7 kB+7 B (+0.0%)
    firestore-lite (Write data)68.9 kB68.9 kB+7 B (+0.0%)

  • firebase

    TypeBase (a9add5e)Merge (2843522)Diff
    firebase-compat.js740 kB746 kB+5.41 kB (+0.7%)
    firebase-database-compat.js166 kB165 kB-217 B (-0.1%)
    firebase-database.js154 kB154 kB-236 B (-0.2%)
    firebase-firestore-compat.js314 kB319 kB+5.62 kB (+1.8%)
    firebase-firestore-lite.js89.1 kB92.6 kB+3.42 kB (+3.8%)
    firebase-firestore.js314 kB321 kB+6.27 kB (+2.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/PVPimB35jl.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 13, 2022

Size Analysis Report 1

This report is too large (800,230 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/2bjRBehYQO.html

MarkDuckworth and others added 8 commits October 26, 2022 09:22
* Add composite filters. Port of firebase/firebase-android-sdk#3290

* Support encoding and decoding Composite Filters

* Perform DNF transform

* Use client-side index if we have composite filters

* Update the orderBy filtering mechanism for OR queries and steps to serve OR queries from client-side index.

* Update protos with OR operator.

* Add compile.sh to compile proto updates.

* Update stringifyFilter to support CompositeFilters
#6557)

* Refactor core/target.ts, extracting classes Bound, OrderBy, and Filter (+subclasses)
…can be passed to or(...) and and(...). (#6559)

Making public API changes to ensure that only QueryFilterConstraints can be passed to or(...) and and(...).
* OR Query Public API
* In operator expansion
* Collapsing duplicate tests that covered with and without client side indexing into one test case that executes with both configurations.

* Additional validation and additional validation tests for where(..), and(...), and or(...).

* Tagging all new OR Query API members as internal until server support is offered.

* Constrained the parameters of the query() function implementation. It's still compatible with the overload signatures, but the constrained parameters simplifies the implementation.
…e new way of skipping tests when persistence is not available.
@MarkDuckworth
Copy link
Contributor Author

@ehsannas, @hsubox76, Here's a large PR that has all of the client side changes needed to support OR queries. It was tested against the emulator. @ehsannas has reviewed all incremental changes as they were merged into this feature branch, so I'm not asking for full review of the changes. Areas that might be worth another review are: .md files, (lack of) changeset file, and package.json.

@MarkDuckworth MarkDuckworth merged commit fde5adf into master Nov 22, 2022
@MarkDuckworth MarkDuckworth deleted the markduckworth/or-queries branch November 22, 2022 21:58
@google-oss-bot google-oss-bot mentioned this pull request Dec 6, 2022
levino pushed a commit to levino/firebase-js-sdk that referenced this pull request Dec 10, 2022
Implementation of Firestore OR Queries without the public API. The public API will be released later.

Several minor API changes are included in this release: Functions in the Firestore package that return QueryConstraints (for example: where(...), limit(...), and orderBy(...)) now return a more specific type, which extends QueryConstraint. This is a non-breaking change that will support OR Queries.
@firebase firebase locked and limited conversation to collaborators Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants