Skip to content

OR Query Implementation #1453

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

Merged
merged 30 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cbe1932
OR Query Implementation
tom-andersen May 29, 2023
e2623f6
Pretty
tom-andersen May 29, 2023
aa2a045
Add includes
tom-andersen Jun 13, 2023
516ff39
Fix from PR feedback
tom-andersen Jun 13, 2023
f858b7b
Fix variadic parameters
tom-andersen Jun 15, 2023
9a0f88a
Add and fix tests
tom-andersen Jun 16, 2023
fd4e5dd
Add/fix method descriptions.
tom-andersen Jun 19, 2023
602a463
Add/fix constructor and class descriptions.
tom-andersen Jun 19, 2023
959f53b
Add method description to disjunction/conjunction.
tom-andersen Jun 19, 2023
0f3e62f
Add tests. Revealed bugs to be fixed.
tom-andersen Jun 20, 2023
95b2a8c
Fix type
tom-andersen Jun 20, 2023
787ec3c
Add test
tom-andersen Jun 20, 2023
56f15c2
Android implementation
tom-andersen Jun 22, 2023
1a6d116
Pretty
tom-andersen Jun 22, 2023
a26cf80
Pretty
tom-andersen Jun 22, 2023
62fcf27
Pretty
tom-andersen Jun 22, 2023
bc3cba0
Remove const
tom-andersen Jun 22, 2023
fe5b6e8
Pretty
tom-andersen Jun 22, 2023
a232d50
Fixes from code review
tom-andersen Jun 28, 2023
1c71573
Merge branch 'main' into tomandersen/or_query
tom-andersen Jun 28, 2023
d6961a7
Release notes
tom-andersen Jun 29, 2023
678262c
Merge branch 'main' into tomandersen/or_query
tom-andersen Jun 29, 2023
6f3fc73
Release notes
tom-andersen Jun 29, 2023
a43892b
Merge remote-tracking branch 'origin/main' into tomandersen/or_query
tom-andersen Jul 17, 2023
bfa8e5e
Merge remote-tracking branch 'origin/main' into tomandersen/or_query
tom-andersen Sep 18, 2023
156ea40
Fix Android OR Query
tom-andersen Sep 21, 2023
ab93d43
Release notes.
tom-andersen Sep 21, 2023
a81a803
Merge remote-tracking branch 'origin/main' into tomandersen/or_query
tom-andersen Sep 21, 2023
bda2909
Fix release notes.
tom-andersen Sep 21, 2023
d7555da
Format
tom-andersen Sep 21, 2023
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
1 change: 1 addition & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ if (IOS)
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/document_snapshot.h
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/field_path.h
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/field_value.h
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/filter.h
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/listener_registration.h
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/load_bundle_task_progress.h
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/map_field_value.h
Expand Down
9 changes: 9 additions & 0 deletions firestore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set(common_SRCS
src/common/document_snapshot.cc
src/common/exception_common.cc
src/common/exception_common.h
src/common/filter.cc
src/common/field_path.cc
src/common/field_value.cc
src/common/firestore.cc
Expand Down Expand Up @@ -97,6 +98,8 @@ set(android_SRCS
src/android/field_path_portable.h
src/android/field_value_android.cc
src/android/field_value_android.h
src/android/filter_android.cc
src/android/filter_android.h
src/android/firestore_android.cc
src/android/firestore_android.h
src/android/firestore_exceptions_android.h
Expand Down Expand Up @@ -201,13 +204,17 @@ set(main_SRCS
src/main/aggregate_query_snapshot_main.h
src/main/collection_reference_main.cc
src/main/collection_reference_main.h
src/main/composite_filter_main.cc
src/main/composite_filter_main.h
src/main/converter_main.h
src/main/document_change_main.cc
src/main/document_change_main.h
src/main/document_reference_main.cc
src/main/document_reference_main.h
src/main/document_snapshot_main.cc
src/main/document_snapshot_main.h
src/main/filter_main.cc
src/main/filter_main.h
src/main/field_value_main.cc
src/main/field_value_main.h
src/main/firestore_main.cc
Expand All @@ -227,6 +234,8 @@ set(main_SRCS
src/main/transaction_main.h
src/main/user_data_converter_main.cc
src/main/user_data_converter_main.h
src/main/unary_filter_main.cc
src/main/unary_filter_main.h
src/main/util_main.h
src/main/write_batch_main.cc
src/main/write_batch_main.h)
Expand Down
2 changes: 2 additions & 0 deletions firestore/integration_test_internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ set(FIREBASE_INTEGRATION_TEST_PORTABLE_TEST_SRCS
# public API are performed.
src/integration_test.cc
# Internal tests below.
src/aggregate_count_test.cc
src/aggregate_query_snapshot_test.cc
src/aggregate_query_test.cc
src/bundle_test.cc
Expand All @@ -99,6 +100,7 @@ set(FIREBASE_INTEGRATION_TEST_PORTABLE_TEST_SRCS
src/document_change_test.cc
src/document_reference_test.cc
src/document_snapshot_test.cc
src/filter_test.cc
src/field_value_test.cc
src/fields_test.cc
src/firestore_test.cc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
12CCF1E928FDBD9F00C24941 /* set_options_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12CCF1DF28FDBD9F00C24941 /* set_options_test.cc */; };
12D513142684C8C200A83FAA /* bundle_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12D513132684C8C200A83FAA /* bundle_test.cc */; };
12D5131A2684C8D100A83FAA /* bundle_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12D513182684C8D100A83FAA /* bundle_builder.cc */; };
1BAFACA32A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */; };
1BAFACA42A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */; };
1BAFACA52A449C2B00834979 /* aggregate_count_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */; };
1BAFACA62A449C2B00834979 /* aggregate_count_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */; };
1BAFACA72A449C2B00834979 /* aggregate_query_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */; };
1BAFACA82A449C2B00834979 /* aggregate_query_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */; };
1BAFACAA2A449CBD00834979 /* filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA92A449CBD00834979 /* filter_test.cc */; };
1BAFACAB2A449CBD00834979 /* filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA92A449CBD00834979 /* filter_test.cc */; };
520BC0391C869159008CFBC3 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 520BC0381C869159008CFBC3 /* GoogleService-Info.plist */; };
5270BB448DF5ECE860FDD68B /* firebase_firestore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAFAF9474EC412ADCC65F2CC /* firebase_firestore.framework */; };
529226D61C85F68000C89379 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 529226D51C85F68000C89379 /* Foundation.framework */; };
Expand Down Expand Up @@ -123,6 +131,10 @@
12D513182684C8D100A83FAA /* bundle_builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bundle_builder.cc; path = src/util/bundle_builder.cc; sourceTree = "<group>"; };
12D513192684C8D100A83FAA /* bundle_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bundle_builder.h; path = src/util/bundle_builder.h; sourceTree = "<group>"; };
1B3D64B35A22073C76B376D5 /* libPods-integration_test_tvos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-integration_test_tvos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_query_snapshot_test.cc; path = src/aggregate_query_snapshot_test.cc; sourceTree = "<group>"; };
1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_count_test.cc; path = src/aggregate_count_test.cc; sourceTree = "<group>"; };
1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_query_test.cc; path = src/aggregate_query_test.cc; sourceTree = "<group>"; };
1BAFACA92A449CBD00834979 /* filter_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = filter_test.cc; path = src/filter_test.cc; sourceTree = "<group>"; };
3DE393E827F88B06CD3C39CD /* Pods-integration_test_tvos.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-integration_test_tvos.release.xcconfig"; path = "Target Support Files/Pods-integration_test_tvos/Pods-integration_test_tvos.release.xcconfig"; sourceTree = "<group>"; };
4AAFA3E3DA9641C2E3C46C9D /* Pods_integration_test.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_integration_test.framework; sourceTree = BUILT_PRODUCTS_DIR; };
520BC0381C869159008CFBC3 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -281,6 +293,10 @@
5292271D1C85FB5500C89379 /* src */ = {
isa = PBXGroup;
children = (
1BAFACA92A449CBD00834979 /* filter_test.cc */,
1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */,
1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */,
1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */,
12CCF1DF28FDBD9F00C24941 /* set_options_test.cc */,
12CCF1DB28FDBD9E00C24941 /* settings_test.cc */,
12CCF1DC28FDBD9F00C24941 /* source_test.cc */,
Expand Down Expand Up @@ -576,12 +592,14 @@
D62CCBC022F367140099BE9F /* gmock-all.cc in Sources */,
D61CFBC126091C3B0035CB2A /* integration_test.cc in Sources */,
D6AAAD532606C22D0025C53B /* includes_test.cc in Sources */,
1BAFACA52A449C2B00834979 /* aggregate_count_test.cc in Sources */,
D6AAAD502606C22D0025C53B /* numeric_transforms_test.cc in Sources */,
D6ED33BE2606CD890058CBF9 /* integration_test_util.cc in Sources */,
D6C179EA22CB322900C2651A /* ios_firebase_test_framework.mm in Sources */,
12CCF1E228FDBD9F00C24941 /* source_test.cc in Sources */,
D6AAAD4C2606C22D0025C53B /* server_timestamp_test.cc in Sources */,
D6AAAD4E2606C22D0025C53B /* firestore_test.cc in Sources */,
1BAFACAA2A449CBD00834979 /* filter_test.cc in Sources */,
D6AAAD452606C22D0025C53B /* document_change_test.cc in Sources */,
D6AAAD472606C22D0025C53B /* document_snapshot_test.cc in Sources */,
D6C179E922CB322900C2651A /* ios_app_framework.mm in Sources */,
Expand All @@ -591,7 +609,9 @@
EDEEC7632800CD0000EFBAAF /* leveldb_snappy_test.cc in Sources */,
12CCF1E828FDBD9F00C24941 /* set_options_test.cc in Sources */,
D6AAAD562606C22D0025C53B /* query_network_test.cc in Sources */,
1BAFACA72A449C2B00834979 /* aggregate_query_test.cc in Sources */,
D6AAAD552606C22D0025C53B /* listener_registration_test.cc in Sources */,
1BAFACA32A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */,
12D5131A2684C8D100A83FAA /* bundle_builder.cc in Sources */,
D6AAAD4A2606C22D0025C53B /* fields_test.cc in Sources */,
D6AAAD462606C22D0025C53B /* query_test.cc in Sources */,
Expand All @@ -610,6 +630,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1BAFACAB2A449CBD00834979 /* filter_test.cc in Sources */,
1BAFACA62A449C2B00834979 /* aggregate_count_test.cc in Sources */,
BC1D6850267B00EB005DC2DA /* app_framework.cc in Sources */,
BC1D6853267B00EB005DC2DA /* transaction_extra_test.cc in Sources */,
BC1D683E267B00EB005DC2DA /* integration_test_util.cc in Sources */,
Expand All @@ -623,6 +645,7 @@
BC1D6848267B00EB005DC2DA /* sanity_test.cc in Sources */,
12CCF1E728FDBD9F00C24941 /* write_batch_test.cc in Sources */,
12CCF1E128FDBD9F00C24941 /* settings_test.cc in Sources */,
1BAFACA82A449C2B00834979 /* aggregate_query_test.cc in Sources */,
BC1D6856267B00EE005DC2DA /* ios_app_framework.mm in Sources */,
BC1D6843267B00EB005DC2DA /* numeric_transforms_test.cc in Sources */,
BC1D6844267B00EB005DC2DA /* array_transform_test.cc in Sources */,
Expand All @@ -632,6 +655,7 @@
BC1D684E267B00EB005DC2DA /* includes_test.cc in Sources */,
BC1D684C267B00EB005DC2DA /* document_change_test.cc in Sources */,
BC1D6851267B00EB005DC2DA /* firestore_integration_test.cc in Sources */,
1BAFACA42A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */,
BC1D6838267B00EB005DC2DA /* future_test_util.cc in Sources */,
12CCF1E528FDBD9F00C24941 /* validation_test.cc in Sources */,
BC1D6839267B00EB005DC2DA /* type_test.cc in Sources */,
Expand Down
16 changes: 0 additions & 16 deletions firestore/integration_test_internal/src/aggregate_count_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@
#include "firestore_integration_test.h"
#include "util/event_accumulator.h"

#if defined(__ANDROID__)
#include "firestore/src/android/query_android.h"
#include "firestore/src/common/wrapper_assertions.h"
#endif // defined(__ANDROID__)

#include "Firestore/core/src/util/firestore_exceptions.h"
#include "firebase/firestore/firestore_errors.h"
#include "firebase_test_framework.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace firebase {
Expand Down Expand Up @@ -757,15 +751,5 @@ TEST_F(AggregateCountTest,
EXPECT_EQ(aggregate_query2, aggregate_snapshot2.query());
}

#if defined(__ANDROID__)
TEST(QueryTestAndroidStub, Construction) {
testutil::AssertWrapperConstructionContract<Query>();
}

TEST(QueryTestAndroidStub, Assignment) {
testutil::AssertWrapperAssignmentContract<Query>();
}
#endif // defined(__ANDROID__)

} // namespace firestore
} // namespace firebase
15 changes: 15 additions & 0 deletions firestore/integration_test_internal/src/aggregate_query_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#include "firebase/firestore.h"
#include "firestore_integration_test.h"

#if defined(__ANDROID__)
#include "firestore/src/android/aggregate_query_android.h"
#include "firestore/src/common/wrapper_assertions.h"
#endif // defined(__ANDROID__)

#include "gtest/gtest.h"

namespace firebase {
Expand Down Expand Up @@ -332,6 +337,16 @@ TEST_F(AggregateQueryTest, TestHashCode) {
AggregateQueryHash(query1.Count()));
}

#if defined(__ANDROID__)
TEST(QueryTestAndroidStub, Construction) {
testutil::AssertWrapperConstructionContract<AggregateQuery>();
}

TEST(QueryTestAndroidStub, Assignment) {
testutil::AssertWrapperAssignmentContract<AggregateQuery>();
}
#endif // defined(__ANDROID__)

} // namespace
} // namespace firestore
} // namespace firebase
Loading