Code Monkey home page Code Monkey logo

perl-dbd-nuodb's Introduction

Perl DBI DBD Module for NuoDB

image

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

Requirements

  • 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.

Building

Run the following command to build the module:

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

Testing

The tests included with the module assume that a NuoDB database named test exists, with a DBA user dba and password goalie.

For details on starting and managing NuoDB databases, see the Documentation.

If you have not configured and started a NuoDB Broker on your host, do so:

DOMAIN_PWD=bird
printf '\ndomainPassword = '"$DOMAIN_PWD"'\n' | sudo tee -a "$NUODB_HOME"/etc/default.properties >/dev/null
sudo "$NUODB_HOME"/etc/nuoagent start

If you have already configured and started a NuoDB Broker, replace $DOMAIN_PWD with your domain password in the commands below.

Create a database test:

"$NUODB_HOME"/bin/nuodbmgr --broker localhost --password "$DOMAIN_PWD" \
    --command "start process sm database test host localhost archive /tmp/nuoarchive initialize true"
"$NUODB_HOME"/bin/nuodbmgr --broker localhost --password "$DOMAIN_PWD" \
    --command "start process te database test host localhost options '--dba-user dba --dba-password goalie'"

Once the database is running, test the module with:

make test

Be sure to shut down the database once your testing is complete:

"$NUODB_HOME"/bin/nuodbmgr --broker localhost --password "$DOMAIN_PWD" \
    --command "shutdown database database test"

Installing

Run the following commands to install the module:

sudo make install

Example

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();

Known Limitations

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

References

License

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

perl-dbd-nuodb's People

Contributors

czarlos avatar eresende-nuodb avatar madscientist avatar mjmichaels avatar philip-stoev avatar tvincentnuodb avatar vduda avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

perl-dbd-nuodb's Issues

Bad advice in README

The installation instructions says:

sudo perl -MCPAN -e 'force install DBI'

This is very bad practice because:

  • this will probably corrupt the packages handled by the system (usually on Linux systems). Instead, suggest to the user to use a local::lib-based environment.
  • force install is a bad practice. If DBI doesn't install, there is a good reason that must be fixed, either on the system or in DBI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.