1 |
package Strix::User; |
2 |
|
3 |
use Strix::Schema; |
4 |
use Fey::ORM::Table; |
5 |
|
6 |
use Data::Dump qw/dump/; |
7 |
|
8 |
my $users_table = Strix::Schema->Schema()->table('users'); |
9 |
|
10 |
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 |
#warn dump( map { $_->name } $users_table->columns ); |
29 |
|
30 |
1; |