summaryrefslogtreecommitdiff
path: root/GroLUG/test_manuali
diff options
context:
space:
mode:
authordakkar <dakkar@luxion>2006-02-08 16:20:37 +0000
committerdakkar <dakkar@luxion>2006-02-08 16:20:37 +0000
commitd7170d520e6ba9b3f5376dd268b9f419a0dc9994 (patch)
tree565357879a40bdf41683c3be2a95589dadc3b44a /GroLUG/test_manuali
parentschema database (diff)
downloadIscrittiGroLUG-d7170d520e6ba9b3f5376dd268b9f419a0dc9994.tar.gz
IscrittiGroLUG-d7170d520e6ba9b3f5376dd268b9f419a0dc9994.tar.bz2
IscrittiGroLUG-d7170d520e6ba9b3f5376dd268b9f419a0dc9994.zip
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
Diffstat (limited to 'GroLUG/test_manuali')
-rw-r--r--GroLUG/test_manuali/prova_db.pl25
1 files changed, 25 insertions, 0 deletions
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();