Skip to content

Commit

Permalink
Create separate persistent-qq (fixes yesodweb#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Aug 26, 2018
1 parent 80fc94b commit 7c12ad4
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 9 deletions.
1 change: 1 addition & 0 deletions persistent-qq/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
persistent-qq.cabal
5 changes: 5 additions & 0 deletions persistent-qq/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog for persistent-qq

## 2.9.1

* Initial release, code separated from `persistent`
20 changes: 20 additions & 0 deletions persistent-qq/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions persistent-qq/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# persistent-qq

Provides `sqlQQ` and `executeQQ`.
7 changes: 7 additions & 0 deletions persistent-qq/Setup.lhs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env runhaskell

> module Main where
> import Distribution.Simple

> main :: IO ()
> main = defaultMain
25 changes: 25 additions & 0 deletions persistent-qq/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: persistent-qq
version: 2.9.1
synopsis: Provides a quasi-quoter for raw SQL for persistent
description: Please see README and API docs at <http://www.stackage.org/package/persistent>.
category: Database, Yesod
author: Michael Snoyman <[email protected]>
maintainer: Michael Snoyman <[email protected]>
license: MIT
github: yesodweb/persistent

extra-source-files:
- ChangeLog.md
- README.md

dependencies:
- base >= 4.7 && < 5
- persistent >= 2.9.1
- haskell-src-meta
- template-haskell
- text
- mtl

library:
ghc-options: -Wall
source-dirs: src
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-|
@since 2.7.2
@since 2.9.1
Module: module Database.Persist.Sql.Raw.QQ
Description: QuasiQuoters for performing raw sql queries
Expand Down Expand Up @@ -40,9 +40,8 @@ import Language.Haskell.TH.Quote
import Language.Haskell.Meta.Parse

import Database.Persist.Class (toPersistValue)
import Database.Persist.Sql.Raw (rawSql, rawQuery, rawQueryRes, rawExecute, rawExecuteCount)
import Database.Persist.Sql.Types (connEscapeName)
import Database.Persist.Sql.Orphan.PersistStore (getFieldName, getTableName)
import Database.Persist
import Database.Persist.Sql

data Token
= Literal String
Expand Down
1 change: 1 addition & 0 deletions persistent/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 2.9.1

* Added support for SQL isolation levels to via SqlBackend. [#812]
* Move `Database.Persist.Sql.Raw.QQ` to a separate `persistent-qq` package [#827](https://github.com/yesodweb/persistent/issues/827)

## 2.8.2

Expand Down
3 changes: 0 additions & 3 deletions persistent/Database/Persist/Sql.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module Database.Persist.Sql
, rawExecute
, rawExecuteCount
, rawSql
, sqlQQ
, executeQQ
, deleteWhereCount
, updateWhereCount
, transactionSave
Expand All @@ -31,7 +29,6 @@ import Database.Persist.Sql.Types.Internal (IsolationLevel (..))
import Database.Persist.Sql.Class
import Database.Persist.Sql.Run hiding (withResourceTimeout)
import Database.Persist.Sql.Raw
import Database.Persist.Sql.Raw.QQ
import Database.Persist.Sql.Migration
import Database.Persist.Sql.Internal

Expand Down
2 changes: 0 additions & 2 deletions persistent/persistent.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ library
, vector
, attoparsec
, template-haskell
, haskell-src-meta
, blaze-html >= 0.5
, blaze-markup >= 0.5.1
, silently
Expand Down Expand Up @@ -74,7 +73,6 @@ library
Database.Persist.Sql.Internal
Database.Persist.Sql.Types
Database.Persist.Sql.Raw
Database.Persist.Sql.Raw.QQ
Database.Persist.Sql.Run
Database.Persist.Sql.Class
Database.Persist.Sql.Orphan.PersistQuery
Expand Down
1 change: 1 addition & 0 deletions stack-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ packages:
- ./persistent-mysql
- ./persistent-postgresql
- ./persistent-redis
- ./persistent-qq

docker:
enable: true
Expand Down
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ packages:
- ./persistent-mysql
- ./persistent-postgresql
- ./persistent-redis
- ./persistent-qq
extra-deps:
- monad-logger-0.3.28.1
- mysql-simple-0.4.4
Expand Down

0 comments on commit 7c12ad4

Please sign in to comment.