#!/usr/bin/perl -w
use strict;
use DBI;      # <-- STEP 1
use Tangram;  #
use Employee qw($schema); # <-- STEP 2

# Connect to the schema. <-- STEP 3
my $dsn  = "dbi:mysql:database=employees";
my $user = "demo";
my $pass = "open_sesame";
my $storage =
    Tangram::Storage->connect($schema, $dsn, $user, $pass);

# Create an employee. <-- STEP 4
my $empl1 = new Employee("Brian");

# Invoke some methods. <-- STEP 5
$empl1->set_title("Fry Master");
$empl1->raise(16000);

# Save the object. <-- STEP 6
$storage->insert($empl1);

# Add another employee.
my $empl2 = new Employee("Raoul Frodus");
$empl2->set_title("Social Saboteur");
$empl2->raise(13000);
$storage->insert($empl2);