From d7170d520e6ba9b3f5376dd268b9f419a0dc9994 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 8 Feb 2006 16:20:37 +0000 Subject: tentativo di modello... la documentazione di DBIC fa un po' pena git-svn-id: svn://luxion/repos/IscrittiGroLUG/trunk@168 fcb26f47-9200-0410-b104-b98ab5b095f3 --- GroLUG/test_manuali/prova_db.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 GroLUG/test_manuali/prova_db.pl (limited to 'GroLUG/test_manuali') diff --git a/GroLUG/test_manuali/prova_db.pl b/GroLUG/test_manuali/prova_db.pl new file mode 100644 index 0000000..fcfc7bc --- /dev/null +++ b/GroLUG/test_manuali/prova_db.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl +use strict; +use warnings; +use GroLUG::M::DB; +use DateTime; + +#use Devel::TraceCalls;trace_calls { Package => [qw(DBIx::Class::Schema DBIx::Class::Storage::DBI)]}; + +my $schema=GroLUG::M::DB->connect('dbi:Pg:dbname=iscritti', + 'grolug', + '', + { RaiseError => 1, PrintError => 0, ShowErrorStatement => 1, TraceLevel => 0 }); + +my $iscritto=$schema->resultset('GroLUG::M::DB::Iscritto')->create({ + nome => '__tizio', + email => 'tizio@qui', +}); + +$iscritto->add_to_pagamenti({ + data_pagamento=>DateTime->now(), + data_iscrizione=>DateTime->now()->subtract(days=>10), + data_scadenza=>DateTime->now()->subtract(days=>10)->add(years=>1), + prezzo=>50}); + +$schema->commit(); -- cgit v1.2.3