(module sql-quote-unit mzscheme
(require (lib "etc.ss")
(lib "unitsig.ss")
(lib "list.ss" "srfi" "1")
(lib "string.ss" "srfi" "13")
(lib "vector-lib.ss" "srfi" "43"))
(require (file "../base.ss")
(file "../era.ss")
(file "../generic/sql-sig.ss")
(prefix generic: (file "../generic/sql-quote-unit.ss")))
(provide sql-quote@)
(define sql-quote@
(let ([mixin@
(unit/sig sql-quote^
(import (generic : sql-quote^))
(define (quote-id identifier)
(if (symbol? identifier)
(string-append "[" (symbol->string identifier) "]")
(string-append "[" identifier "]")))
(define quote-data generic:quote-data)
(define unquote-data generic:unquote-data)
(define (make-data-unquoter types)
(let ([types (list->vector types)])
(lambda (source)
(if source
(vector-map (lambda (index type val)
(unquote-data type val))
types
source)
#f))))
)])
(compound-unit/sig
(import)
(link (original : sql-quote^ (generic:sql-quote@))
(variation : sql-quote^ (mixin@ original)))
(export (open variation)))))
)