class ClickhouseQuery(models.Model):
scope = ChoiceField('course', 'tenant', 'user') # Determines which variables is passed to the query
slug = SlugField()
query = TextField() # This is a query but with some variables for substiution with `.format` function
The API would have different endpoints but with similar structure e.g.
GET /fx/query/course/<slug>?course_id=<course_id>&tenand_id=<tenand_id>
GET /fx/query/user/<slug>?user_id=<user_id>&tenand_id=<tenand_id>
GET /fx/query/tenant/<slug>?tenant_id=<user_id>
This way we can assign security allowed roles for different scope of queries.
e.g.
GET /fx/query/user/activities?user=1223,tenant=23232
The API would have different endpoints but with similar structure e.g.
This way we can assign security allowed roles for different scope of queries.
e.g.