Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
clickhouse-ts
Advanced tools
Readme
This package is written in TypeScript because Node.js typing development is already an industry standard.
It has been empirically verified that in-memory collecting rows is the most efficient and consistent way to insert into Clickhouse. To work with built-in caching, you just need to call the useCaching() method
clickhouse-ts doesn't use a lot of abstractions and dependencies, so it's fast and stable.
The Lookforsale team has been using clickhouse-ts effectively for over a year under extreme loads!
Double checking data for anomalies during in-memory caching and when inserting a finished batch.
Flexible configuration of the Clickhouse client instance and support for all features provided by Clickhouse developers.
SQL Injection Protection with sqlstring
The package has a public license and is available for download to any developer!## Installation
npm i clickhouse-ts
npm i clickcache
Starting from version 2.0.0
the caching module should be imported separately.
This is because clickcache package, like clickhouse-ts, is going to be part of my Clickhouse Node.js ecosystem.
In addition, it planned to introduce data validation, as in Joi and model generation, as in mongodb/mongoose.
Only HTTP(s) protocol is supported.
const client = new Clickhouse(
{
url: 'url',
port: 8443,
user: 'user',
password: 'password',
database: 'database',
ca: fs.readFileSync('cert.crt')
},
{
/* https://clickhouse.com/docs/en/interfaces/formats */
defaultResponseFormat: 'JSON',
clickhouseOptions: {
/* https://clickhouse.tech/docs/en/operations/settings/settings/ */
send_progress_in_http_headers: '1'
}
}
)
Basically, this client supports data insertion, but you should consider collecting your data before passing it as an argument here. Use clickcache
to prepare batches!
const response = await client.insert('table_strings', rows, {
format: 'CSVWithNames'
})
await clickhouseInstance.query<{ t: string }>('WITH now() as t SELECT t', {
format: 'TSV',
send_progress_in_http_headers: '1'
})
await clickhouseInstance.query(`
CREATE TABLE strings (
date DateTime('UTC'),
string String
) Engine = ReplacingMergeTree()
PARTITION BY toMonday(date)
ORDER BY (date, string)
`, { noFormat: true })
FAQs
Light stable Clickhouse client
The npm package clickhouse-ts receives a total of 170 weekly downloads. As such, clickhouse-ts popularity was classified as not popular.
We found that clickhouse-ts 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
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.