Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@apla/clickhouse
Advanced tools
npm install @apla/clickhouse
var ch = new ClickHouse ({host: clickhouse.host});
// stream is an object stream. you can pipe it
var stream = ch.query ("SELECT 1");
// or collect records yourself
var rows = [];
stream.on ('metadata', function (columns) {
// do something with column list
});
stream.on ('data', function (row) {
rows.push (row);
});
stream.on ('error', function (err) {
// TODO: handler error
});
stream.on ('end', function () {
// all rows are collected, let's verify count
assert (rows.length === stream.supplemental.rows);
// how many rows in result are set without windowing:
console.log ('rows in result set', stream.supplemental.rows_before_limit_at_least);
});
var options = {
host: "clickhouse.msk",
queryOptions: {
profile: "web",
database: "test"
},
omitFormat: false
};
var clickHouse = new ClickHouse (options);
If you provide options as a string, they are assumed as a host parameter in connection options
Connection options (accept all options documented for http.request):
user:password
, optional/
if omited,queryOptions
object can contain any option from Settings (docs:
en
ru
)
For example:
Driver options:
FORMAT JSONCompact
will be added by default to every query.
You can change this behaviour by providing this option. In this case you should
add FORMAT JSONCompact
by yourself.false
FORMAT JSON
instead of FORMAT JSONCompact
for output.
By default (false), you'll receive array of values for each row. If you set dataObjects
to true, every row will become an object with format: {fieldName: fieldValue, …}
Query sends a statement to a server
Stream is a regular nodejs object stream, it can be piped to process records.
Stream events:
After response is processed, you can read a supplemental response data, such as
row count via stream.supplemental
.
Options are the same for query
and constructor
excluding connection.
Callback is optional and will be called upon completion with
a standard node (error, result)
signature.
Sends an empty query and check if it "Ok.\n"
FAQs
Yandex ClickHouse database interface
We found that @apla/clickhouse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.