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

Allow selecting from collections with inconsistent properties #19

Open
ropjov opened this issue Nov 20, 2023 · 0 comments
Open

Allow selecting from collections with inconsistent properties #19

ropjov opened this issue Nov 20, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ropjov
Copy link

ropjov commented Nov 20, 2023

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 throws fireql.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

@pgollangi pgollangi added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants