Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the RDF-Trine CPAN distribution.

Report information
The Basics
Id: 63865
Status: resolved
Priority: 0/
Queue: RDF-Trine

People
Owner: gwilliams [...] cpan.org
Requestors: jakob.voss [...] gbv.de
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.131
Fixed in: (no value)



Subject: Unfriendly creation of SQLite store
Creating an SQLite store could be easier. With SQLite you do not need username and password, and you can check to init the database, if the file does not exist yet. However just calling RDF::Trine::Store- Show quoted text
>new_with_string("DBI;;DBI:SQLite:filename=myfile.sqlite");
Results in the following errors: Use of uninitialized value $user in concatenation (.) or string at /usr/local/share/perl/5.10.0/RDF/Trine/Store/DBI.pm line 145. Use of uninitialized value $pass in concatenation (.) or string at /usr/local/share/perl/5.10.0/RDF/Trine/Store/DBI.pm line 145. DBD::SQLite::db prepare failed: no such table: Resources at /usr/local/share/perl/5.10.0/RDF/Trine/Store/DBI.pm line 572, <$fh> line 1. It would be nice to have a simple way to quickly create and use a SQLite store in one line of code. By the way: Why is there no simple RDF::Trine::Store->new( $hashref | $string )?
Jakob, Thanks for the feedback. On Mon Dec 13 04:58:10 2010, VOJ wrote: Show quoted text
> Creating an SQLite store could be easier. With SQLite you do not need > username and password, and you can check to init the database, if the > file does not exist yet. However just calling > > RDF::Trine::Store-
> >new_with_string("DBI;;DBI:SQLite:filename=myfile.sqlite");
> > Results in the following errors: > > Use of uninitialized value $user in concatenation (.) or string at > /usr/local/share/perl/5.10.0/RDF/Trine/Store/DBI.pm line 145. > Use of uninitialized value $pass in concatenation (.) or string at > /usr/local/share/perl/5.10.0/RDF/Trine/Store/DBI.pm line 145. > DBD::SQLite::db prepare failed: no such table: Resources at > /usr/local/share/perl/5.10.0/RDF/Trine/Store/DBI.pm line 572, <$fh> line > 1.
Yes, I agree this is rather a mess. I've made changes to silence the uninitialized warnings, and I've already got changes applied to the code that uses DBI to automatically initialize a database if it doesn't already exist (which should take care of the DBD error). These changes will appear in the next release of RDF::Trine, version 0.132. Show quoted text
> It would be nice to have a simple way to quickly create and use a SQLite > store in one line of code. By the way: Why is there no simple > RDF::Trine::Store->new( $hashref | $string )?
I agree, that would be an easier interface. I'll work on a patch to allow this, and it will hopefully also appear in the next release. thanks again, .gregory williams
Show quoted text
> These changes will appear in the next release of RDF::Trine, version > 0.132.
Great. I further simplified usage by extending RDF::Trine::Mode::new: my $model = RDF::Trine::Model->new( $config ); if $config is not blessed, s a shorthand for: my $model = RDF::Trine::Model->new( RDF::Trine::Store->new( $config ) ); The documentation could use some more examples, but I better add them instead of complaining :-) I prefer to hyperlink modules with L<...> in the POD for better browse-ability. Jakob