2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,7 @@ const MonacoEditor = () => {
298
298
renderLineMarkings ( monacoRef . current , editorRef ?. current )
299
299
}
300
300
301
- if ( result . type === QuestDB . Type . DDL ) {
301
+ if ( result . type === QuestDB . Type . DDL || result . type === QuestDB . Type . DML ) {
302
302
dispatch (
303
303
actions . query . addNotification ( {
304
304
content : (
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ type RawData = Record<string, Value>
35
35
36
36
export enum Type {
37
37
DDL = "ddl" ,
38
+ DML = "dml" ,
38
39
DQL = "dql" ,
39
40
ERROR = "error" ,
40
41
}
@@ -56,6 +57,7 @@ type RawDqlResult = {
56
57
count : number
57
58
dataset : DatasetType [ ]
58
59
ddl : undefined
60
+ dml : undefined
59
61
error : undefined
60
62
query : string
61
63
timings : Timings
@@ -64,10 +66,17 @@ type RawDqlResult = {
64
66
65
67
type RawDdlResult = {
66
68
ddl : "OK"
69
+ dml : undefined
70
+ }
71
+
72
+ type RawDmlResult = {
73
+ ddl : undefined
74
+ dml : "OK"
67
75
}
68
76
69
77
type RawErrorResult = {
70
78
ddl : undefined
79
+ dml : undefined
71
80
error : "<error message>"
72
81
position : number
73
82
query : string
@@ -78,15 +87,21 @@ type DdlResult = {
78
87
type : Type . DDL
79
88
}
80
89
81
- type RawResult = RawDqlResult | RawDdlResult | RawErrorResult
90
+ type DmlResult = {
91
+ query : string
92
+ type : Type . DML
93
+ }
94
+
95
+ type RawResult = RawDqlResult | RawDmlResult | RawDdlResult | RawErrorResult
82
96
83
97
export type ErrorResult = RawErrorResult & {
84
98
type : Type . ERROR
85
99
status : number
86
100
}
87
101
88
102
export type QueryRawResult =
89
- | ( Omit < RawDqlResult , "ddl" > & { type : Type . DQL } )
103
+ | ( Omit < RawDqlResult , "ddl" | "dml" > & { type : Type . DQL } )
104
+ | DmlResult
90
105
| DdlResult
91
106
| ErrorResult
92
107
@@ -100,6 +115,7 @@ export type QueryResult<T extends Record<string, any>> =
100
115
explain ?: Explain
101
116
}
102
117
| ErrorResult
118
+ | DmlResult
103
119
| DdlResult
104
120
105
121
export type Table = {
@@ -425,6 +441,13 @@ export class Client {
425
441
}
426
442
}
427
443
444
+ if ( data . dml ) {
445
+ return {
446
+ query,
447
+ type : Type . DML ,
448
+ }
449
+ }
450
+
428
451
if ( data . error ) {
429
452
// eslint-disable-next-line prefer-promise-reject-errors
430
453
return Promise . reject ( {
0 commit comments