Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 29 lines (18 sloc) 0.496 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
use v6;
use Test;

use Squerl;

unlink (my $file = 't/squerl/posts.db');
my $DB = Squerl.sqlite($file);

$DB.create_table: 'posts',
    'id' => 'primary_key',
    'user_id' => 'Int',
    'name' => 'String',
;

#my $posts = $DB<posts>;
my $posts = $DB.from('posts');

$posts.insert(0, 1, 'Hello Austria!');

ok $file ~~ :e, 'could create the database file';

my $number-of-posts = +$posts.all;

is $number-of-posts, 1, 'could insert and then retrieve a row';

done_testing;

unlink $file;
Something went wrong with that request. Please try again.