Discussion:
For your encouragement
(too old to reply)
Simon Cozens
2008-12-05 10:13:56 UTC
Permalink
I just ran this code, which worked with the expected results:

use DBDI;
my $conn = DBDI::DriverManager.getConnection("dbdi:SQLite3:test.db", "",
"");
my $stm = $conn.createStatement();
my $rs = $stm.executeUpdate("CREATE TABLE foo (bar, baz)");

my $stm = $conn.prepareStatement("INSERT INTO foo (bar, baz) VALUES (?,
?)");
$stm.setColumn(1, 123);
$stm.setColumn(2, "Thingy");
$stm.executeUpdate();

Merry Christmas,
Simon
Andy Lester
2008-12-05 15:10:14 UTC
Permalink
Beautiful. Posted to Perlbuzz.

http://perlbuzz.com/2008/12/database-access-in-perl-6-is-coming-along-nicely.html

xoa

--
Andy Lester => ***@petdance.com => www.petdance.com => AIM:petdance
Geoffrey Broadwell
2008-12-05 19:11:30 UTC
Permalink
Post by Andy Lester
Beautiful. Posted to Perlbuzz.
http://perlbuzz.com/2008/12/database-access-in-perl-6-is-coming-along-nicely.html
Someone needs to reply to the comments from readers who have confused
DBI and DBDI, and have thus decided we are turning Perl into Java.

I can't, because as Perlbuzz oh-so-helpfully tells me when I try to
submit my comment: "Registration is required." With no indication how
to actually do so.


-'f
Andy Lester
2008-12-05 19:13:00 UTC
Permalink
Post by Geoffrey Broadwell
I can't, because as Perlbuzz oh-so-helpfully tells me when I try to
submit my comment: "Registration is required." With no indication how
to actually do so.
You have to have JavaScript turned on. Sorry that the message sucks.
It's on my to-do list to fix.

--
Andy Lester => ***@petdance.com => www.petdance.com => AIM:petdance
Geoffrey Broadwell
2008-12-05 21:41:33 UTC
Permalink
Post by Andy Lester
Post by Geoffrey Broadwell
I can't, because as Perlbuzz oh-so-helpfully tells me when I try to
submit my comment: "Registration is required." With no indication how
to actually do so.
You have to have JavaScript turned on. Sorry that the message sucks.
It's on my to-do list to fix.
OK, that's fair enough -- but why does submitting a dead simple form
require JavaScript?

Hmmm, maybe I should be taking this up with the MT developers. Are you
running a current enough rev that it's likely still a problem? (I don't
want to go through the trouble of installing a local MT just to check
that. :-)


-'f
Andy Lester
2008-12-05 22:00:29 UTC
Permalink
Post by Geoffrey Broadwell
OK, that's fair enough -- but why does submitting a dead simple form
require JavaScript?
Got me.
Post by Geoffrey Broadwell
Hmmm, maybe I should be taking this up with the MT developers. Are you
running a current enough rev that it's likely still a problem? (I don't
want to go through the trouble of installing a local MT just to check
that. :-)
No, I'm not current.

xoa

--
Andy Lester => ***@petdance.com => www.petdance.com => AIM:petdance
Andy Lester
2008-12-06 00:37:52 UTC
Permalink
It's Perl people, Geoffrey. You tell them that you've made a racing
car
out of old biscuit tins, they'll tell you that you painted it the
wrong
colour.
s/Perl//;

But I agree with you, it's frustrating that that's what people choose
to see.

xoxo,
Andy

--
Andy Lester => ***@petdance.com => www.petdance.com => AIM:petdance
Ben. B.
2008-12-06 01:26:13 UTC
Permalink
s/racing car/bike shed/
Post by Simon Cozens
It's Perl people, Geoffrey. You tell them that you've made a racing car
Post by Simon Cozens
out of old biscuit tins, they'll tell you that you painted it the wrong
colour.
s/Perl//;
But I agree with you, it's frustrating that that's what people choose to
see.
xoxo,
Andy
--
Alvar Freude
2008-12-06 16:22:57 UTC
Permalink
Hi,
Post by Simon Cozens
But I agree with you, it's frustrating that that's what people choose to
see.
I think, everyone is very happy about the progress and a database interface.

But on the other side, the majority only see the interface, and this
doesn't look very perlish. So its obvious, that there will be complaints.

You should read this complaints as encouragement, not as grumbling.


DBI is one of the most important modules for Perl 5, even lots of people
who don't know how to use CPAN use it. I think, that this will be the
same for DBDI.

Therefore it should be a good model for every Perl 6 developer. And it
should use the same naming conventions which are usual for Perl 6.


I don't know if there are some naming conventions for Perl 6 released
yet, if not I strongly recommend to take this ones who are common for
Perl 5. In other words: let's take them from Perl Best Practices.

This means: method/subroutine names in small letters and words separated
by an underline. And don't be too verbose by default.


Even the Perl 5 core modules are not consistent: Data::Dumper has a
"Dumper" sub, File::Temp a "tempfile". Perl 6 should not have such
penalties.


Yes, it would be possible to build an DBI style wrapper around DBDI; but
I think it should have by default an optimal interface which is also
optimised for performance. e.g. calling one method for each bind
parameter looks not like the best performance ... ;-)

But it seems not to be a big problem to add some sugar methods inside
DBDI; so I am confident, that we will get an interface, which is not
worse then the DBI one.


Nevertheless: The internal use of the JDBC interface seems to me a good
choice, because this (hopefully) reduces the complexity to create new
drivers.



Ciao
Alvar
--
** Alvar C.H. Freude, http://alvar.a-blast.org/
** http://www.assoziations-blaster.de/
** http://www.wen-waehlen.de/
** http://www.perl-blog.de/
Simon Cozens
2008-12-06 00:33:23 UTC
Permalink
Post by Geoffrey Broadwell
Someone needs to reply to the comments from readers who have confused
DBI and DBDI, and have thus decided we are turning Perl into Java.
It's Perl people, Geoffrey. You tell them that you've made a racing car
out of old biscuit tins, they'll tell you that you painted it the wrong
colour.
--
The course of true anything never does run smooth.
-- Samuel Butler
Loading...