Skip to content

Instantly share code, notes, and snippets.

package org.pg;
import clojure.lang.Agent;
import clojure.lang.IFn;
import clojure.lang.IPersistentMap;
import clojure.lang.PersistentHashMap;
import org.pg.auth.MD5;
import org.pg.auth.ScramSha256;
import org.pg.clojure.LazyMap;
import org.pg.codec.EncoderBin;
com.github.igrishaev/pg2-migration "0.1.5-SNAPSHOT"
:description
"Migration utilities for PG2"
:plugins
[[lein-parent "0.3.8"]]
:dependencies
[[com.github.igrishaev/pg2-core]
{:aliases
{:migrations
{:extra-deps
{com.github.igrishaev/pg2-migration {:mvn/version "0.1.5-SNAPSHOT"}}
:extra-paths
["test/resources"]
:main-opts
["-m" "pg.migration.cli"
"-h" "127.0.0.1"
"-p" "10150"
pg.migration
> (-> "https://raw.githubusercontent.com/InteractiveAdvertisingBureau/vast/master/vast4macros/data/macros-data.json"
java.net.URL.
slurp
pg.json/read-string
type
)
clojure.lang.PersistentHashMap
pg.migration
> (-> "https://raw.githubusercontent.com/InteractiveAdvertisingBureau/vast/master/vast4macros/data/macros-data.json"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnterprisePoliciesEnabled</key>
<true/>
<key>AppAutoUpdate</key>
<false/>
<key>DisableAppUpdate</key>
<true/>
(for [_ all-colls]
(gensym "X"))
COLLS
(for [_ all-colls]
(gensym "COLL"))
N
(gensym "N")]
(defn pmap+
"
Like pmap but accepts a custom size of a parallel
window. Not lazy, returns a vector. Takes only
one collection of arguments at the moment.
"
[n func items]
(lazy-seq
(let [[head tail]
(split-at n items)]
(defn index-by
"Return a map where a key is (f item) and a value is item."
{:added "1.11"
:static true}
[f coll]
(persistent!
(reduce
(fn [ret x]
(assoc! ret (f x) x))
(transient {}) coll)))
(try
(let [result# (do ~@body)]
~(if rollback?
`(.rollback ~bind)
`(.commit ~bind))
result#)
(catch Throwable e#
(.rollback ~bind)
(throw e#)))
))
(defn command
[ctx {:keys [id]}]
(let [{:keys [aws
service-name
environment-name-lower]}
ctx