mirror of
https://github.com/nikita-volkov/hasql.git
synced 2024-12-25 11:11:36 +03:00
Init
This commit is contained in:
commit
02015ca5e3
10
.travis.yml
Normal file
10
.travis.yml
Normal file
@ -0,0 +1,10 @@
|
||||
language: haskell
|
||||
|
||||
ghc:
|
||||
- 7.6
|
||||
- 7.8
|
||||
|
||||
install:
|
||||
- cabal install happy # a "haskell-src-exts" implicit dependency workaround
|
||||
- cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls
|
||||
|
22
LICENSE
Normal file
22
LICENSE
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2014, Nikita Volkov
|
||||
|
||||
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.
|
55
high-sql.cabal
Normal file
55
high-sql.cabal
Normal file
@ -0,0 +1,55 @@
|
||||
name:
|
||||
high-sql
|
||||
version:
|
||||
0.1.0
|
||||
synopsis:
|
||||
description:
|
||||
category:
|
||||
homepage:
|
||||
https://github.com/nikita-volkov/high-sql
|
||||
bug-reports:
|
||||
https://github.com/nikita-volkov/high-sql/issues
|
||||
author:
|
||||
Nikita Volkov <nikita.y.volkov@mail.ru>
|
||||
maintainer:
|
||||
Nikita Volkov <nikita.y.volkov@mail.ru>
|
||||
copyright:
|
||||
(c) 2014, Nikita Volkov
|
||||
license:
|
||||
MIT
|
||||
license-file:
|
||||
LICENSE
|
||||
build-type:
|
||||
Simple
|
||||
cabal-version:
|
||||
>=1.10
|
||||
|
||||
|
||||
source-repository head
|
||||
type:
|
||||
git
|
||||
location:
|
||||
git://github.com/nikita-volkov/high-sql.git
|
||||
|
||||
|
||||
library
|
||||
hs-source-dirs:
|
||||
library
|
||||
other-modules:
|
||||
HighSQL.Prelude
|
||||
exposed-modules:
|
||||
HighSQL
|
||||
HighSQL.Backend
|
||||
build-depends:
|
||||
-- database:
|
||||
ex-pool == 0.2.*,
|
||||
-- errors:
|
||||
loch-th == 0.2.*,
|
||||
placeholders == 0.1.*,
|
||||
-- general:
|
||||
mtl-prelude == 0.1.*,
|
||||
base-prelude == 0.1.*
|
||||
default-extensions:
|
||||
Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFunctor, DeriveGeneric, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, ImpredicativeTypes, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples
|
||||
default-language:
|
||||
Haskell2010
|
18
library/HighSQL.hs
Normal file
18
library/HighSQL.hs
Normal file
@ -0,0 +1,18 @@
|
||||
module HighSQL where
|
||||
|
||||
import HighSQL.Prelude hiding (read, Read, write, Write)
|
||||
import qualified HighSQL.Backend as Backend
|
||||
import qualified Data.Pool as Pool
|
||||
|
||||
|
||||
-- |
|
||||
-- A session, in which transactions are executed.
|
||||
-- It maintains the shared state between transactions.
|
||||
type S =
|
||||
ReaderT (Pool.Pool Backend.Connection)
|
||||
|
||||
-- |
|
||||
-- Run the session monad transformer in the base monad.
|
||||
session :: Backend.Backend -> S m r -> m r
|
||||
session b s =
|
||||
$notImplemented
|
10
library/HighSQL/Backend.hs
Normal file
10
library/HighSQL/Backend.hs
Normal file
@ -0,0 +1,10 @@
|
||||
-- |
|
||||
-- An open API for implementation of specific drivers.
|
||||
module HighSQL.Backend where
|
||||
|
||||
import HighSQL.Prelude
|
||||
|
||||
|
||||
data Backend
|
||||
|
||||
data Connection
|
31
library/HighSQL/Prelude.hs
Normal file
31
library/HighSQL/Prelude.hs
Normal file
@ -0,0 +1,31 @@
|
||||
module HighSQL.Prelude
|
||||
(
|
||||
module Exports,
|
||||
bug,
|
||||
bottom,
|
||||
)
|
||||
where
|
||||
|
||||
|
||||
-- base-prelude
|
||||
-------------------------
|
||||
import BasePrelude as Exports
|
||||
|
||||
-- mtl-prelude
|
||||
-------------------------
|
||||
import MTLPrelude as Exports hiding (shift)
|
||||
|
||||
-- placeholders
|
||||
-------------------------
|
||||
import Development.Placeholders as Exports
|
||||
|
||||
-- custom
|
||||
-------------------------
|
||||
import qualified Debug.Trace.LocationTH
|
||||
|
||||
|
||||
bug = [e| $(Debug.Trace.LocationTH.failure) . (msg <>) |]
|
||||
where
|
||||
msg = "A \"stream\" package bug: " :: String
|
||||
|
||||
bottom = [e| $bug "Bottom evaluated" |]
|
Loading…
Reference in New Issue
Block a user