[Dbix-class] test DBD::SQLite 1.26_05 - foreign keys!

2009-10-15 Thread Darren Duncan

All,

I am pleased to announce that DBD::SQLite (Self Contained RDBMS in a Perl DBI 
Driver) version 1.26_05 has been released on CPAN (by Adam Kennedy).


  http://search.cpan.org/~adamk/DBD-SQLite-1.26_05/

This developer release bundles the brand-new SQLite version 3.6.19, which adds 
support for enforcing SQL foreign keys.  See http://sqlite.org/foreignkeys.html 
for the details of the foreign key support that SQLite now has.


Also be sure to look at the section http://sqlite.org/foreignkeys.html#fk_enable 
, because you have to enable a pragma on each connect to use the foreign keys 
feature; it isn't yet on by default for backwards compatibility purposes.


As I imagine many of you have been pining away for SQLite to support this 
feature for a long while, you'll want to dig in right away.


TESTING NEEDED!

Please bash the hell out of the latest DBD::SQLite and report any outstanding
bugs on RT.  Test your dependent or compatible projects with it, which includes
any DBMS-wrapping or object persistence modules, and applications.

And especially try actually using foreign keys with SQLite.

As the official release announcement says:  This release has been extensively 
tested (we still have 100% branch test coverage).  [The SQLite developers] 
consider this release to be production ready.  Nevertheless, testing can only 
prove the presence of bugs, not their absence.  So if you encounter problems, 
please let us know.


See also http://www.sqlite.org/changes.html for a list of everything else that 
changed in SQLite itself over the last few months.


If you want in to DBD::SQLite development, then join the following email/IRC
forums which MST created (the mailing list, I am administrating):

  http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbd-sqlite

  #dbd-sqlite on irc.perl.org

And the canonical version control is at:

  http://svn.ali.as/cpan/trunk/DBD-SQLite/

Patches welcome.  Ideas welcome.  Testing welcome.  Whining to /dev/null.

If you feel that a bug you find is in SQLite itself rather than the Perl DBI 
driver for it, the main users email forum for SQLite in general is at:


  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

... where you can report it as an appropriate list post (the SQLite issue 
tracking system is no longer updateable by the public; posting in the list can 
cause an update there by a registered SQLite developer).


Please do not reply to me directly with your responses.  Instead send them to
the forums or file with RT as is appropriate.

Thank you. -- Darren Duncan

P.S.  DBD::SQLite has at least 1 known bug, also in version 1.25, with regard to 
full-text search (FTS3); there is an included new failing test, which currently 
is set to skip so the CPAN testers don't issue fails, but the issue behind it 
should hopefully be fixed before the next DBD::SQLite release.  We decided that 
shipping DBD::SQLite now with the skipping test was preferable to waiting for 
that fix so you could get the new foreign keys feature the soonest.



___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


Re: [Dbix-class] create failures with has_one

2009-10-15 Thread Wallace Reis

On 15/10/2009, at 08:34, Dermot wrote:


2009/10/15 Wallace Reis wall...@reis.org.br:

On 14/10/2009, at 13:10, Dermot wrote:


my $record = {
'validation_pass' = 1,
'files' = [],
'active' = 1,
'name' = 'Gustav MR',
'clipdata' = [
{
  'contrib_id' = 2,
}
  ],
'contrib_id' = 2,
  };



Use a HashRef for clipdata rel instead of a ArrayRef.


Thanx for the replay.

Under ~/Class/ResultSet.pm#create it says use a Arrayref for has_one

Example of creating a new row and also creating rows in a related
has_many or has_one resultset. Note Arrayref.


Patches are welcome!


I think my problem was using update_or_create(). I think there are
differences between the what create() and what update_or_create()
expects. This might explain the Recursive update error I got as well.

At the moment I am using find_or_create() and that is working as  
expected.



There is no difference between those APIs, both update_or_create and  
find_or_create use -create.


--
   wallace reis/wreis Catalyst and DBIx::Class consultancy  
with a clue

   Software Engineer  and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
http://www.shadowcat.co.uk http://www.linkedin.com/in/wallacereis

___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk