Sedna - Driver to connect on the Sedna XML database
use Sedna; my $conn = Sedna->connect($url,$dbname,$login,$pass); $conn->execute("for $x in collection('my-collection') return $x"); while ($conn->next) { my ($buf, $xml); while ($conn->getData($buf, 512)) { $xml .= $buf; } say $xml; }
Sedna is a XML database and you interact with it using XQuery. This driver is a direct mapping of the C driver available in the Sedna distribution, but the code is brought here since they only provide a static build of the library.
This module will croak on failures, so error handling should be implemented in terms of eval.
This method is used to stablish a new connection.
This method can be used to set various connection attribute parameters. This method is a convenience method for each of the setConnectionAttr_* methods. Note that you should use the Sedna constants when you send the values for that attributes, even if the attribute looks simply as a boolean value.
Returns a hash with the values for all the requested options. This is just a convenience method for each of the getConnectionAttr_* methods.
Accessors for the autocommit setting for this connection. The possible values for this attribute are SEDNA_AUTOCOMMIT_ON and SEDNA_AUTOCOMMIT_OFF.
This attribute defines the local directory to be used as a base path for LOAD statements.
This enables or disable debug messages of the driver. Possible values are SEDNA_DEBUG_ON and SEDNA_DEBUG_OFF.
This define the nivel of concurrency control applied to this specific transaction. One of: SEDNA_READONLY_TRANSACTION and SEDNA_UPDATE_TRANSACTION.
This defines the number of seconds to wait for an execution.
This controls how much data is allowed to be returned by the server in bytes.
This control how much log the transaction will produce. Values are SEDNA_LOG_FULL and SEDNA_LOG_LESS.
This three methods implement the transaction control.
Returns the current connection status.
Returns the current transaction status.
Sends the given query to the server and waits (blocking) for its return.
Sends the query stored in the given file and waits (blockign) for its return.
Returns true if there is another value available, and advance the cursor.
Works like the read function, storing up to the requested length into the scalar buffer.
Send the xml string to the server for storing using the given document id and optionally storing in a collection.
Send to the server the notice that you finished sending the data.
The development of the bindings is hosted at http://github.com/ruoso/sedna. It was based on the quick start guide at http://www.modis.ispras.ru/sedna/c-samples.html.
Daniel Ruoso <daniel@ruoso.com>
Copyright (C) 2010 by Daniel Ruoso
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
The code for the C driver is embeded into this distribution and is subject to the Apache License.
To install Sedna, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sedna
CPAN shell
perl -MCPAN -e shell install Sedna
For more information on module installation, please visit the detailed CPAN module installation guide.