Skip to content

Commit

Permalink
Merge branch 'master' into extend-undefined-parser-report
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored May 23, 2024
2 parents a7a92a4 + 52d9c5d commit 0626753
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* **Secure**: Retain total control of data, using **ClickHouse**, **DuckDB** or **InfluxDB** IOx with **S3** object storage
* **Indepentent**: Opensource, Community powered, Anti lock-in alternative to Vendor controlled stacks

![lgtm_vs_qryn](https://github.com/metrico/qryn/assets/1423657/2e9071ba-c578-49fc-be1d-d91944a5891e)
<!-- ![lgtm_vs_qryn](https://github.com/metrico/qryn/assets/1423657/2e9071ba-c578-49fc-be1d-d91944a5891e) -->


<br>
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const path = require('path')
module.exports = {
setupFilesAfterEnv: [path.join(__dirname, '/test/jest.setup.js')]
setupFilesAfterEnv: [path.join(__dirname, '/test/jest.setup.js')],
moduleNameMapper: {
'^axios$': 'axios/dist/node/axios.cjs'
}
}
17 changes: 16 additions & 1 deletion lib/db/clickhouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1363,12 +1363,27 @@ const samplesReadTable = {
*/
const rawRequest = async (query, data, database, config) => {
try {
if (data && !(Buffer.isBuffer(data) || data instanceof Uint8Array || typeof data === 'string')) {
throw new Error('data must be Buffer, Uint8Array or String: currently the data is: ' + typeof data)
}
if (typeof data === 'string') {
data = Buffer.from(data, 'utf8')
}
if (typeof query !== 'string') {
throw new Error('query must be String: currently the query is: ' + typeof query)
}
const getParams = [
(database ? `database=${encodeURIComponent(database)}` : null),
(data ? `query=${encodeURIComponent(query)}` : null)
].filter(p => p)
const url = `${getClickhouseUrl()}/${getParams.length ? `?${getParams.join('&')}` : ''}`
return await axios.post(url, data || query, config)
config = {
...(config || {}),
method: 'post',
url: url,
data: data || query
}
return await axios(config)
} catch (e) {
logger.error('rawRequest error: ' + query)
e.response?.data && logger.error(e.response.data.toString())
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@qxip/influx-line-protocol-parser": "^0.2.1",
"@qxip/plugnplay": "^3.3.1",
"@stricjs/router": "^5.0.6",
"axios": "^0.28.0",
"axios": "^1.6.8",
"bnf": "^1.0.1",
"csv-writer": "^1.6.0",
"date-fns": "^2.27.0",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e
Submodule e2e updated from 85e344 to 8847ca
2 changes: 1 addition & 1 deletion traceql/traceql.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cmp ::= "="|"!="|"<="|">="|"<"|">"
cmp_val ::= <number> [<measurement>]
measurement ::= "ns"|"us"|"ms"|"s"|"m"|"h"|"d"

label_name ::= ("." | <ALPHA> | "_") *("." | <ALPHA> | "_" | <DIGITS>)
label_name ::= ("." | <ALPHA> | "-" | "_") *("." | <ALPHA> | "_" | "-" | <DIGITS>)
number ::= ["-"] <DIGITS> ["." <DIGITS>]

attr_selector ::= <label_name> <OWSP> <op> <OWSP> <value>
Expand Down

0 comments on commit 0626753

Please sign in to comment.