Skip to content

Commit

Permalink
Add missing query operators for map
Browse files Browse the repository at this point in the history
  • Loading branch information
leemaguire committed Jul 1, 2024
1 parent ae469c1 commit 4e7768c
Show file tree
Hide file tree
Showing 6 changed files with 601 additions and 72 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
NEXT_RELEASE Release notes (YYYY-MM-DD)
=============================================================

### Fixed
* None

### Enhancements
* Add ability to use `managed<std::map<std::string, T>>` in type safe queries.
Supported operators are `==`, `!=`, `>`, `<`, `>=`, `<=` and `contains(const std::string&)` (for string values only).

### 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
10 changes: 9 additions & 1 deletion include/cpprealm/internal/bridge/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ namespace realm::internal::bridge {

query equal(const std::optional<obj>&) const;
query not_equal(const std::optional<obj>&) const;

private:
std::shared_ptr<Subexpr> m_subexpr;
};
Expand Down Expand Up @@ -232,6 +231,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 4e7768c

Please sign in to comment.