Back

The most practical and ideal way of creating report with appwrite for complex queries

  • 0
  • Self Hosted
  • Tools
  • Web
  • Databases
Suiii
25 Jun, 2023, 03:54

is there way to write sql queries with appwrite,

TL;DR
The user is asking if it is possible to write SQL queries with Appwrite for complex report creation. They mention the need to count data for various indicators and worry about the performance and speed of the queries. The suggestion given is to keep a running count in a collection rather than calculating it every time. However, if the manager asks for new indicators that weren't previously counted, they will need to use the query API. The user also asks for recommendations on creating reports for monitoring dashboards. Appwrite is recommended for retrieving data through APIs, but if self-hosting, it is possible to connect to the underlying database. The user asks if
Drake
25 Jun, 2023, 04:05

Appwrite is an abstraction on top of the underlying database and we recommend retrieving data via the provided APIs.

That said, if you're self hosting, you control the database, so you can connect to it if you'd like

Suiii
25 Jun, 2023, 04:09

Could you give me some recommendation. let say we are having 10M record of Clients, Meetup, Enrollment tables. I want to count # of clients, # of followup client, # of clients who is male, female, having specific illness for example. what i think, it will be queries alot, the peformance something and speed of responding.

Suiii
25 Jun, 2023, 04:09

we are showing as a report for dashboard for monitoring.

Drake
25 Jun, 2023, 04:17

I would recommend keeping a running count of the data in a collection rather than trying to calculate it every time

Suiii
25 Jun, 2023, 04:19

like plus, minus every transaction.

Suiii
25 Jun, 2023, 04:25

@Steven however, this is just few indicators, in case there are hundreds of indicator to count data like this. then, I need to keep count every thing ? lets say, I could not think of . then the manager asks for another 100 indicators which is not kept the count in the collection. then, I will need to count by the query api anyway, any ideas?

Drake
25 Jun, 2023, 04:32

Btw, you might want to πŸ‘ this issue: https://github.com/appwrite/appwrite/issues/5667

Drake
25 Jun, 2023, 04:34

If you don't want to keep a running count, you'll need to iterate over the data using pagination: https://appwrite.io/docs/pagination.

Suiii
25 Jun, 2023, 04:35

okay. noted. I would suggest if there is possible in the future of open gateway for sql queries for complex and performance benefits

Drake
25 Jun, 2023, 04:35

Make sure to πŸ‘ the issue I linked

Suiii
25 Jun, 2023, 04:35

okay noted.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more