Skip to content

nuodb/perl-dbd-nuodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perl DBI DBD Module for NuoDB

https://api.travis-ci.org/nuodb/perl-dbd-nuodb.png?branch=master

This project implements a NuoDB DBD Module for Perl DBI. This is a community-driven driver with limited support and testing from NuoDB.

  • Perl DBI module. Use your package manager, or else CPAN: sudo perl -MCPAN -e 'force install DBI'
  • NuoDB. This driver uses the Perl XS interface with the NuoDB client shared library.

If you install NuoDB using your package manager, replace $NUODB_HOME below with the standard path /opt/nuodb.

If you download the NuoDB tar file package, replace $NUODB_HOME below with the path to the unpacked directory. In this situation you don't need to use sudo to manage the NuoDB Broker.

Run the following command to build the module:

perl Makefile.PL --nuodb-libs="$NUODB_HOME/lib64" --nuodb-includes="$NUODB_HOME/include"

The tests included with the module assume that a NuoDB database is already running. If you don't have a NuoDB domain available you can create one using the Docker image on DockerHub. See Quick Start Guides / Docker.

The tests use the values of the environment variables NUODB_HOST, NUODB_DBNAME, NUODB_USER, and NUODB_PASSWORD to access the database. The default values for these variables if not set are localhost, test, dba, and goalie respectively.

Once the database is running, test the module with:

make test

Run the following commands to install the module:

sudo make install

Here is an example:

use DBI;
my $dbh = DBI->connect("dbi:NuoDB:$database\@$host:$port",
                       $username, $password, {schema => $schema});
my $sth = $dbh->prepare("SELECT 'one' FROM DUAL");
$sth->execute();
my ($value) = $sth->fetchrow_array();

The following features have been implemented:

  • DSNs in the form dbi:NuoDB:database@host:port?property=value
  • Schema selection via the "schema" handle attribute
  • Transactions, commit(), rollback() and the AutoCommit handle attribute
  • prepare(), execute(), fetch() as well as the combined convenience functions such as selectall_arrayref()

The following have not been implemented yet:

  • All result values are returned as strings regardless of the original data type
  • Metadata methods have not been implemented
  • Queries or bind values containing \0 will most likely be truncated
  • Windows has not been tested

The NuoDB DBI DBD driver is licensed under a BSD 3-Clause License.

Packages

 
 
 

Contributors