File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class ResultSetPanelProvider {
36
36
37
37
const statement = [
38
38
`SET CURRENT SCHEMA = '${ config . currentLibrary . toUpperCase ( ) } '` ,
39
- `WITH SCROLLING AS ( ${ message . query } ) SELECT * FROM SCROLLING LIMIT ${ message . limit } OFFSET ${ message . offset } ` ,
39
+ `${ message . query } LIMIT ${ message . limit } OFFSET ${ message . offset } ` ,
40
40
] . join ( `;\n` ) ;
41
41
42
42
let data = [ ] ;
@@ -147,11 +147,12 @@ exports.initialise = (context) => {
147
147
} ) ;
148
148
149
149
} else {
150
-
151
- if ( statement . content . toUpperCase ( ) . startsWith ( `SELECT` ) && ! statement . content . toUpperCase ( ) . includes ( `LIMIT` ) ) {
150
+ if ( statement . type === `statement` && this . isBasicStatement ( statement . content ) ) {
151
+ // If it's a basic statement, we can let it scroll!
152
152
resultSetProvider . setScrolling ( statement . content ) ;
153
153
154
154
} else {
155
+ // Otherwise... it's a bit complicated.
155
156
statement . content = [
156
157
`SET CURRENT SCHEMA = '${ config . currentLibrary . toUpperCase ( ) } '` ,
157
158
statement . content
@@ -234,6 +235,11 @@ exports.initialise = (context) => {
234
235
)
235
236
}
236
237
238
+ exports . isBasicStatement = ( statement ) => {
239
+ const basicStatement = statement . trim ( ) . toUpperCase ( ) ;
240
+
241
+ return statement . startsWith ( `SELECT` ) && ! statement . includes ( `LIMIT` ) ;
242
+ }
237
243
238
244
/**
239
245
* @param {vscode.TextEditor } editor
You can’t perform that action at this time.
0 commit comments