(in-package :s-sql) (def-sql-op :vacuum (&rest args) (split-on-keywords ((vars * ?) (full - ?) (freeze - ?) (verbose - ?) (analyze - ?)) (cond ((null args) nil) ((and (listp args) (keywordp (first args))) args) (t (cons :vars args))) `("VACUUM " ,@(if full '("FULL ")) ,@(if freeze '("FREEZE ")) ,@(if verbose '("VERBOSE ")) ,@(if analyze '("ANALYZE ")) ,@(sql-expand-list vars)))) #| (sql (:vacuum)) (sql (:vacuum :full)) (sql (:vacuum :analyze)) (sql (:vacuum 't0 :full)) (sql (:vacuum 't0 'c0 'c1)) (sql (:vacuum 't0 :analyze)) (sql (:vacuum 't0 'c0 :analyze)) (sql (:vacuum :full :freeze :verbose :analyze)) (sql (:vacuum 't0 'c0 'c1 :full :freeze :verbose :analyze)) |# (def-sql-op :analyze (&rest args) (split-on-keywords ((vars * ?) (verbose - ?)) (cond ((null args) nil) ((and (listp args) (keywordp (first args))) args) (t (cons :vars args))) `("ANALYZE " ,@(if verbose '("VERBOSE ")) ,@(sql-expand-list vars)))) #| (sql (:analyze)) (sql (:analyze 't0)) (sql (:analyze 't0 'c0)) (sql (:analyze 't0 'c0 'c1)) (sql (:analyze :verbose)) (sql (:analyze 't0 :verbose)) (sql (:analyze 't0 'c0 :verbose)) (sql (:analyze 't0 'c0 'c1 :verbose)) |#