Allow selecting from collections with inconsistent properties #19
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Is your feature request related to a problem? Please describe.
I am trying to visualise some of my Firestore data with Grafana. But the issue is that the collection I am trying to query using FireQL does not have a consistent set of properties, since it's collecting daily data, and not every day may have all data.
For example:
SELECT * FROM inconsistent_property_collection
throwsfireql.Execute: unknown field "inconsistentProperty" in doc "2023-10-18"
Describe the solution you'd like
I think allowing properties to not be consistent, and considering them a SQL
NULL
when they are not present would make this library, and specially the usage from Grafana that much more useful. Otherwise, most Firestore-like collections won't work with FireQL, since Firestore does not enforce consistent properties.Also, to keep back-wards compatibility this new behaviour could require an opt-in, and could use an SQL-like syntax. For example:
SET allow_inconsistent_properties = true; SELECT * FROM inconsistent_property_collection
or
SELECT * FROM inconsistent_property_collection ALLOW undefined_properties
Describe alternatives you've considered
The main alternative I have considered is to stop using FireQL and Firestore and use Postgres. I don't see a way to get this working with my type of collections.
Additional context
All of this was tested using the latest version of the Grafana Firestore integration
The text was updated successfully, but these errors were encountered: