@ -56,12 +56,16 @@
( ( pair->sql pair )
( ( pair->sql pair )
( self ( car pair ) ( cdr pair ) ) )
( self ( car pair ) ( cdr pair ) ) )
( ( values vals )
( sprintf "(~A)"
( string-intersperse
( map ( lambda ( s )
( self 'ssql->sql s #t ) )
vals )
", " ) ) )
( ( vector->sql vec )
( ( vector->sql vec )
( format "(~A)"
( self 'values ( vector->list vec ) ) )
( string-intersperse
( map ( lambda ( s ) ( self 'ssql->sql s ) )
( vector->list vec ) )
", " ) ) )
( ( string->sql string )
( ( string->sql string )
( string-append "'" ( self 'escape-string string ) "'" ) )
( string-append "'" ( self 'escape-string string ) "'" ) )
@ -103,6 +107,14 @@
values )
values )
", " ) ) )
", " ) ) )
( ( insert ( ( 'into table ) ( 'columns columns . . . ) values . . . ) )
( sprintf "INSERT INTO ~A (~A) VALUES ~A"
table
( string-intersperse ( map symbol->string columns ) ", " )
( string-intersperse ( map ( lambda ( val )
( self ( car val ) ( cdr val ) ) )
values ) ", " ) ) )
( ( operator->sql type operator separator operands )
( ( operator->sql type operator separator operands )
( case type
( case type
( ( infix )
( ( infix )
@ -138,12 +150,17 @@
type ) ) )
type ) ) )
( else ( error "unknown operator syntax type" type ) ) ) )
( else ( error "unknown operator syntax type" type ) ) ) )
( ( ssql->sql ssql )
( ( ssql->sql ssql parenthesize? )
( let ( ( handler ( alist-ref ( list ssql ) ( self 'type->sql-converters ) apply ) ) )
( let ( ( handler ( alist-ref ( list ssql ) ( self 'type->sql-converters ) apply ) ) )
( if handler
( if handler
( self handler ssql )
( if ( and parenthesize? ( pair? ssql ) )
( sprintf "(~A)" ( self handler ssql ) )
( self handler ssql ) )
( error "unknown datatype" ssql ) ) ) )
( error "unknown datatype" ssql ) ) ) )
( ( ssql->sql ssql )
( self 'ssql->sql ssql #f ) )
( ( insert-clause clause ssql )
( ( insert-clause clause ssql )
( let ( ( order ( self 'clauses-order ) ) )
( let ( ( order ( self 'clauses-order ) ) )
( let loop ( ( ssql ssql ) )
( let loop ( ( ssql ssql ) )
@ -181,8 +198,6 @@
( distinct prefix )
( distinct prefix )
( all prefix )
( all prefix )
( values function )
( upper function )
( upper function )
( lower function )
( lower function )
( string-append infix "||" )
( string-append infix "||" )