Perl
と ミルキィホームズ
が好きですdelete_cascade()
というメソッドが使えるようになるuse Otogiri;
use Otogiri::Plugin;
my $db = Otogiri->new( connect_info => ["dbi:SQLite:dbname=$dbfile", '', '', { RaiseError => 1, PrintError => 0 }] );
$db->load_plugin('DeleteCascade');
$db->delete_cascade('person', { id => $person_id }); # delete_cascade が使えるようになる
use Otogiri::Plugin;
して、@EXPORT に提供したいメソッド名を書いて、それを実装するだけsearch_named
/do_named
)tsucchi@surreal[620]$ reply
reply@surreal.local[0]>
reply@surreal.local[1]> 1 + 1
$res[0] = '2'
reply@surreal.local[2]> $a = 123
$res[1] = '123'
reply@surreal.local[3]> $b = 456
$res[2] = '456'
reply@surreal.local[4]> $a + $b
$res[3] = '579'
reply@surreal.local[5]> rand()
$res[4] = '0.0647113826862586'
reply@surreal.local[6]> exit
% reply-service1
1> Select('detective', { id => 1 });
$res[1] = {
id => 1,
name => 'シャーロック・シェリンフォード',
age => 15,
toys => 'サイコキネシス',
birthday => '3/31',
}
こういうのが...
1> Select('detective', { id => 1 });
$res[1] = {
id => 1,
name => "\x{30b7}\x{30e3}\x{30fc}\x{30ed}\x{30c3}\x{30af}\x{30fb}\x{30b7}\x{30a7}\x{30ea}\x{30f3}\x{30d5}\x{30a9}\x{30fc}\x{30c9}",
age => 15,
toys => "\x{30b5}\x{30a4}\x{30b3}\x{30ad}\x{30cd}\x{30b7}\x{30b9}",
birthday => '3/31',
}
こうなる。超便利!
1> Select('detective', { id => 1 });
$res[1] = {
id => 1,
name => 'シャーロック・シェリンフォード',
age => 15,
toys => 'サイコキネシス',
birthday => '3/31',
}
Use a spacebar or arrow keys to navigate