Skip to content

Commit

Permalink
[drafts] removed old Squirrel example, added new Squerl one
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Masak committed Sep 28, 2009
1 parent 756685b commit 9c16b38
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
29 changes: 29 additions & 0 deletions drafts/squerl-fruits
@@ -0,0 +1,29 @@
use v6;
use Squerl;

my $DB = Squerl.sqlite('example.db');

$DB.create_table: 'fruits',
'id' => 'primary_key',
'name' => 'String',
'qty' => 'Int',
;

my $fruits = $DB<fruits>;

my $i = 0;
for <apples pears oranges ninjas peaches papayas>
Z < 50 20 70 3 15 35> -> $name, $qty {

$fruits.insert($i++, $name, +$qty);
}

# those ninjas get in anywhere
$fruits.filter('name' => 'ninjas').delete;

# new shipment of pears
$fruits.filter('name' => 'pears').update('qty' => 40);

for $fruits.filter(sql_number('qty').gt(35)).llist {
say sprintf 'There are %d %s', .[2], .[1];
}
22 changes: 0 additions & 22 deletions drafts/squirrel-example

This file was deleted.

0 comments on commit 9c16b38

Please sign in to comment.