dawdle-0.1.0.2: Generates DDL suggestions based on a CSV file

Safe HaskellSafe
LanguageHaskell2010

Database.Dawdle.Types

Synopsis

Documentation

type SParser a = forall s u m. Stream s m Char => ParsecT s u m a Source

Used to prettify the type signatures

data CellType Source

The CellType contains the types available for inferrence. The order matters, as it represents the order in which the algorithm will try to infer.

Constructors

Nullable CellType

Nullable cell (Recursive definition)

Unknown

Initial type is unknown

CTBool 
CTInt8 
CTInt16 
CTInt32 
CTInt64 
CTFloat 
CTDouble 
CTDate String

The string represents the format

CTDateTime String

The string represents the format

CTChar Int

String with size

isNullable :: CellType -> Bool Source

Is this cell nullable?

addNullable :: CellType -> CellType Source

Add nullability to a cell

getDateFormatFromCT :: CellType -> Maybe String Source

Pull out format from date or datetime cells

removeNullable :: CellType -> CellType Source

Remove nullability from a cell

composeNull :: CellType -> CellType -> CellType Source

Compose second cell with first cell's nullability

composeMaxTypesWithNulls :: CellType -> CellType -> CellType Source

Select the maximum type between first and second cell, and apply nullability if needed (according to first cell)

isDateOrUnknown :: CellType -> Bool Source

Is this cell a Date or Unknown?

isDateTimeOrUnknown :: CellType -> Bool Source

Is this cell a DateTime or Unknown?