| 
									
										
										
										
											2008-02-18 17:52:00 -05:00
										 |  |  | USING: kernel db.postgresql alien continuations io classes | 
					
						
							| 
									
										
										
										
											2008-12-17 22:04:17 -05:00
										 |  |  | prettyprint sequences namespaces tools.test db db.private | 
					
						
							| 
									
										
										
										
											2009-02-21 22:22:51 -05:00
										 |  |  | db.tuples db.types unicode.case accessors system db.tester ;
 | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  | IN: db.postgresql.tests | 
					
						
							| 
									
										
										
										
											2008-02-01 18:43:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  | os windows? cpu x86.64? and [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |     [ ] [ postgresql-test-db [ ] with-db ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-03 16:06:31 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ ] [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |         postgresql-test-db [ | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             [ "drop table person;" sql-command ] ignore-errors
 | 
					
						
							|  |  |  |             "create table person (name varchar(30), country varchar(30));" | 
					
						
							|  |  |  |                 sql-command | 
					
						
							| 
									
										
										
										
											2008-02-03 16:06:31 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             "insert into person values('John', 'America');" sql-command | 
					
						
							|  |  |  |             "insert into person values('Jane', 'New Zealand');" sql-command | 
					
						
							|  |  |  |         ] with-db | 
					
						
							|  |  |  |     ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-01 18:43:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             { "John" "America" } | 
					
						
							|  |  |  |             { "Jane" "New Zealand" } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     ] [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |         postgresql-test-db [ | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             "select * from person" sql-query | 
					
						
							|  |  |  |         ] with-db | 
					
						
							|  |  |  |     ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-01 18:43:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             { "John" "America" } | 
					
						
							|  |  |  |             { "Jane" "New Zealand" } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |     ] [ postgresql-test-db [ "select * from person" sql-query ] with-db ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-01 18:43:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ | 
					
						
							|  |  |  |     ] [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |         postgresql-test-db [ | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             "insert into person(name, country) values('Jimmy', 'Canada')" | 
					
						
							|  |  |  |             sql-command | 
					
						
							|  |  |  |         ] with-db | 
					
						
							|  |  |  |     ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-01 18:43:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             { "John" "America" } | 
					
						
							|  |  |  |             { "Jane" "New Zealand" } | 
					
						
							|  |  |  |             { "Jimmy" "Canada" } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |     ] [ postgresql-test-db [ "select * from person" sql-query ] with-db ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-01 18:43:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |         postgresql-test-db [ | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             [ | 
					
						
							|  |  |  |                 "insert into person(name, country) values('Jose', 'Mexico')" sql-command | 
					
						
							|  |  |  |                 "insert into person(name, country) values('Jose', 'Mexico')" sql-command | 
					
						
							|  |  |  |                 "oops" throw
 | 
					
						
							|  |  |  |             ] with-transaction | 
					
						
							|  |  |  |         ] with-db | 
					
						
							|  |  |  |     ] must-fail | 
					
						
							| 
									
										
										
										
											2008-02-03 16:06:31 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ 3 ] [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |         postgresql-test-db [ | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             "select * from person" sql-query length
 | 
					
						
							|  |  |  |         ] with-db | 
					
						
							|  |  |  |     ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-03 16:06:31 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ | 
					
						
							|  |  |  |     ] [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |         postgresql-test-db [ | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             [ | 
					
						
							|  |  |  |                 "insert into person(name, country) values('Jose', 'Mexico')" | 
					
						
							|  |  |  |                 sql-command | 
					
						
							|  |  |  |                 "insert into person(name, country) values('Jose', 'Mexico')" | 
					
						
							|  |  |  |                 sql-command | 
					
						
							|  |  |  |             ] with-transaction | 
					
						
							|  |  |  |         ] with-db | 
					
						
							|  |  |  |     ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-03 16:06:31 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |     [ 5 ] [ | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  |         postgresql-test-db [ | 
					
						
							| 
									
										
										
										
											2008-11-24 13:57:26 -05:00
										 |  |  |             "select * from person" sql-query length
 | 
					
						
							|  |  |  |         ] with-db | 
					
						
							|  |  |  |     ] unit-test | 
					
						
							|  |  |  | ] unless
 |