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 statetement that write, need to be checked #45

Closed andrea-dintino closed 3 years ago

andrea-dintino commented 3 years ago

Based on this: https://apiroom.net/api/dyneorg/read-write-database-acme

ZENCODE:

Rule unknown ignore 
Scenario 'ecdh': Create the keypair
Given my name is 'John'
Given I have a database uri named 'mysql'
Given I have a database table named 'myTable'
Given I have a 'string dictionary' named 'myZenroomStringDictionary'
# the value of the record could be 0 to max could be 
# Given I read the record '1' of the table 'myTable' of the database 'mysql' and save the result into 'myZenroomStringDictionary'
When I create the array of '8' random objects of '256' bits
Then print all data
# Then I save the 'array' into the database 'mysql' into the table 'myTable'

Then I save the output into the database 'mysql' into the table 'myTable'

KEYS

{
    "myTable": "firstTable",
    "myCache": "firstCache",
    "mysql": "mysql://user:pass@server:3306/db",
    "myZenroomStringDictionary": {
        "data": {
            "data1": "9WgBlK+Kcq3AKpmhituXQe4UPkzH3zpZiQa4Szm1Q40=",
            "data2": "BCEo8MgRiSxtLfxE4UEDVnbdZ21h+xc+egLIRk3VTagpJxlBfu9MjqXGUi2N7tIewpcDrr5V7Z2cmMcNsbKWSGQ="
        }
    }
}