Skip to content

Instantly share code, notes, and snippets.

@viperscape
Last active December 20, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viperscape/6135158 to your computer and use it in GitHub Desktop.
Save viperscape/6135158 to your computer and use it in GitHub Desktop.
information schema to defentity in korma
(defentity INFORMATION_SCHEMA.tables)
(def tables (map #(get % :TABLE_NAME)
(select 'INFORMATION_SCHEMA.tables (fields :TABLE_NAME)
(where {:TABLE_TYPE "BASE TABLE"})))) ;notice the quote
(prn tables)
;(map #(def %) tables) ;additional concept
(map #(defentity %) tables) ;not sure this is required anymore
(select (first tables))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment