Skip to content

Commit

Permalink
RCPP-82 Add missing query operators for managed<std::map<std::string,…
Browse files Browse the repository at this point in the history
… T>> (#225)
  • Loading branch information
leemaguire authored Jul 4, 2024
1 parent ae469c1 commit 1bf2799
Show file tree
Hide file tree
Showing 7 changed files with 605 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup Ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-macos-${{ matrix.xcode }}
key: ccache-macos-${{ matrix.xcode }}-disable-aligned-storage-${{ matrix.disable-aligned-storage }}-${{ matrix.configuration }}

- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Setup Ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-linux-${{ matrix.compiler.name }}-${{ matrix.compiler.version }}
key: ccache-linux-${{ matrix.compiler.name }}-${{ matrix.compiler.version }}-${{ matrix.configuration }}

- name: Setup CMake
uses: jwlawson/[email protected]
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
NEXT-RELEASE Release notes (YYYY-MM-DD)
=============================================================

### Fixed
* Using the `==` operator in a type safe query for a nullable string property would return the incorrect result when algined storage was disabled.

### Enhancements
* Add ability to use `managed<std::map<std::string, T>>` in type safe queries when comparing a value for a key. e.g.
`realm.object<MyObject>().where([](auto& o) { return o.my_map["foo_key"] == "some value"; })`
Supported operators are `==`, `!=`, `>`, `<`, `>=`, `<=` and `contains(const std::string&)`.

### Compatibility
* Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10.

### Internals
* None

2.1.0 Release notes (2024-06-27)
=============================================================

Expand Down
9 changes: 9 additions & 0 deletions include/cpprealm/internal/bridge/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ namespace realm::internal::bridge {
query& links_to(col_key column_key, const internal::bridge::obj& o);
query& not_links_to(col_key column_key, const internal::bridge::obj& o);

query& dictionary_has_value_for_key_equals(col_key column_key, const std::string& key, const mixed& value);
query& dictionary_has_value_for_key_not_equals(col_key column_key, const std::string& key, const mixed& value);
query& dictionary_has_value_for_key_greater_than(col_key column_key, const std::string& key, const mixed& value);
query& dictionary_has_value_for_key_less_than(col_key column_key, const std::string& key, const mixed& value);
query& dictionary_has_value_for_key_greater_than_equals(col_key column_key, const std::string& key, const mixed& value);
query& dictionary_has_value_for_key_less_than_equals(col_key column_key, const std::string& key, const mixed& value);
query& dictionary_contains_string_for_key(col_key column_key, const std::string& key, const std::string& value);
subexpr dictionary_link_subexpr(col_key column_key, col_key link_column_key, const std::string& key);

// Expressions
static query falsepredicate();

Expand Down
Loading

0 comments on commit 1bf2799

Please sign in to comment.