Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
@clickhouse/client-web
Advanced tools
Official JS client for ClickHouse, written purely in TypeScript, thoroughly tested with actual ClickHouse versions.
The repository consists of three packages:
@clickhouse/client
- a version of the client designed for Node.js platform only. It is built on top of HTTP
and Stream APIs; supports streaming for both selects and inserts.@clickhouse/client-web
- a version of the client built on top of Fetch
and Web Streams APIs; supports streaming for selects.
Compatible with Chrome/Firefox browsers and CloudFlare workers.@clickhouse/client-common
- shared common types and the base framework for building a custom client implementation.See the ClickHouse website for the full documentation entry.
We have a wide range of examples, aiming to cover various scenarios of client usage. The overview is available in the examples README.
If you have any questions or need help, feel free to reach out to us in the Community Slack (#clickhouse-js
channel) or via GitHub issues.
Check out our contributing guide.
1.7.0 (Common, Node.js, Web)
Added JSONEachRowWithProgress
format support, ProgressRow
interface, and isProgressRow
type guard. See this Node.js example for more details. It should work similarly with the Web version.
(Experimental) Exposed the parseColumnType
function that takes a string representation of a ClickHouse type (e.g., FixedString(16)
, Nullable(Int32)
, etc.) and returns an AST-like object that represents the type. For example:
for (const type of [
'Int32',
'Array(Nullable(String))',
`Map(Int32, DateTime64(9, 'UTC'))`,
]) {
console.log(`##### Source ClickHouse type: ${type}`)
console.log(parseColumnType(type))
}
The above code will output:
##### Source ClickHouse type: Int32
{ type: 'Simple', columnType: 'Int32', sourceType: 'Int32' }
##### Source ClickHouse type: Array(Nullable(String))
{
type: 'Array',
value: {
type: 'Nullable',
sourceType: 'Nullable(String)',
value: { type: 'Simple', columnType: 'String', sourceType: 'String' }
},
dimensions: 1,
sourceType: 'Array(Nullable(String))'
}
##### Source ClickHouse type: Map(Int32, DateTime64(9, 'UTC'))
{
type: 'Map',
key: { type: 'Simple', columnType: 'Int32', sourceType: 'Int32' },
value: {
type: 'DateTime64',
timezone: 'UTC',
precision: 9,
sourceType: "DateTime64(9, 'UTC')"
},
sourceType: "Map(Int32, DateTime64(9, 'UTC'))"
}
While the original intention was to use this function internally for Native
/RowBinaryWithNamesAndTypes
data formats headers parsing, it can be useful for other purposes as well (e.g., interfaces generation, or custom JSON serializers).
NB: currently unsupported source types to parse:
FAQs
Official JS client for ClickHouse DB - Web API implementation
The npm package @clickhouse/client-web receives a total of 6,656 weekly downloads. As such, @clickhouse/client-web popularity was classified as popular.
We found that @clickhouse/client-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.