diff --git a/README.md b/README.md index ad6450e..80a1356 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,13 @@ structures, for automatic generation of things like This is not production ready code as yet. Nevertheless if you want a sensible entry point, look at the two example functions in `squirrel-parse.core`. +If you want to do something actually a bit useful, try the function +`squirrel-parse.to-hugsql-queries/migrations-to-queries-sql` + +This, given a [Migratus](https://github.com/yogthos/migratus) migrations directory will generate a +[HugSQL](https://www.hugsql.org/) `queries.sql` file which, while it's not +perfect, gets you a very long way. ## Status diff --git a/src/squirrel_parse/core.clj b/src/squirrel_parse/core.clj index d27c830..00e124d 100644 --- a/src/squirrel_parse/core.clj +++ b/src/squirrel_parse/core.clj @@ -1,7 +1,8 @@ (ns squirrel-parse.core (:require [squirrel-parse.parser :refer [parse]] [squirrel-parse.simplify :refer [simplify]] - [squirrel-parse.to-adl :refer [table-definitions-to-entities]])) + [squirrel-parse.to-adl :refer [table-definitions-to-entities]] + [squirrel-parse.to-hugsql-queries :refer [migrations-to-queries-sql]])) ;;; This is get-you-started code. @@ -14,3 +15,5 @@ "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))) + +