Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PUT multiple CSJ in one time for serialisation #2

Open
tleekkul opened this issue Jun 1, 2017 · 1 comment
Open

PUT multiple CSJ in one time for serialisation #2

tleekkul opened this issue Jun 1, 2017 · 1 comment
Assignees

Comments

@tleekkul
Copy link
Collaborator

tleekkul commented Jun 1, 2017

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":{}
    }
  }]
}
KayEss added a commit that referenced this issue Jun 3, 2017
These are the tests needed to fix #2
@KayEss
Copy link
Member

KayEss commented Jun 3, 2017

I think that diff describes the feature that you want. It also includes multiple SELECTs in the GET which will be needed to round trip this.

@KayEss KayEss self-assigned this Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants