Skip to content

Commit

Permalink
Fix empty queries (#378)
Browse files Browse the repository at this point in the history
* fix empty queries

* update changelog
  • Loading branch information
ultram4rine committed Apr 13, 2023
1 parent 241e527 commit 0a01c59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fix empty output from queries that should return output.

## [0.3.0] - 2023-04-09

### Added
Expand Down
6 changes: 5 additions & 1 deletion src/ls/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export default class ClickHouseDriver
return this.open().then((ch) => {
return new Promise<NSDatabase.IResult[]>(async (resolve) => {
const { requestId } = opt;
const method = query.toString().startsWith("SELECT") ? "query" : "exec";
const queryStart = query.toString().trimStart().toUpperCase();
const method =
queryStart.startsWith("SELECT") || queryStart.startsWith("WITH")
? "query"
: "exec";

try {
if (method === "query") {
Expand Down

0 comments on commit 0a01c59

Please sign in to comment.