Added a more useful README, and some example code.
This commit is contained in:
parent
0db29228cc
commit
8e92e9438d
4 changed files with 53 additions and 8 deletions
|
|
@ -1,6 +1,16 @@
|
|||
(ns squirrel-parse.core)
|
||||
(ns squirrel-parse.core
|
||||
(:require [squirrel-parse.parser :refer [parse]]
|
||||
[squirrel-parse.simplify :refer [simplify]]
|
||||
[squirrel-parse.to-adl :refer [to-adl]]))
|
||||
|
||||
(defn foo
|
||||
"I don't do a whole lot."
|
||||
[x]
|
||||
(println x "Hello, World!"))
|
||||
;;; This is get-you-started code.
|
||||
|
||||
(defn parsed-statements-from-file
|
||||
"Parses the file of SQL commands indicated by `filename`, and returns a sequence of parsed statements."
|
||||
[filename]
|
||||
(simplify (parse (slurp filename))))
|
||||
|
||||
(defn mappy-structure-from-file
|
||||
"Parses the file of SQL commands indicated by `filename`, and returns a more useful map of maps."
|
||||
[filename]
|
||||
(table-definitions-to-entities (parsed-statements-from-file filename)))
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
[clj-time.format :refer [formatters unparse]]
|
||||
[squirrel-parse.parser :refer [parse]]
|
||||
[squirrel-parse.simplify :refer [simplify]]
|
||||
;; [squirrel-parse.utils :refer [deep-merge]]
|
||||
[squirrel-parse.utils :refer [deep-merge]]
|
||||
))
|
||||
|
||||
|
||||
|
|
@ -288,6 +288,8 @@
|
|||
|
||||
|
||||
(defn to-adl-xml
|
||||
"Turn `object`, a fragment of the mappy sort of structure created
|
||||
by `table-definitions-to-entities`, into serialisable XML"
|
||||
[object]
|
||||
(cond
|
||||
(keyword? object)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue