-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the stress-test to get rid of call-with-context and call-with…
…-connection too
- Loading branch information
Peter Bex
committed
Apr 30, 2011
1 parent
e3bc5c8
commit 0e8350e
Showing
1 changed file
with
30 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
(use freetds sql-null) | ||
(define debug print) | ||
(include "test-freetds-secret.scm") | ||
(call-with-context | ||
(lambda (context) | ||
(call-with-connection | ||
context | ||
server | ||
username | ||
password | ||
(lambda (connection) | ||
(call-with-result-set | ||
connection | ||
"CREATE TABLE #harro (a VARCHAR(30), b VARCHAR(30), c VARCHAR(30), d VARCHAR(30), e VARCHAR(30), f VARCHAR(30))" | ||
(lambda (command) (debug (result-values context connection command)))) | ||
(for-each | ||
(lambda (i) | ||
(call-with-result-set | ||
connection | ||
"INSERT INTO #harro VALUES(?, ?, ?, ?, ?, ?)" | ||
i (+ i 1) (exact->inexact (+ i 2)) (->string (+ i 3)) (+ i 4) (sql-null) | ||
(lambda (command) (result-values context connection command)))) | ||
(iota (expt 2 10))) | ||
(call-with-result-set | ||
connection | ||
"SELECT a, b, c, d, e, f FROM #harro" | ||
(lambda (command) (debug (result-values context connection command)))) | ||
(call-with-result-set | ||
connection | ||
"SELECT a, b, c, d, e, f FROM #harro" | ||
(lambda (command) (debug (result-values context connection command)))) | ||
(call-with-result-set | ||
connection | ||
"SELECT a, b, c, d, e, f FROM #harro" | ||
(lambda (command) (debug (result-values context connection command)))))))) | ||
(define connection (make-connection server username password)) | ||
|
||
(call-with-result-set | ||
connection | ||
"CREATE TABLE #harro (a VARCHAR(30), b VARCHAR(30), c VARCHAR(30), d VARCHAR(30), e VARCHAR(30), f VARCHAR(30))" | ||
(lambda (command) (debug (result-values connection command)))) | ||
|
||
(for-each | ||
(lambda (i) | ||
(call-with-result-set | ||
connection | ||
"INSERT INTO #harro VALUES(?, ?, ?, ?, ?, ?)" | ||
i (+ i 1) (exact->inexact (+ i 2)) (->string (+ i 3)) (+ i 4) (sql-null) | ||
(lambda (command) (result-values connection command)))) | ||
(iota (expt 2 10))) | ||
|
||
(call-with-result-set | ||
connection | ||
"SELECT a, b, c, d, e, f FROM #harro" | ||
(lambda (command) (debug (result-values connection command)))) | ||
|
||
(call-with-result-set | ||
connection | ||
"SELECT a, b, c, d, e, f FROM #harro" | ||
(lambda (command) (debug (result-values connection command)))) | ||
|
||
(call-with-result-set | ||
connection | ||
"SELECT a, b, c, d, e, f FROM #harro" | ||
(lambda (command) (debug (result-values connection command)))) |