|
|
@ -6,7 +6,7 @@
|
|
|
|
(define *test-postgresql-translator*
|
|
|
|
(define *test-postgresql-translator*
|
|
|
|
(derive-object (*postgresql-translator* self super)
|
|
|
|
(derive-object (*postgresql-translator* self super)
|
|
|
|
((escape-string string)
|
|
|
|
((escape-string string)
|
|
|
|
(super (ssql-connection) string))))
|
|
|
|
(string-translate* string '(("'" . "''"))))))
|
|
|
|
|
|
|
|
|
|
|
|
(register-sql-engine! (lambda (x) (eq? x #t)) *test-postgresql-translator*)
|
|
|
|
(register-sql-engine! (lambda (x) (eq? x #t)) *test-postgresql-translator*)
|
|
|
|
|
|
|
|
|
|
|
@ -23,6 +23,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
(test "random()"
|
|
|
|
(test "random()"
|
|
|
|
"SELECT * FROM widgets ORDER BY RANDOM()"
|
|
|
|
"SELECT * FROM widgets ORDER BY RANDOM()"
|
|
|
|
(ssql->sql #t `(select (columns *) (from widgets) (order (random))))))
|
|
|
|
(ssql->sql #t `(select (columns *) (from widgets) (order (random)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(test "returning"
|
|
|
|
|
|
|
|
"INSERT INTO widgets VALUES ('foo', 'bar') RETURNING id, name"
|
|
|
|
|
|
|
|
(ssql->sql #t '(insert (into widgets) (values ("foo" "bar")) (returning id name)))))
|
|
|
|
|
|
|
|
|
|
|
|
(test-exit)
|
|
|
|
(test-exit)
|