Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@prxm/clickhouse
Advanced tools
@prxm/clickhouse
: A dead simple Clickhouse clientnpm install @prxm/clickhouse
const clickhouse = require('@prxm/clickhouse');
const config = {
host: 'localhost',
protocol: 'http',
user: 'default',
password: 'password',
};
const client = clickhouse(config);
(async () => {
const res = await client.selectJson('SELECT number FROM system.numbers LIMIT 10;');
console.log(res);
})();
The clickhouse client exposes several internal methods for usage
client.query(query, [params], [extras]): Promise
Send an async query to the HTTP interface.
query: string
SQL query statement.
const res = await client.selectJson(`SELECT * FROM foo WHERE a=? AND b=?`, ['hello', 'world']);
console.log(res.data, res.meta);
params: sqlstring params
Used for passing params to the query as
client.selectJson(`SELECT * FROM foo WHERE a=? AND b=?`, ['hello', 'world']);
extras: {}
Extra options to pass along the query, useful when targeting different databases.
client.selectJson(`SELECT * FROM foo;`, [], {db: 'test'});
client.selectJson(query, [params], [extras]): Promise<JSON>
Sends an async JSON query to the HTTP interface.
query: string
SQL query statement.
params: sqlstring params
Used for passing params to the query as
client.selectJson(`SELECT * FROM foo WHERE a=? AND b=?`, ['hello', 'world']);
extras: {}
Extra options to pass along the query, useful when targeting different databases.
client.selectJson(`SELECT * FROM foo;`, [], {db: 'test'});
client.insertBatch({table, items}, [extras]): Stream
Batch instert for tables.
{table: string}
The table's name.
{items: [{}]}
The items to insert, keys are used as the corresponding column names.
const items = [
{a: 1, b: 'foo', c: 3},
{a: 1, b: 'baz', c: 3},
];
client.insertBatch({ table: 'batch',items});
extras: {}
Extra options to pass along the query, useful when targeting different databases.
client.insertBatch({table: 'foo', items: [{a:1}]}, {db: 'test'});
FAQs
Unknown package
The npm package @prxm/clickhouse receives a total of 6 weekly downloads. As such, @prxm/clickhouse popularity was classified as not popular.
We found that @prxm/clickhouse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.