     string))
 
 (defmacro emacsql-with-vars (prefix &rest body)
-  "Evaluate BODY, collecting variables with `var' and `combine'.
+  "Evaluate BODY, collecting variables with `var', `combine', `expr', `idents'.
 BODY should return a string, which will be combined with variable
 definitions for return from a `emacsql-defexpander'."
   (declare (indent 1))
   `(let ((emacsql--vars ()))
-     (cl-letf (((emacsql-symbol-function 'var)
-                (symbol-function 'emacsql--vars-var))
-               ((emacsql-symbol-function 'combine)
-                (symbol-function 'emacsql--vars-combine)))
+     (cl-flet* ((var (thing kind) (emacsql--vars-var thing kind))
+                (combine (expanded) (emacsql--vars-combine expanded))
+                (expr (thing) (combine (emacsql--expr thing)))
+                (idents (thing) (combine (emacsql--idents thing))))
        (cons (concat ,prefix (progn ,@body)) emacsql--vars))))
-
-(declare-function combine nil (expanded))
-(declare-function var nil (thing kind))
 
 (defun emacsql--vector (vector)
   "Expand VECTOR, making variables as needed."

(emacsql-defexpander :set (set)
  (emacsql-with-vars "SET "
    (cl-etypecase set
      (vector (combine (emacsql--idents set)))
      (list (combine (emacsql--expr set))))))

(emacsql-defexpander :union ()
  (list "UNION"))

  (emacsql-with-vars "SELECT "
    (if (eq '* arg)
        "*"
      (idents arg))))

(emacsql-defexpander :from (table)
  "Expands to the FROM keyword."
