From 9dfb01510d2c9e5924c68648c79c83d3a2ed17ba Mon Sep 17 00:00:00 2001 From: syn Date: Fri, 25 Feb 2011 22:20:22 +0000 Subject: [PATCH] ssql: add ssql-pgsql (whoops) git-svn-id: https://code.call-cc.org/svn/chicken-eggs/release/4/ssql/trunk@22896 fca3e652-9b03-0410-8d7b-ac86a6ce46c4 --- ssql-pgsql.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ssql-pgsql.scm diff --git a/ssql-pgsql.scm b/ssql-pgsql.scm new file mode 100644 index 0000000..0298e62 --- /dev/null +++ b/ssql-pgsql.scm @@ -0,0 +1,25 @@ +;; 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*) + +) \ No newline at end of file