-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
I would like to be able to PUT multiple CSJ in one time, separate by blank line to make sure that all of data that I want to PUT is consistent
Example
PUT /pokemons/Pikachu HTTP/1.1
Content-Type: application/csj
Payload:
"skill","damage"
"Static",30
"Lighting Rod",120
"skill","vs","effectiveness"
"Static","Fire",1.0
"Static","Plant",0.5
"Static","Water",2.0
"Static","Dark",1.0
Expected result
[{
"deleted": 1,
"records": 2,
"selected": 3
},{
"deleted": 15,
"records": 4,
"selected": 4
}]
Suggest Configuration
{
"path":["/pokemons",1],
"PUT":[{
"table":"skills",
"existing":"SELECT name,skill FROM skills WHERE name=$1",
"delete":"DELETE FROM skills WHERE name=$1 AND skill=$2",
"columns":{
"name":{"key":true, "source": 1},
"skill":{"key":true},
"damage":{}
}
},{
"table":"effectiveness",
"existing":"SELECT name,skill,vs FROM effectiveness WHERE name=$1",
"delete":"DELETE FROM effectiveness WHERE name=$1 AND skill=$2 AND vs=$3",
"columns":{
"name":{"key":true, "source": 1},
"skill":{"key":true},
"vs":{"key":true},
"effectiveness":{}
}
}]
}