"select * from person" sql-query length
] with-db
] unit-test
+
+! You don't need a primary key
+USING: accessors arrays sorting ;
+TUPLE: things one two ;
+
+things "THINGS" {
+ { "one" "ONE" INTEGER +not-null+ }
+ { "two" "TWO" INTEGER +not-null+ }
+} define-persistent
+
+[ { { 0 0 } { 0 1 } { 1 0 } { 1 1 } } ] [
+ test.db [
+ things create-table
+ 0 0 things boa insert-tuple
+ 0 1 things boa insert-tuple
+ 1 1 things boa insert-tuple
+ 1 0 things boa insert-tuple
+ f f things boa select-tuples
+ [ [ one>> ] [ two>> ] bi 2array ] map natural-sort
+ things drop-table
+ ] with-db
+] unit-test
modifiers 0%
] interleave
- ", " 0%
- find-primary-key
- "primary key(" 0%
- [ "," 0% ] [ column-name>> 0% ] interleave
- "));" 0%
+ find-primary-key [
+ ", " 0%
+ "primary key(" 0%
+ [ "," 0% ] [ column-name>> 0% ] interleave
+ ")" 0%
+ ] unless-empty
+ ");" 0%
] query-make ;
M: sqlite-db-connection drop-sql-statement ( class -- statement )