Skip to content

Commit

Permalink
feat: add support for multiple json contents in insert queries
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Nov 27, 2023
1 parent 783da28 commit 34aa90e
Show file tree
Hide file tree
Showing 5 changed files with 3,745 additions and 3,615 deletions.
10 changes: 9 additions & 1 deletion core/src/main/grammar/OrientSQL.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -1918,9 +1918,17 @@ OInsertBody InsertBody():
( <CONTENT>
(
content = Json() { jjtThis.addContent(content);}
|
|
inputParamater = InputParameter() { jjtThis.addContentInputParam(inputParamater); }
)
(
<COMMA>
(
content = Json() { jjtThis.addContent(content);}
|
inputParamater = InputParameter() { jjtThis.addContentInputParam(inputParamater); }
)
)*
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ private void handleCreateRecord(
&& body.getValueExpressions().size() > 0) {
tot = body.getValueExpressions().size();
}
if (body != null
&& body.getContentInputParam() != null
&& body.getContentInputParam().size() > 0) {
tot = body.getContentInputParam().size();
if (body != null && body.getContent() != null && body.getContent().size() > 0) {
tot += body.getContent().size();
}
} else {
if (body != null && body.getContent() != null && body.getContent().size() > 0) {
tot = body.getContent().size();
}
}
result.chain(new CreateRecordStep(ctx, tot, profilingEnabled));
}

Expand Down
Loading

0 comments on commit 34aa90e

Please sign in to comment.