Wednesday, June 17, 2009

QueryLog support for Catalyst::Model::DBIC::Schema

well, I wrote Catalyst::Model::DBIC::Schema::QueryLog before. it's fine. it works.

mst released the new Catalyst::Model::DBIC::Schema today. built on top of Moose, with two traits: Caching and Replicated.
It reminds me to write Catalyst::TraitFor::Model::DBIC::Schema::QueryLog
trait is great. easy to read, configurable and sane.

Enjoy. Thanks

Labels: , ,

Wednesday, May 27, 2009

DBIx-Class talk

I just gave a DBIx-Class talk on the annual meeting of Zorpia 1 hour ago. it's not a success one, but I still want to share with you. check:

http://www.fayland.org/talks/2009_Zorpia_DBIx_Class/dbix-class.xul

Enjoy, Thanks.

Labels: ,

Sunday, May 24, 2009

manage Task::Padre::Plugins with ORDB::CPANTS

To update a Task:: module is not so hard but trivial. you need find out the new version of existing modules, and those haven't added yet.
well, do it manually is not so Perl-ish. we have Perl, we should do it automatically by running a script.

it's pretty good we have ORDB::CPANTS from Alias.
1, we get all plugins by ORDB::CPANTS through used_by
2, split them into requires and feature.
3, get the META info through YAML::LoadURI
4, generate the main part of Makefile.PL and Plugins.pm

you can find the code here: http://svn.perlide.org/padre/trunk/Task-Padre-Plugins/auto_generate.pl

I know I can generate Makefile.PL and Plugins.pm directly, but it's good enough for now.

Enjoy.

Labels:

Friday, May 22, 2009

Xi'an trip next week

We (Zorpia people) will hold an annual meeting next week in Xi'an.
It would be a lot of fan that I'll play basketball during the trip. 24 people from 4 different countries/regions.

if you're nearby, please drop by if you like it.

Thanks

Labels:

Tuesday, May 19, 2009

github instead of google code

yes. I do love github more than google code. it's not the problem of git or svn. svn is fine.

the point is participation.
In google code, it's very hard to contribute some code to one project if you're not the author. it disappoints me a lot.
The "fork" button in github is very helpful. people forked my repos then pull requests to ask me to merge (like perl-net-github, dist-zilla-plugin-repository). I forked someone's repos then pull back (like theschwartz-moosified, dist-zilla, git-pureperl etc).

it's awesome. go start using github right now. :)

Labels:

SuperCollider Programming

what the hell is SuperCollider Programming?

I'm glad that my blog is "Fayland and Perl Programming".

also I hate that blogger.com is blocked in China again. STUPID.
Tuesday, May 12, 2009

DBIx::Class::ResultSet::Void and TheSchwartz::Moosified

Big thanks to ribasushi, the new DBIx::Class::ResultSet::Void 0.04 is using
# SELECT 1 FROM item me WHERE ( me.id = ? ) LIMIT 1: '1'
# INSERT INTO item ( id, name) VALUES ( ?, ? ): '1', 'A'
instead of COUNT(*). it's much faster now.

Another big thanks to stash from socialtext, TheSchwartz::Moosified 0.04 with PostgreSQL support and bug fixes.

Enjoy!

Labels: , ,

Sunday, May 10, 2009

DBIx::Class::ResultSet::Void

some time I'm really feeling sick when I use update_or_create or find_or_create, the default DBIx::Class::ResultSet return DBIx::Class::Row object by using find.
it's useful when I need the $row object, but it's dummy if I don't care.

I wrote DBIx::Class::ResultSet::Void today. It would use count instead of find if not defined wantarray. it means when I call
$rs->find_or_create( { id => 1, name => 'A' } );
instead of
my $row = $rs->find_or_create( { id => 1, name => 'A' } );
it would generate SQLs like:
# SELECT COUNT( * ) FROM item me WHERE ( me.id = ? ): '1'
# INSERT INTO item ( id, name) VALUES ( ?, ? ): '1', 'A'
it's a little better I think.

read more on the POD and Enjoy!

Labels: ,