1 ! Copyright (C) 2008 Slava Pestov, Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: concurrency.combinators db.pools db.sqlite db.tuples
4 db.types kernel math random threads tools.test db sequences
8 TUPLE: test-1 id a b c ;
11 { "id" "ID" INTEGER +db-assigned-id+ }
12 { "a" "A" { VARCHAR 256 } +not-null+ }
13 { "b" "B" { VARCHAR 256 } +not-null+ }
14 { "c" "C" { VARCHAR 256 } +not-null+ }
17 TUPLE: test-2 id x y z ;
20 { "id" "ID" INTEGER +db-assigned-id+ }
21 { "x" "X" { VARCHAR 256 } +not-null+ }
22 { "y" "Y" { VARCHAR 256 } +not-null+ }
23 { "z" "Z" { VARCHAR 256 } +not-null+ }
26 : sqlite-test-db ( -- db ) "test.db" <sqlite-db> ;
27 : test-db ( -- db ) "test.db" <sqlite-db> ;
29 : db-tester ( test-db -- )
40 f 100 random 100 random 100 random test-1 boa
47 : db-tester2 ( test-db -- )
57 f 100 random 100 random 100 random test-1 boa