Skip to content

Commit

Permalink
fix(grammar): Support more datatypes in JSON_RETURNING_CLAUSE, JSON_V…
Browse files Browse the repository at this point in the history
…ALUE_RETURN_TYPE and JSON_TRANSFORM_RETURNING_CLAUSE

The Oracle documentation shows only "VARCHAR2" but "VARCHAR" and "CHAR" are supported too, for example
  • Loading branch information
felipebz committed Sep 30, 2024
1 parent 4b68157 commit 27c4fb8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"adjsn/function-JSON_TABLE-3.sql" : [
12
],
"adjsn/generation-26.sql" : [
5
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"adjsn/function-JSON_TABLE-23.sql" : [
3
],
"adjsn/function-JSON_TABLE-3.sql" : [
12
],
"adjsn/function-JSON_VALUE-3.sql" : [
4
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"adjsn/function-JSON_TABLE-22.sql" : [
3
],
"adjsn/function-JSON_TABLE-3.sql" : [
2
],
"adjsn/function-JSON_TABLE-8.sql" : [
2
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"adjsn/function-JSON_TABLE-22.sql" : [
4
],
"adjsn/function-JSON_TABLE-3.sql" : [
3
],
"adjsn/generation-36.sql" : [
7,
9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,7 @@ enum class SingleRowSqlFunctionsGrammar : GrammarRuleKey {
RETURNING,
b.firstOf(
b.sequence(
VARCHAR2,
b.optional(LPARENTHESIS, PlSqlTokenType.INTEGER_LITERAL, b.optional(b.firstOf(CHAR, BYTE)), RPARENTHESIS),
CHARACTER_DATAYPE,
b.optional(WITH, TYPENAME)
),
b.sequence(
Expand Down Expand Up @@ -798,25 +797,11 @@ enum class SingleRowSqlFunctionsGrammar : GrammarRuleKey {
b.rule(JSON_VALUE_RETURN_TYPE).define(
b.firstOf(
b.sequence(
VARCHAR2,
b.optional(
LPARENTHESIS,
PlSqlTokenType.INTEGER_LITERAL,
b.optional(b.firstOf(CHAR, BYTE)),
RPARENTHESIS
),
CHARACTER_DATAYPE,
b.optional(TRUNCATE)
),
CLOB,
b.sequence(
NUMBER,
b.optional(
LPARENTHESIS,
PlSqlTokenType.INTEGER_LITERAL,
b.optional(COMMA, PlSqlTokenType.INTEGER_LITERAL),
RPARENTHESIS
)
),
NUMERIC_DATATYPE,
b.sequence(b.firstOf(ALLOW, DISALLOW), b.optional(BOOLEAN), TO, NUMBER, b.optional(CONVERSION)),
b.sequence(DATE, b.optional(b.firstOf(TRUNCATE, PRESERVE), TIME)),
b.sequence(TIMESTAMP, b.optional(WITH, TIME, ZONE)),
Expand Down Expand Up @@ -897,15 +882,7 @@ enum class SingleRowSqlFunctionsGrammar : GrammarRuleKey {
b.rule(JSON_TRANSFORM_RETURNING_CLAUSE).define(
RETURNING,
b.firstOf(
b.sequence(
VARCHAR2,
b.optional(
LPARENTHESIS,
PlSqlTokenType.INTEGER_LITERAL,
b.optional(b.firstOf(CHAR, BYTE)),
RPARENTHESIS
)
),
CHARACTER_DATAYPE,
b.sequence(
b.firstOf(CLOB, BLOB),
b.optional(b.firstOf(REFERENCE, VALUE))
Expand Down

0 comments on commit 27c4fb8

Please sign in to comment.