/[Frey]/trunk/lib/Strix/User.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/Strix/User.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61 - (hide annotations)
Tue Jul 8 12:20:25 2008 UTC (15 years, 10 months ago) by dpavlin
File size: 618 byte(s)
how to dump column names
1 dpavlin 2 package Strix::User;
2    
3     use Strix::Schema;
4     use Fey::ORM::Table;
5    
6 dpavlin 4 use Data::Dump qw/dump/;
7 dpavlin 2
8 dpavlin 57 my $users_table = Strix::Schema->Schema()->table('users');
9 dpavlin 4
10 dpavlin 57 has_table( $users_table );
11    
12     my $select =
13     Strix::Schema->SQLFactoryClass()->new_select()
14     ->select( $users_table )
15     ->from( $users_table )
16     # ->where( $users_table->column('parent_message_id'), '=', Fey::Placeholder->new() )
17     ->order_by( $users_table->column('id'), 'DESC' )
18     ->limit(3)
19     ;
20    
21    
22     has_many 'rows' => (
23     table => $users_table,
24     select => $select,
25     # bind_params => sub { $_[0]->message_id() },
26     );
27    
28 dpavlin 61 #warn dump( map { $_->name } $users_table->columns );
29    
30 dpavlin 4 1;

  ViewVC Help
Powered by ViewVC 1.1.26