[redland-dev] sqlite support/doc

Lauri Aalto laalto at gmail.com
Fri Nov 23 12:43:03 GMT 2007


On Nov 20, 2007 7:59 PM, Vincent Carey 525-2265
<stvjc at channing.harvard.edu> wrote:
> I'd like to put in a good word for sqlite support in redland
> and also to ask if there are examples/demos of its use --
> the exact details of a working librdf_new_storage call that
> will work with sqlite storage.   Thanks

Here's a C example:

  librdf_storage *storage = librdf_new_storage(world, "sqlite",
"database_file_name", "new='true',synchronous='normal'");

where

database_file_name is the path to the SQLite database file to be opened/created.

new='true' tells the storage module to create a new database file
(deleting any existing database with the same name). Other
possibilitiesfor the "new" option are 'yes', 'no' and 'false', and it
defaults to false/no.

synchronous='normal' specifies the SQLite database PRAGMRA SYNCHRONOUS
option. See http://www.sqlite.org/pragma.html#pragma_synchronous for
its documentation.


After you have created the storage you can use it with a librdf_model
practically like any other storage. Not all librdf_storage callback
functions are implemented and some are more buggy than others. But in
general, it works.

Lauri


More information about the redland-dev mailing list