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
module Language | |
import Control.Monad.State | |
%default total | |
%access public export | |
mutual | |
record QueryAbstractSyntaxTree where | |
constructor MkQueryAbstractSyntaxTree | |
distinct : Bool | |
data TableJoiningState = NoTables | HasTables | |
record QueryAstState where | |
constructor MkQueryAstState | |
joinState : TableJoiningState | |
data SqlQueryParts : (result : Type) -> (before : QueryAstState) -> (after : QueryAstState) -> Type where | |
From : | |
(source : Bool) | |
-> SqlQueryParts | |
() | |
(MkQueryAstState | |
NoTables | |
) | |
(MkQueryAstState | |
HasTables | |
) | |
collapseToAst : SqlQueryParts a before after -> QueryAbstractSyntaxTree | |
collapseToAst x = | |
execState (collapseToAstHelper x) (MkQueryAbstractSyntaxTree False) | |
where | |
collapseToAstHelper : SqlQueryParts a before after -> State QueryAbstractSyntaxTree a | |
collapseToAstHelper (From querySource) = ?aa3 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment