Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (13 sloc) 314 Bytes
use v6;
use Viper;
class User is Viper::Base {
}
class Post is Viper::Base {
has $user_id is persisted;
}
class Comment is Viper::Base {
has $user_id is persisted;
}
my $session = Viper.new( :types[User, Post, Comment], :db('data/') );
my Post @posts = Post.find($session, :all);
say .name for @posts;