sql-words-0.1.6.5: SQL keywords data constructors into OverloadedString

Copyright | 2013 Kei Hibino
License | BSD3
Maintainer | ex8k.hibino@gmail.com
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
Language | Haskell2010

Language.SQL.Keyword.Type

Description

SQL keyword representation using Haskell data constructors.

Synopsis

- data Keyword
  - = SELECT
  - | ALL
  - | DISTINCT
  - | ON
  - | GROUP
  - | COUNT
  - | SUM
  - | AVG
  - | MAX
  - | MIN
  - | EVERY
  - | ANY
  - | SOME
  - | CUBE
  - | ROLLUP
  - | GROUPING
  - | SETS
  - | HAVING
  - | FOR
  - | ORDER
  - | BY
  - | ASC
  - | DESC
  - | NULLS
  - | LAST
  - | OFFSET
  - | LIMIT
  - | FETCH
  - | FIRST
  - | NEXT
  - | PERCENT
  - | ROW
  - | ROWS
  - | ONLY
  - | TIES
  - | UNION
  - | EXCEPT
  - | INTERSECT
  - | DELETE
  - | USING
  - | RETURNING
  - | FROM
  - | AS
  - | WITH
  - | JOIN
  - | INNER
  - | LEFT
  - | RIGHT
  - | FULL
  - | NATURAL
  - | OUTER
  - | UPDATE
  - | SET
  - | DEFAULT
  - | WHERE
  - | INSERT
  - | INTO
  - | VALUES
  - | MERGE
  - | OVER
  - | PARTITION
  - | DENSE_RANK
  - | RANK
  - | ROW_NUMBER
  - | PERCENT_RANK
  - | CUME_DIST
  - | LAG
  - | LEAD
  - | FIRST_VALUE
  - | LAST_VALUE
  - | CASE
  - | END
  - | WHEN
  - | ELSE
  - | THEN
  - | LIKE
  - | SIMILAR
  - | AND
  - | OR
  - | NOT
  - | EXISTS
  - | IS
  - | NULL
  - | IN
  - | DATE
  - | TIME
  - | TIMESTAMP
  - | TIMESTAMPTZ
  - | INTERVAL
  - | Sequence !DString
- data DString
- word :: String -> Keyword
- wordShow :: Keyword -> String
- unwordsSQL :: [Keyword] -> String

# Documentation

data Keyword Source #

Type represent SQL keywords.

Constructors

SELECT |
ALL |
DISTINCT |
ON |
GROUP |
COUNT |
SUM |
AVG |
MAX |
MIN |
EVERY |
ANY |
SOME |
CUBE |
ROLLUP |
GROUPING |
SETS |
HAVING |
FOR |
ORDER |
BY |
ASC |
DESC |
NULLS |
LAST |
OFFSET |
LIMIT |
FETCH |
FIRST |
NEXT |
PERCENT |
ROW |
ROWS |
ONLY |
TIES |
UNION |
EXCEPT |
INTERSECT |
DELETE |
USING |
RETURNING |
FROM |
AS |
WITH |
JOIN |
INNER |
LEFT |
RIGHT |
FULL |
NATURAL |
OUTER |
UPDATE |
SET |
DEFAULT |
WHERE |
INSERT |
INTO |
VALUES |
MERGE |
OVER |
PARTITION |
DENSE_RANK |
RANK |
ROW_NUMBER |
PERCENT_RANK |
CUME_DIST |
LAG |
LEAD |
FIRST_VALUE |
LAST_VALUE |
CASE |
END |
WHEN |
ELSE |
THEN |
LIKE |
SIMILAR |
AND |
OR |
NOT |
EXISTS |
IS |
NULL |
IN |
DATE |
TIME |
TIMESTAMP |
TIMESTAMPTZ |
INTERVAL |
Sequence !DString |

#### Instances

Instances details

Monoid Keyword Source # | `Keyword` default concatenation separate by space.
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods mempty :: Keyword Source # mappend :: Keyword -> Keyword -> Keyword Source # mconcat :: [Keyword] -> Keyword Source #
Semigroup Keyword Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods (<>) :: Keyword -> Keyword -> Keyword Source # sconcat :: NonEmpty Keyword -> Keyword Source # stimes :: Integral b => b -> Keyword -> Keyword Source #

IsString Keyword Source #

`Keyword` type with OverloadedString extension, can be involved same list with string literals.

    selectFoo = [SELECT, "a, b, c", FROM, "foo"]

Instance details Defined in Language.SQL.Keyword.Internal.Type Methods fromString :: String -> Keyword Source #
Read Keyword Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods readsPrec :: Int -> ReadS Keyword Source # readList :: ReadS [Keyword] Source # readPrec :: ReadPrec Keyword Source # readListPrec :: ReadPrec [Keyword] Source #
Show Keyword Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods showsPrec :: Int -> Keyword -> ShowS Source # show :: Keyword -> String Source # showList :: [Keyword] -> ShowS Source #
Eq Keyword Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods (==) :: Keyword -> Keyword -> Bool Source # (/=) :: Keyword -> Keyword -> Bool Source #

data DString Source #

Diff String type for low-cost concatenation.

#### Instances

Instances details

Monoid DString Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods mempty :: DString Source # mappend :: DString -> DString -> DString Source # mconcat :: [DString] -> DString Source #
Semigroup DString Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods (<>) :: DString -> DString -> DString Source # sconcat :: NonEmpty DString -> DString Source # stimes :: Integral b => b -> DString -> DString Source #
Read DString Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods readsPrec :: Int -> ReadS DString Source # readList :: ReadS [DString] Source # readPrec :: ReadPrec DString Source # readListPrec :: ReadPrec [DString] Source #
Show DString Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods showsPrec :: Int -> DString -> ShowS Source # show :: DString -> String Source # showList :: [DString] -> ShowS Source #
Eq DString Source # |
Instance details Defined in Language.SQL.Keyword.Internal.Type Methods (==) :: DString -> DString -> Bool Source # (/=) :: DString -> DString -> Bool Source #

word :: String -> Keyword Source #

Make `Keyword` from String

wordShow :: Keyword -> String Source #

Show `Keyword`

unwordsSQL :: [Keyword] -> String Source #

Concatenate keywords into `String` like unwords