Skip to content

Commit 97a3a87

Browse files
committed
Driver/Perl: Add dedicated page
1 parent 1d3251e commit 97a3a87

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

docs/_assets/icon/perl-logo.svg

Lines changed: 10 additions & 0 deletions
Loading

docs/connect/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,21 @@ CrateDB drivers and adapters for supported programming languages, frameworks, an
7373
{material-regular}`javascript;2em`
7474
::::
7575

76+
::::{grid-item-card} Perl
77+
:link: connect-perl
78+
:link-type: ref
79+
:link-alt: Connect to CrateDB using Perl
80+
:padding: 3
81+
:text-align: center
82+
:class-card: sd-pt-3
83+
:class-body: sd-fs-1
84+
:class-title: sd-fs-6
85+
```{image} /_assets/icon/perl-logo.svg
86+
:height: 40px
87+
```
88+
89+
::::
90+
7691
::::{grid-item-card} PHP
7792
:link: connect-php
7893
:link-type: ref
@@ -184,6 +199,7 @@ application
184199
185200
java
186201
javascript
202+
perl
187203
php
188204
python
189205
ruby

docs/connect/perl.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
(connect-perl)=
2+
3+
# Perl
4+
5+
:::{div} sd-text-muted
6+
Connect to CrateDB from Perl applications.
7+
:::
8+
9+
:::{rubric} About
10+
:::
11+
12+
[DBD::Pg] is the PostgreSQL database driver for the Perl DBI module.
13+
14+
:::{rubric} Synopsis
15+
:::
16+
17+
```shell
18+
cpan install DBD::Pg
19+
```
20+
```perl
21+
use DBI;
22+
use DBD::Pg qw(:pg_types);
23+
24+
$dbh = DBI->connect("dbi:Pg:host=localhost;port=5432;dbname=doc", "crate", "crate", {AutoCommit => 0});
25+
$sth = $dbh->prepare("SELECT region, mountain, height FROM sys.summits ORDER BY height DESC LIMIT 3");
26+
$sth->execute();
27+
28+
$rows = $sth->dump_results();
29+
print($rows);
30+
```
31+
32+
33+
[DBD::Pg]: https://metacpan.org/pod/DBD::Pg

0 commit comments

Comments
 (0)