reduce data points for historical exit quotes by aggregating and applying weighted transparency
clean frontend html structuremain
parent
28caba57ca
commit
ad66397639
@ -1,18 +1,28 @@
|
|||||||
import _ from './env.js';
|
import _ from "./env.js";
|
||||||
import { createClient as createClickhouseClient } from '@clickhouse/client';
|
import { createClient as createClickhouseClient } from "@clickhouse/client";
|
||||||
import type { DataFormat } from '@clickhouse/client';
|
import type { DataFormat } from "@clickhouse/client";
|
||||||
|
|
||||||
// prevent from tree-shaking:
|
// prevent from tree-shaking:
|
||||||
console.log(_);
|
console.log(_);
|
||||||
export const clickhouse = createClickhouseClient({
|
export const clickhouse = createClickhouseClient({
|
||||||
host: process.env.CLICKHOUSE_HOST || "http://localhost:8123",
|
host: process.env.CLICKHOUSE_HOST || "http://localhost:8123",
|
||||||
username:'avraham',
|
username: "avraham",
|
||||||
password:'buginoo'
|
password: "buginoo",
|
||||||
});
|
});
|
||||||
|
|
||||||
export async function query<T>(queryString:string, format:DataFormat='JSONEachRow') : Promise<Array<T>>{
|
export async function query<T>(
|
||||||
return await (await clickhouse.query({
|
queryString: string,
|
||||||
query: queryString,
|
format: DataFormat = "JSONEachRow"
|
||||||
format
|
): Promise<Array<T>> {
|
||||||
})).json()
|
return await (
|
||||||
}
|
await clickhouse.query({
|
||||||
|
query: queryString,
|
||||||
|
format,
|
||||||
|
clickhouse_settings: {
|
||||||
|
output_format_json_quote_64bit_integers: 0,
|
||||||
|
//output_format_json_quote_64bit_floats: false,
|
||||||
|
//output_format_json_quote_64bit_decimals: false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
).json();
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue