File tree Expand file tree Collapse file tree 5 files changed +22
-7
lines changed Expand file tree Collapse file tree 5 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 59
59
"url" : " https://github.com/dolthub/react-library/issues"
60
60
},
61
61
"dependencies" : {
62
- "node-sql-parser" : " ^5.3.5 " ,
62
+ "node-sql-parser" : " ^5.3.10 " ,
63
63
"timeago.js" : " ^4.0.2"
64
64
}
65
65
}
Original file line number Diff line number Diff line change @@ -75,4 +75,5 @@ export const mutationExamples = [
75
75
"SET GLOBAL slow_query_log = 1" ,
76
76
"SET SESSION slow_query_log = 1" ,
77
77
"FLUSH PRIVILEGES" ,
78
+ `REPLACE INTO dolt_docs VALUES ("README.md", "This is a README with a \\"quote\\".")` ,
78
79
] ;
Original file line number Diff line number Diff line change @@ -537,18 +537,31 @@ function getParserCol(
537
537
column : name ,
538
538
table : table ?? null ,
539
539
type : "column_ref" ,
540
+ // TODO: Remove type cast when this issue is fixed https://github.com/taozhi8833998/node-sql-parser/issues/2522
541
+ collate : null as any ,
540
542
} ,
541
543
as : null ,
542
544
type : includeType ? "expr" : undefined ,
543
545
} ;
544
546
}
545
547
548
+ function getParserStarCol ( ) : Column {
549
+ return {
550
+ expr : {
551
+ column : "*" ,
552
+ table : null ,
553
+ type : "column_ref" ,
554
+ } ,
555
+ as : null ,
556
+ } ;
557
+ }
558
+
546
559
describe ( "test getColumns" , ( ) => {
547
560
const tests = [
548
561
{
549
562
desc : "select *" ,
550
563
query : "select * from `test`" ,
551
- expected : [ getParserCol ( "*" ) ] ,
564
+ expected : [ getParserStarCol ( ) ] ,
552
565
} ,
553
566
{
554
567
desc : "select one column" ,
Original file line number Diff line number Diff line change @@ -336,6 +336,7 @@ export function isMutation(q?: string): boolean {
336
336
lower . startsWith ( "revoke" ) ||
337
337
lower . startsWith ( "grant" ) ||
338
338
lower . startsWith ( "flush" ) ||
339
+ // lower.startsWith("replace into") ||
339
340
( lower . startsWith ( "with" ) &&
340
341
( ( lower . includes ( "update" ) && lower . includes ( "set" ) ) ||
341
342
lower . includes ( "delete from" ) ) )
Original file line number Diff line number Diff line change @@ -2543,7 +2543,7 @@ __metadata:
2543
2543
babel-jest: "npm:^30.0.2"
2544
2544
eslint: "npm:^8.57.0"
2545
2545
jest: "npm:^29.7.0"
2546
- node-sql-parser: "npm:^5.3.5 "
2546
+ node-sql-parser: "npm:^5.3.10 "
2547
2547
prettier: "npm:^3.6.2"
2548
2548
rollup: "npm:^4.46.2"
2549
2549
rollup-plugin-dts: "npm:^6.2.1"
@@ -12697,13 +12697,13 @@ __metadata:
12697
12697
languageName: node
12698
12698
linkType: hard
12699
12699
12700
- "node-sql-parser@npm:^5.3.5 ":
12701
- version: 5.3.5
12702
- resolution: "node-sql-parser@npm:5.3.5 "
12700
+ "node-sql-parser@npm:^5.3.10 ":
12701
+ version: 5.3.10
12702
+ resolution: "node-sql-parser@npm:5.3.10 "
12703
12703
dependencies:
12704
12704
"@types/pegjs": "npm:^0.10.0"
12705
12705
big-integer: "npm:^1.6.48"
12706
- checksum: 221c0e5d582adf9e87a4357cc437f6f66e925eaefa889f05b8e93375274b0246edbca11a673e7d44a29888ca0ec6005b5614ac08361b0e9171d11c66ce17e91a
12706
+ checksum: a4c417a429d4d438548f858e62be091148a52256c39b419c0e0eb259af5feb6fa555928a98e2fe3a07a974a2ce065ea12df04ac18f5a01bfa918df32cebc6a2a
12707
12707
languageName: node
12708
12708
linkType: hard
12709
12709
You can’t perform that action at this time.
0 commit comments