Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14b3146

Browse files
committed
feat: support function call in table_factor.
1 parentca3c259 commit14b3146

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sql grammar follows https://dev.mysql.com/doc/refman/5.7/en/select.html
1010

1111
##news
1212

13+
- Unicode extended char support for column name or alias & Function call in`table_factor` since v1.6.0
1314
- Support feature`PlaceHolder like ${param}` since v1.5.0[#43](https://github.com/JavaScriptor/js-sql-parser/pull/43)
1415
- Fix bug`using ' & " for column alias?` since v1.4.1[#40](https://github.com/JavaScriptor/js-sql-parser/issues/40),[#44](https://github.com/JavaScriptor/js-sql-parser/issues/44)
1516
- Fix bug tableFactor alias since v1.3.0[#34](https://github.com/JavaScriptor/js-sql-parser/issues/34)

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"js-sql-parser",
3-
"version":"1.5.0",
3+
"version":"1.6.0",
44
"description":"",
55
"main":"./dist/parser/sqlParser.js",
66
"scripts": {

‎src/sqlParser.jison

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ table_factor
588588
: identifier partitionOpt aliasOpt index_hint_list_opt {$$= { type:'TableFactor', value:$1, partition:$2, alias:$3.alias, hasAs:$3.hasAs, indexHintOpt:$4 }}
589589
|'(' selectClause')' aliasOpt {$$= { type:'TableFactor', value: { type:'SubQuery', value:$2 }, alias:$4.alias, hasAs:$4.hasAs}}
590590
|'(' table_references')' {$$=$2;$$.hasParentheses=true}
591+
| function_call aliasOpt index_hint_list_opt {$$= { type:'TableFactor', value:$1, alias:$2.alias, hasAs:$2.hasAs, indexHintOpt:$3 }}
591592
;
592593
place_holder
593594
: PLACE_HOLDER {$$= { type:'PlaceHolder', value:$1, param:$1.slice(2,-1)}}

‎test/main.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,4 +462,10 @@ describe('select grammar support', function () {
462462
かわいい
463463
from table`)
464464
})
465+
466+
it('#60 Call function in FROM clause',function(){
467+
testParser(`
468+
SELECT one.name, group_concat(j.value, ', ') FROM one, json_each(one.stringArray) AS j GROUP BY one.id
469+
`)
470+
})
465471
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp