Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns gist
- (:require [clojureql.core :as cql]))
- (def schema-tables
- (cql/select
- (cql/table *db* :information_schema.tables)
- (cql/where (= :table_schema "public"))))
- (def table-columns
- (cql/project
- (cql/table server/*db* :information_schema.columns)
- [:data_type]))
- (def table-desc
- (cql/join schema-tables table-columns :table_name))
- @table-desc
- ;; throws (PG), since column :table_schema is ambigous
- ;; current workaround is to write the WHERE clause as (= :tables.table_schema "public")
Add Comment
Please, Sign In to add comment