Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 18 lines (13 sloc) 0.314 kb
68c15a6 Carl Mäsak [Viper] early prototype ORM
authored
1 use v6;
2 use Viper;
3
4 class User is Viper::Base {
5 }
6
7 class Post is Viper::Base {
8 has $user_id is persisted;
9 }
10
11 class Comment is Viper::Base {
12 has $user_id is persisted;
13 }
14
15 my $session = Viper.new( :types[User, Post, Comment], :db('data/') );
16 my Post @posts = Post.find($session, :all);
17 say .name for @posts;
Something went wrong with that request. Please try again.