Closed Meldiron closed 11 months ago
In network tab I can see response from POST /api/queries
is {"message":"Invalid query name","status":400}
.
Name in payload seems to be cloud_appwrite_io v1 databases main collections reminders documents?queries[]=limit(100)
On the same note, I cannot get pagination to work because if those specific requirements for parameters.
For cursor pagination, I would need to send those two parameters:
?queries[]=limit(5)&queries[]=offset(10)
. Can yo usee a way to do that in Budibase?
Hey @Meldiron
A couple of ideas:
Hey there 👋
That works, thanks ❤️
I checked it and found the method used to list documents: https://github.com/melohagan/budibase-datasource-appwrite-databases/blob/main/src/datasource.ts#L33
There is third parameter queries
array, where stuff like filtering, pagination or sorting can be done. In the datasource plugin, this queries parameter is not being provided, so it doesn't help me understand how to paginate Appwrite database in Budibase.
Have raised an issue against that plugin repo: https://github.com/melohagan/budibase-datasource-appwrite-databases/issues/1
Thanks for the suggestion!
Hey @Meldiron
I have updated the appwrite-databases connector to support queries 👍
Checklist
Hosting
Describe the bug
REST API I want to use as datasource support filters, but it uses very specific query syntax. Following is how you do something like
LIMIT 1
in SQL:?queries[]=limit(1)
[]
tells server thatqueries
is array parameter, and there be multiple (like?queries[]=limit(5)&queries[]=offset(10)
. It's not part of HTTP protocol as far as I am aware, but many HTTP servers accept this form. Example mentioning PHP: https://stackoverflow.com/questions/6243051/how-to-pass-an-array-within-a-query-stringlimit(1)
is a string value, which is then parsed by server. I believe()
are valid symbols in value of URL parameters, as separation there is defined by&
symbol.Here is sample request and response from HTTPie:
Sadly, adding this to Budibase results in an error.
To Reproduce Steps to reproduce the behavior:
(
or)
, for examplehttps://google.com?q=Hello(World
Send
, seems to work fineSave
, shows errorError saving query
Expected behavior
No error, saving is successful.
Screenshots
App Export
Not necessary I believe, very easy to reproduce.
Additional context
Open to contributing if you can point me to places ✨ Sadly, I won't be able to find the bug as I haven't contributed to Budibase yet.
From SyncLinear.com | BUDI-7762