rmculpepper / sql

Embedding of some of SQL into Racket
33 stars 5 forks source link

does this pkg support `unquote-splicing`? #18

Open yanyingwang opened 5 years ago

yanyingwang commented 5 years ago

let's say I want to write code like this:

(define id-range '(1 10))

(select  id sd_id created_at updated_at 
            #:from users
            #:where (between-and id ,@id-range))

or like this:

(define columns '(id sd_id created_at updated_at))

(select ,@columns 
            #:from users
            #:where (= id 1))
rmculpepper commented 5 years ago

No, it doesn't, sorry. For the second example, you could use ScalarExpr:INJECT and turn the fields into a string (comma-separated) yourself.