Skip to content

PUT multiple CSJ in one time for serialisation  #2

Description

@tleekkul

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":{}
    }
  }]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions