Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clickhouse

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clickhouse

Client for ClickHouse

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
decreased by-6.62%
Maintainers
1
Weekly downloads
 
Created
Source

clickhouse

NodeJS client for ClickHouse. Send query over HTTP interface.

Example:

var async = require('async');
 
var query = 'SELECT FlightDate, DestCityName, AirlineID, DestStateFips FROM ontime LIMIT 10';
var ch = new ClickHouse({
	url   : 'http://localhost',
	port  : 8123,
	debug : false
});

async.parallel(
	[
		function (cb) {

			// single query
			ch.query(query, function (err, rows) {
				console.log('single query result', err, rows);
				
				cb(err);
			});
		},
		
		function (cb) {
			var error = null;
			
			// query with data streaming
			ch.query(query)
				.on('data', function (data) {
					console.log('data', data);
				})
				.on('error', function (err) {
					error = err;
				})
				.on('end', function () {
					cb(error);
				});
		},

		function(cb) {

			// insert rows
			ch.insertMany(
				'sometable',
				[
					// row 1
					[
						'2016-07-02',
						'1',
						12
					],

					// row 2
					[
						'2016-07-03',
						'2',
						30
					]
				],
				function(err, result) {
					if (err)  return cb(err);

					console.log('insert result', result);
				}
			);
		}
	],
	function () {
		process.exit();
	}
);

FAQs

Package last updated on 15 Sep 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc