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

feat: introduce EntityFilter class with support for and/or filters #1061

Merged
merged 42 commits into from
Mar 8, 2023

Commits on Jan 13, 2023

  1. or filters interface

    danieljbruce committed Jan 13, 2023
    Configuration menu
    Copy the full SHA
    d370b54 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2023

  1. Configuration menu
    Copy the full SHA
    3291df8 View commit details
    Browse the repository at this point in the history
  2. Remove duplicate code

    danieljbruce committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    69390d4 View commit details
    Browse the repository at this point in the history
  3. Parse with type guard

    danieljbruce committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    c90e932 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c2b29fc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    69f1cbf View commit details
    Browse the repository at this point in the history
  6. test add filter

    danieljbruce committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    3f720c0 View commit details
    Browse the repository at this point in the history
  7. Add another unit test

    danieljbruce committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    20f616b View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2023

  1. Add system-test stubs

    danieljbruce committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    5dea24a View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2023

  1. Configuration menu
    Copy the full SHA
    bb931e7 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2023

  1. Move things around

    danieljbruce committed Jan 19, 2023
    Configuration menu
    Copy the full SHA
    44be8a9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0055a09 View commit details
    Browse the repository at this point in the history
  3. Added a unit test

    danieljbruce committed Jan 19, 2023
    Configuration menu
    Copy the full SHA
    b6bb3b3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    83668a1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c4fe304 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2023

  1. Just use filter method

    danieljbruce committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    c397608 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2023

  1. new warning test

    danieljbruce committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    37400a6 View commit details
    Browse the repository at this point in the history
  2. Revert "new warning test"

    This reverts commit 37400a6.
    danieljbruce committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    8ab6b80 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2023

  1. Configuration menu
    Copy the full SHA
    db02a50 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bc15f32 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2023

  1. Add setAncestor

    Adds a new setAncestor method for ensuring only one ancestor is set for the query at a time. This will avoid errors that result because of setting multiple ancestors. Also deprecate hasAncestor because it will lead to warnings like this. Add parser logic to use the value provided in setAncestor for query sent to backend.
    danieljbruce committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    e84582f View commit details
    Browse the repository at this point in the history
  2. Basic unit tests for setAncestor

    Added tests for the query proto, one to make sure the query structure is right when setting ancestor once and one to make sure the query structure is right when setting ancestor twice. Also added a unit test to make sure that ancestor is set the right way internally when using setAncestor.
    danieljbruce committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    86841d6 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2023

  1. change expected result for OR query

    This code change adjusts the expected result for running an OR query. Old result used to correspond with AND, but now corresponds to OR.
    danieljbruce committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    fe50d56 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2023

  1. Fix a test by not requiring the done callback

    A test is timing out because we are waiting for done to be called. This fix does not require done to be called.
    danieljbruce committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    1159b37 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2023

  1. Configuration menu
    Copy the full SHA
    49ffcf9 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2023

  1. Merge branch 'main' of https://github.com/googleapis/nodejs-datastore

    …into or-filters
    
    # Conflicts:
    #	src/query.ts
    #	test/query.ts
    danieljbruce committed Feb 24, 2023
    Configuration menu
    Copy the full SHA
    3aa7a35 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2023

  1. Revert "Fix a test by not requiring the done callback"

    This reverts commit 1159b37.
    danieljbruce committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    a7a8d27 View commit details
    Browse the repository at this point in the history
  2. Revert "Basic unit tests for setAncestor"

    This reverts commit 86841d6.
    danieljbruce committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    1c77b6c View commit details
    Browse the repository at this point in the history
  3. Revert "Add setAncestor"

    This reverts commit e84582f.
    danieljbruce committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    5f38179 View commit details
    Browse the repository at this point in the history
  4. Separate filters and new filters internally

    This commit is done to avoid a breaking typescript change which could have the potential to affect some users who read `filters` on a query as its type had been changed to be more flexible, but is now back to what it was.
    danieljbruce committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    059d4dc View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2023

  1. Move AND/OR into their own separate function

    AND and OR should not be static functions of the filter class because then the user has to type Filter.AND instead of AND for example.
    danieljbruce committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    ec752e8 View commit details
    Browse the repository at this point in the history
  2. Eliminate unused imports

    Artifacts of having imports laying around and moving functionality between files
    danieljbruce committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    a5c41ab View commit details
    Browse the repository at this point in the history
  3. Revert "Add a test for new warning"

    This reverts commit bc15f32.
    danieljbruce committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    1ddeea6 View commit details
    Browse the repository at this point in the history
  4. Revert "Now removes deprecation warning properly"

    This reverts commit db02a50.
    danieljbruce committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    8e96bf5 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2023

  1. Modify test cases to capture nuances in data

    We add additional asserts to the data in order to capture the nuances of the composite operator. For example, for the OR test we make sure the filter doesn’t always require both conditions to be true.
    danieljbruce committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    5883096 View commit details
    Browse the repository at this point in the history
  2. Added comments to code that was refactored

    Code for building the `filter` property of the query proto was pulled into the `Filter` object. Comments indicate how legacy functionality was maintained and which lines of code perform which task.
    danieljbruce committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    0a68ed1 View commit details
    Browse the repository at this point in the history
  3. rename NewFilter to entity filter

    rename new filter to entity filter to eliminate the need for an internal rename that causes confusion
    danieljbruce committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    35bae06 View commit details
    Browse the repository at this point in the history
  4. Switch around last and first

    These test cases have mistakes in their names. We should change them to reflect the position of `hasAncestor`.
    danieljbruce committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    262894a View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2023

  1. Change the comment to reflect the new name

    The name of the base class is now EntityFilter. Adjust this comment so that it correctly matches the parameter type.
    danieljbruce committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    30c3832 View commit details
    Browse the repository at this point in the history
  2. rename and move constant map up

    rename composite filter functions so that they don’t look like constants and move a map up so that it doesn’t have to be initialized every time.
    danieljbruce committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    fa2235d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4e7f9d5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c72fcc9 View commit details
    Browse the repository at this point in the history