Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

creichert
Copy link

🚧 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.

@creichert creichert changed the title Create executable Create executable and cabal file Sep 14, 2018
@@ -16,4 +16,3 @@ cabal.sandbox.config
*.hp
*.eventlog
.stack-work/
cabal.project.local
Copy link
Author

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"
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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.

@creichert
Copy link
Author

@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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant