NAME

Catalyst::Model::Sedna - Access the Sedna XML Database

SYNOPSIS

package MyApp::Model::Sedna;
use base 'Catalyst::Model::Sedna;
__PACKAGE__->config({ url => 'localhost',
                      db_name => 'mydb',
                      user => 'myuser',
                      password => 'password' });

# later in your application
my $s = $c->model('Sedna');
$s->execute('for $x in document("doc123") return $x');
if (my $item = $s->get_item()) {
  $c->res->content_type('application/xml');
  $c->res->body($item);
}

DESCRIPTION

This module will manage a connection to the sedna database and perform queries. The connection attributes are set in the config file. Note that the Sedna connection does not support cursors, so if you need to insert data while traversing another query, you need a second connection.

METHODS

conn

Returns the Sedna connection object.

execute/begin/rollback/getData/next/commit

Methods handled directly by the connection.

get_item

This is a convenience method that will see if there is a next item available in the connection and already fetches the entire result to a scalar value.

get_document($id)

This method will do a simple query to fetch a document by its id and return its content.

store_document($xml, $id, $collection)

This method will load the xml data sent into a document of the given id. Optionally a collection can be sent.

SEE ALSO

See the Sedna documentation, and also the Sedna bindings.

AUTHOR

Daniel Ruoso, <daniel@ruoso.com>

COPYRIGHT AND LICENSE

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 117:

You forgot a '=back' before '=head1'