dyne / restroom-mw

🛠 Easy REST API builder executing Zencode
https://restroom.dyne.org
GNU Affero General Public License v3.0
3 stars 11 forks source link

DB package: reading the 'max' record doesn't work #51

Closed andrea-dintino closed 2 years ago

andrea-dintino commented 3 years ago

There should be a way to read the last record on the table. How to reproduce:

Zencode:

Rule caller restroom-mw

Given I have a database uri named 'mysql'
Given I have a database table named 'myTable'

Given I have a 'string dictionary' named 'myResult'

Given I read the record 'max' of the table 'myTable' of the database 'mysql' and save the result into 'myResult'

Then print 'myResult'

Keys:

{
    "myTable": "firstTable",
    "mysql": "mysql://48Dg7xv6YL:nz6usNgiD1@remotemysql.com:3306/48Dg7xv6YL"
}
puria commented 3 years ago

Don't you think to make the user free to run a SQL string directly? In place of having a sentence for every SQL function?

Something like:

Given i have a SQL query named 'my_query_to_run'

Given the result of my_query_to_run from database 'mysql' save it to 'my_string_dict'

So they can count, order, join things and so on?

andrea-dintino commented 3 years ago

yes!