Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Revision history for Perl extension URI::db.

0.23
- Added URI::clickhouse. Thanks to Ilia Rassadin for the PR (#18).

0.22 2024-04-05T01:38:17Z
- Changed Oracle database DBI parameter generation as follows:
Expand Down
7 changes: 7 additions & 0 deletions lib/URI/clickhouse.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package URI::clickhouse;
use base 'URI::_odbc';
our $VERSION = '0.20';

sub default_port { 8123 }

1;
28 changes: 28 additions & 0 deletions t/dbi.t
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,34 @@ for my $spec (
dsn => 'dbi:Pg:host=foo;port=123;dbname=try;foo=1;foo=2;lol=yes',
dbi => [ [host => 'foo'], [port => 123], [dbname => 'try'] ],
qry => [ foo => 1, foo => 2, lol => 'yes' ],
uri => 'db:clickhouse:',
dsn => 'dbi:ODBC:',
dbi => [ [DSN => undef] ],
qry => [],
},
{
uri => 'db:clickhouse:dbadmin',
dsn => 'dbi:ODBC:DSN=dbadmin',
dbi => [ [DSN => 'dbadmin'] ],
qry => [],
},
{
uri => 'db:clickhouse://yow',
dsn => 'dbi:ODBC:Server=yow;Port=8123',
dbi => [ [Server => 'yow'], [Port => 8123], [Database => undef] ],
qry => [],
},
{
uri => 'db:clickhouse://yow:33',
dsn => 'dbi:ODBC:Server=yow;Port=33',
dbi => [ [Server => 'yow'], [Port => 33], [Database => undef] ],
qry => [],
},
{
uri => 'db:clickhouse://foo:123/try?foo=1&foo=2&lol=yes&Driver=ClickHouse',
dsn => 'dbi:ODBC:Server=foo;Port=123;Database=try;foo=1;foo=2;lol=yes;Driver=ClickHouse',
dbi => [ [Server => 'foo'], [Port => 123], [Database => 'try'] ],
qry => [ foo => 1, foo => 2, lol => 'yes', Driver => 'ClickHouse' ],
},
) {
my $uri = $spec->{uri};
Expand Down
1 change: 1 addition & 0 deletions t/engines.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ for my $spec (
[ cockroachdb => 26257, 'cockroach' ],
[ yugabyte => 5433, 'pg' ],
[ yugabytedb => 5433, 'pg' ],
[ clickhouse => 8123, 'clickhouse' ],
) {
my ($engine, $port, $canon) = @{ $spec };
my $prefix = "db:$engine";
Expand Down
Loading