ssql: move ssql-pgsql into a separate egg to remove the postgresql dependency and rename it to ssql-postgresql in the course to match with awful-postgresql and autoform-postgresql
git-svn-id: https://code.call-cc.org/svn/chicken-eggs/release/4/ssql/trunk@22911 fca3e652-9b03-0410-8d7b-ac86a6ce46c4master
parent
33c17eb471
commit
a05efe2ad3
@ -1,25 +0,0 @@
|
|||||||
;; Postgresql implementation of ssql
|
|
||||||
(module ssql-pgsql
|
|
||||||
|
|
||||||
(*pgsql-translator*)
|
|
||||||
|
|
||||||
(import chicken scheme)
|
|
||||||
(use ssql postgresql foops)
|
|
||||||
|
|
||||||
(define *pgsql-translator*
|
|
||||||
(let ((type->sql-converters
|
|
||||||
`((,boolean? . boolean->sql)
|
|
||||||
,@(*ansi-translator* 'type->sql-converters))))
|
|
||||||
|
|
||||||
(derive-object (*ansi-translator*)
|
|
||||||
((escape-string string)
|
|
||||||
(escape-string (ssql-connection) string))
|
|
||||||
|
|
||||||
((boolean->sql boolean)
|
|
||||||
(if boolean "'t'" "'f'"))
|
|
||||||
|
|
||||||
((type->sql-converters) type->sql-converters))))
|
|
||||||
|
|
||||||
(register-sql-engine! connection? *pgsql-translator*)
|
|
||||||
|
|
||||||
)
|
|
@ -1,18 +0,0 @@
|
|||||||
(load-relative "../ssql-pgsql")
|
|
||||||
(import ssql)
|
|
||||||
(import ssql-pgsql)
|
|
||||||
(use test postgresql foops)
|
|
||||||
|
|
||||||
(define *test-pgsql-translator*
|
|
||||||
(derive-object (*pgsql-translator* self super)
|
|
||||||
((escape-string string)
|
|
||||||
(super (ssql-connection) string))))
|
|
||||||
|
|
||||||
(register-sql-engine! (lambda (x) (eq? x #t)) *test-pgsql-translator*)
|
|
||||||
|
|
||||||
(test-begin "selects")
|
|
||||||
(test "Simple query"
|
|
||||||
"SELECT actors.firstname, actors.lastname FROM actors"
|
|
||||||
(ssql->sql #t `(select (columns actors.firstname actors.lastname)
|
|
||||||
(from actors))))
|
|
||||||
(test-end "selects")
|
|
Loading…
Reference in New Issue