This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work in progress: redesign of the parser
- Loading branch information
Showing
18 changed files
with
989 additions
and
928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
-- file : Hedsql/Common/DataStructure/base | ||
|
||
{-| | ||
Data type system allowing the representation of SQL in haskell. | ||
At the exception of its lenses, this module should not be directly used. | ||
It is an "internal machinery" on which are then builds classes allowing the | ||
easy generation of such SQL data which can then be later convert them to | ||
SQL strings. | ||
-} | ||
Module : Hedsql/Common/DataStructure/Base.hs | ||
Description : Constructor functions for columns. | ||
Copyright : (c) Leonard Monnier, 2014 | ||
License : GPL-3 | ||
Maintainer : leonard.monnier@gmail.com | ||
Stability : experimental | ||
Portability : portable | ||
Data type system allowing the representation of SQL in haskell. | ||
At the exception of its lenses, this module should not be directly used. | ||
It is an "internal machinery" on which are then builds classes allowing the | ||
easy generation of such SQL data which can then be later convert them to | ||
SQL strings. | ||
-} | ||
module Hedsql.Common.DataStructure.Base ( | ||
module Hedsql.Common.DataStructure.Create | ||
, module Hedsql.Common.DataStructure.Delete | ||
, module Hedsql.Common.DataStructure.Drop | ||
, module Hedsql.Common.DataStructure.Insert | ||
, module Hedsql.Common.DataStructure.Select | ||
, module Hedsql.Common.DataStructure.Update | ||
, Statement | ||
) where | ||
|
||
import Hedsql.Common.DataStructure.Create | ||
import Hedsql.Common.DataStructure.Delete | ||
import Hedsql.Common.DataStructure.Drop | ||
import Hedsql.Common.DataStructure.Insert | ||
import Hedsql.Common.DataStructure.Select | ||
import Hedsql.Common.DataStructure.Update | ||
import Hedsql.Common.DataStructure.Update | ||
|
||
-- private functions. | ||
|
||
-- public functions. | ||
|
||
-- | All possible SQL statements which can be constructed using Hedsql. | ||
data Statement a = | ||
CreateTableStmt (CreateTable a) | ||
| CreateViewStmt (CreateView a) | ||
| DeleteStmt (Delete a) | ||
| DropTableStmt (DropTable a) | ||
| DropViewStmt (DropView a) | ||
| InsertStmt (Insert a) | ||
| SelectQueryStmt (Select a) | ||
| UpdateStmt (Update a) | ||
| Statements [Statement a] -- ^ Combination of many statements. | ||
deriving (Show) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
-- file : Hedsql/Common/DataStructure/Delete | ||
{-# LANGUAGE TemplateHaskell #-} | ||
|
||
{-| | ||
DELETE statement data type definitions. | ||
-} | ||
Module : Hedsql/Common/DataStructure/Delete.hs | ||
Description : DELETE statement data type definition. | ||
Copyright : (c) Leonard Monnier, 2014 | ||
License : GPL-3 | ||
Maintainer : leonard.monnier@gmail.com | ||
Stability : experimental | ||
Portability : portable | ||
module Hedsql.Common.DataStructure.Delete where | ||
DELETE statement data type definitions. | ||
-} | ||
module Hedsql.Common.DataStructure.Delete | ||
( | ||
Delete | ||
, deleteTable | ||
, deleteWhere | ||
) where | ||
|
||
import Hedsql.Common.DataStructure.Select | ||
import Control.Lens | ||
|
||
-- | DELETE query. | ||
data Delete = Delete { | ||
_deleteTable :: Table | ||
, _deleteWherePart :: Maybe Where | ||
} deriving (Show) | ||
-- Private. | ||
|
||
-- Public. | ||
|
||
-- | DELETE statement. | ||
data Delete a = Delete | ||
{ | ||
_deleteTable :: Table a | ||
, _deleteWhere :: Maybe (Where a) | ||
} deriving (Show) | ||
|
||
-- Make the lenses. | ||
makeLenses ''Delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.