data-basic-0.3.0.0: A database library with a focus on ease of use, type safety and useful error messages

Safe HaskellNone
LanguageHaskell2010

Internal.Data.Basic.TH.Types

Description

module Internal. : Data.Basic.TH.Types Description : Data types and utility function used during TH generation phase Copyright : (c) Nikola Henezi, 2016-2017 Luka Horvat, 2016-2017 License : MIT

This module Internal.defines data types that are used during parsing and TH generation stages. They describe structure of the parser and define minimal representation that is needed from parser in order to generate Template Haskell.

Synopsis

Documentation

data ParseError Source #

When something goes wrong, this explains what went wrong - hopefully...

Constructors

ParseError Text 

data ColumnConstraint Source #

List of constraints that can be applied to a Column and affect generated datatype Currently, only Null constraint affects it by wrapping data type with Maybe

data ColumnInfo Source #

Column information gathered from a parser

Constructors

ColumnInfo 

Fields

data EntityInfo Source #

Entity information gathered from a parser

Constructors

EntityInfo 

Fields

data ForeignKeyConstraint Source #

Minimal context we need to generate a foreign key constraint

Constructors

ForeignKeyConstraint 

Fields

data UniqueKeyConstraint Source #

Minimal context we need to generate a unique key constraint

Constructors

UniqueKeyConstraint 

Fields

data PrimaryKeyConstraint Source #

Minimal context we need to generate a primary key constraint

Constructors

PrimaryKeyConstraint 

Fields

data ParseContext Source #

Full parse context. This datatype is filled with information as parser goes trough the sql file. After ParseContext is filled, TH takes over and code generation starts.

Constructors

ParseContext 

Fields

class NullValue a where Source #

Defines null values for all datatypes that we support in Basic. This is basically a hack to avoid usage of unsafeCoerce, because with unsafeCoerce you can hit segmentation faults due to wrong memory allocation (e.g. Int and Bool).

Minimal complete definition

nullValue

Methods

nullValue :: a Source #

newtype Schema Source #

Constructors

Schema Text