-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FORMATing not being applied for queries which use WITH x as (SELECT 1) SELECT * FROM x
.
#102
Comments
Hi, I published a fix for your case. Could you please upgrade the package and test it? |
@TimonKK thanks a ton for the fix, this seems to do the trick indeed. I used the code below that fails with version const CTE_SQL = `
WITH yolo AS (
SELECT rand() AS a, rand(1) AS b, rand(number) AS c
FROM numbers(3)
)
SELECT a, b, c FROM yolo
`
const OPTS = {
url, port, ...,
format: 'json',
}
async function main() {
const rows = await ck.connect(OPTS).query(CTE_SQL).toPromise()
console.log(rows)
// { a: 560152421, b: 3052471433, c: 25746393 },
// { a: 3317286345, b: 3388181787, c: 2905723273 },
// { a: 3213018093, b: 2268847078, c: 3820230708 }
}
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I do believe it happens because of this regexp.
clickhouse/index.js
Line 495 in a84d890
Workaround is: manually write FORMAT JSON or whatever in your query.
The text was updated successfully, but these errors were encountered: