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

RCPP-82 Add missing query operators for managed<std::map<std::string, T>> #225

Merged
merged 7 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
* None

### 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
Loading