You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
738 B
TypeScript

import { createClient } from "@clickhouse/client";
import dotenv from "dotenv";
import { Env } from "@humanwhocodes/env";
dotenv.config();
const env = new Env();
const CLICKHOUSE_URL = env.require("CLICKHOUSE_URL");
const CLICKHOUSE_USERNAME = env.require("CLICKHOUSE_USERNAME");
const CLICKHOUSE_PASSWORD = env.require("CLICKHOUSE_PASSWORD");
export const client = createClient({
url: CLICKHOUSE_URL,
username: CLICKHOUSE_USERNAME,
password: CLICKHOUSE_PASSWORD,
clickhouse_settings: {
async_insert: 1,
output_format_json_quote_64bit_integers: 0,
output_format_json_quote_64bit_floats: 0,
date_time_input_format: "best_effort",
},
});
// client.insert({
// table: "option_quotes",
// values: [],
// });