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

Make CollectionReference implement Query #32

Merged
merged 4 commits into from
Feb 16, 2024

Conversation

darinf
Copy link

@darinf darinf commented Feb 16, 2024

Given that C++ types are exposed as structs and structs do not support inheritance in Swift, the fact that the C++ CollectionReference inherits from Query is not exposed on the Swift side. We then workaround that by defining a protocol that both Query and CollectionReference can conform to.

Also expose CollectionReference.path() and FieldValue.serverTimestamp().

Copy link

@brianmichel brianmichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, this kind of a gnarly problem that I assume we might run into again, it would be rad if the toolchain helped us more here in the future.

@darinf
Copy link
Author

darinf commented Feb 16, 2024

Works for me, this kind of a gnarly problem that I assume we might run into again, it would be rad if the toolchain helped us more here in the future.

I think we should probably just switch over to wrapping all of the C++ types with Swift class types. Then we can have inheritance and other nice things.

@darinf darinf merged commit a2bf484 into main Feb 16, 2024
1 check passed
@darinf darinf deleted the darin/collection-reference-fixes branch February 16, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants