Changeset 10699 in project


Ignore:
Timestamp:
05/04/08 22:05:30 (12 years ago)
Author:
sjamaan
Message:

Implement (col ...)

Location:
release/3/ssql/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/3/ssql/trunk/ssql.scm

    r10696 r10699  
    6969                       ", "))
    7070
     71  ((col self resend ssql)
     72   (string-intersperse (map (lambda (colname)
     73                              (self 'ssql->sql (string->symbol (sprintf "~A.~A" (car ssql) colname))))
     74                            (cdr ssql))
     75                       ", "))
     76
    7177  ((join self resend ssql)
    7278   (match ssql
     
    147153  (let loop ((ssql ssql))
    148154    (match ssql
    149            (('col table col) `(col ,(alist-ref alias renamed eq? alias) ,col))
     155           (('col table cols ...) `(col ,(alist-ref alias renamed eq? alias) ,@col))
    150156           (('as table alias) `(as ,table ,(alist-ref alias renamed eq? alias)))
    151157           ((? colref? col)
  • release/3/ssql/trunk/tests/ansi-test.scm

    r10695 r10699  
    88      (ssql->sql #f `(select (columns actors.firstname actors.lastname)
    99                             (from actors))))
     10(test "Many columns"
     11      "(SELECT actors.id, actors.firstname, actors.lastname, roles.character, roles.movie_id (FROM actors roles))"
     12      (ssql->sql #f `(select (columns (col actors id firstname lastname) (col roles character movie_id))
     13                             (from actors roles))))
    1014(test "Joined query"
    1115      (string-append
  • release/3/ssql/trunk/tests/mysql-test.scm

    r10696 r10699  
    1616      (ssql->sql #t `(select (columns actors.firstname actors.lastname)
    1717                             (from actors))))
     18(test "Many columns"
     19      "(SELECT `actors`.`id`, `actors`.`firstname`, `actors`.`lastname`, `roles`.`character`, `roles`.`movie_id` (FROM `actors` `roles`))"
     20      (ssql->sql #f `(select (columns (col actors id firstname lastname) (col roles character movie_id))
     21                             (from actors roles))))
    1822(test-end "selects")
Note: See TracChangeset for help on using the changeset viewer.