Thanks again:
sri,
using DBI i can do the following:
# Insert a two rows
my $qry = $db->prepare('insert into names (name) values (?);');
$qry->execute('Sara');
$qry->execute('Stefan');
to do the same with Mojo::Pg or Mojo::mysql I need to do the following:
# Insert a two rows
my $db = $pg->db;
$db->query('insert into names (name) values (?)', 'Sara');
$db->query('insert into names (name) values (?)', 'Stefan');
My obesrvations are:
1. The DBI version clearly only prepares the statement once then can
execute the statement as many times as is desired.
2. I don't know how many times the Mojo::Pg version is preparing the
statement so it may be less efficient than DBI?
3. The DBI version DRY and the Mojo::Pg version isn't, the sql statement is
repeated (i guess this could be overcome by storing the query string in a
scalar).
What do you think?
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.