
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
This Gem provides a simple way to query ClickHouse databases using the HTTP interface.
require 'logger'
require 'net/http'
ClickHouse::Client.configure do |config|
# Register your database(s)
config.register_database(:main,
database: 'default',
url: 'http://localhost:8123',
username: 'default',
password: 'clickhouse',
variables: { mutations_sync: 1 }
)
config.logger = Logger.new(STDOUT)
# Use any HTTP client to build the POST request, here we use Net::HTTP
config.http_post_proc = ->(url, headers, body) do
uri = URI.parse(url)
unless body.is_a?(IO)
# Append placeholders to URI's query
uri.query = [uri.query, URI.encode_www_form(body.except("query"))].compact.join('&')
end
request = Net::HTTP::Post.new(uri)
headers.each do |header, value|
request[header] = value
end
request['Content-type'] = 'application/x-www-form-urlencoded'
if body.is_a?(IO)
request.body_stream = body
else
request.body = body['query']
end
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
ClickHouse::Client::Response.new(response.body, response.code.to_i, response.each_header.to_h)
end
end
# Run some statements
puts ClickHouse::Client.select('SELECT 1+1', :main)
query = ClickHouse::Client::Query.new(raw_query: 'SELECT {number1:Int64} + {number2:Int64}', placeholders: { number1: 11, number2: 4 })
puts ClickHouse::Client.select(query, :main)
puts ClickHouse::Client.execute('CREATE TABLE IF NOT EXISTS t1 (id Int64) ENGINE=MergeTree PRIMARY KEY id', :main)
puts ClickHouse::Client.execute('DROP TABLE IF EXISTS t1', :main)
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Gitlab::Danger project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that click_house-client demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.