ClickHouse - Database driver for Clickhouse OLAP Database
=head1 VERSION
Version 0.05
=head1 SYNOPSIS
ClickHouse - perl interface to Clickhouse Database. My final goal is to create DBI compatible driver for ClickHouse, but for now it's standalone module.
It's the first version and so module is EXPERIMENTAL. I can't guarantee API stability. More over, API will probably change and it will be soon.
This module is a big rough on the edges, but I decided to release it on CPAN so people can start playing around with it.
=head1 EXAMPLE
use ClickHouse;
my $ch = ClickHouse->new(
host => $ENV{'CLICK_HOUSE_HOST'}
port => 8123,
user => 'Frodo'
password => 'finger',
timeout => 5,
);
my $rows = $ch->select("SELECT id, field_one, field_two FROM some_table");
for my $row (@$rows) {
# Do something with your row
}
$ch->do("INSERT INTO some_table (id, field_one, field_two) VALUES",
[1, "String value", 38962986],
[2, "String value", 38962986],
);
=head1 SUBROUTINES/METHODS
=head2 new
Create new connection object
=head2 select
Fetch data from table. It returns a reference to an array that contains one reference per row (similar to DBI::fetchall_arrayref).
=head2 do
Modify data inside the database. It's universal method for any queries, which modify data. So if you want to create, alter, detach or drop table or partition or insert data into table it's your guy.