summaryrefslogtreecommitdiff
path: root/GroLUG/test_manuali/prova_db.pl
diff options
context:
space:
mode:
Diffstat (limited to 'GroLUG/test_manuali/prova_db.pl')
-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();