-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create executable and cabal file #4
base: master
Are you sure you want to change the base?
Conversation
…lock HACK this is extremely hacky but is done b/c in one project I have multiple statements inside a single block for running migrations
Merge upstream changes
@@ -16,4 +16,3 @@ cabal.sandbox.config | |||
*.hp | |||
*.eventlog | |||
.stack-work/ | |||
cabal.project.local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIX (accident)
@@ -0,0 +1,25 @@ | |||
name: postgresql-simple-query-validator | |||
version: 0.1.0.0 | |||
github: "assertible/assertible" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIXME (whoops)
postgresql-simple-query-validator: | ||
main: validateSql.hs | ||
ghc-options: | ||
- -threaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO turn off all except threaded and warnings
@@ -1,33 +1,36 @@ | |||
#!/usr/bin/env stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE this should "call out" to another Lib.hs
style package for maximum portability, can probably be avoided for now. If not refactored, keep the shebang for backwards compatibility & document.
@joncfoo Are you interested in the changes here? I can certainly make updates to your taste. I personally think this is a good candidate for Hackage, and I can maintain/help maintain. |
results <- zipWithM fn queries [B.pack $ "stmt" ++ show x | x <- [1..]] | ||
forM_ (zip queries results) $ \case | ||
results <- zipWithM fn queries [B.pack $ "stmt" ++ show x | x <- [(1::Int)..]] | ||
let cleanResults = filter ((/=) (Left "ignore")) results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE - this isn't really required in this initial change. It's my personal change to "ignore" quasi quoters with multiple statements.
Initially, I could remove this. In a subsequent PR, I can make it a proper flag.
🚧 do not merge yet 🚧
I've been using this utility for a while and have had a fork of it. I wanted to create a PR in case someone else finds it useful.
I can add an optiion for the multi-command ignore if you like the rest of the PR.
The exit code 255, which can also be a flag, is used by
xargs
to stop on the first failure.