clj-liquibase icon indicating copy to clipboard operation
clj-liquibase copied to clipboard

documentation for preconditions in EDN

Open timclemons opened this issue 9 years ago • 3 comments
trafficstars

Having an example or two of how to create preconditions, including onFail actions, would be extremely helpful.

timclemons avatar Apr 29 '16 21:04 timclemons

Any thoughts on this? Should this project still be considered under development?

timclemons avatar Aug 24 '16 20:08 timclemons

@timclemons Hi, and sorry for a late reply. I would welcome a pull request to include a pre-conditiion example. I have had limited time of late, but I will try to gather some time for this in case I don't see any pull request.

kumarshantanu avatar Aug 25 '16 10:08 kumarshantanu

I'm certainly willing to submit a pull request, but at the moment I'm trying to reverse engineer how exactly preconditions work in an EDN file.

There's one example file I found with a commented precondition at liquibase-edn:

https://github.com/kumarshantanu/liquibase-edn/blob/master/src/test/resources/example.edn

There it has the following:

"preConditions" [{"runningAs" {"username" "liquibase"}}]}

Presumably, the camel case string keys can be replaced with hypen-separated keywords:

:pre-conditions [{:running-as {:username "liquibase"}}]

Still trying to confirm the above works, as it doesn't throw any exceptions in the parser, but still doesn't seem to perform a precondition check. I'm also trying to fill in how the following use cases are structured in EDN:

  • and, or, and not as applied to conditions
  • precondition attributes such as onFail, onError, onUpdateSQL, onFailMessage and onErrorMessage

Any insight would be very much appreciated.

timclemons avatar Aug 25 '16 15:08 timclemons