Module

Droplet.Language.Internal.Definition

Package
purescript-droplet
Repository
easafe/purescript-droplet

Definition of SQL columns types as well conversions from and to columns

Do not import this module directly, it will break your code and make it not type safe. Use the sanitized Droplet.Language instead

#Empty Source

type Empty :: Symboltype Empty = ""

#Identity Source

data Identity

GENERATED ALWAYS AS IDENTITY constraint

#Default Source

data Default

Constructors

Instances

#Star Source

data Star

Constructors

#Table Source

data Table :: Symbol -> Row Type -> Typedata Table (name :: Symbol) (fields :: Row Type)

Constructors

#E Source

data E

Marks the query end

Constructors

#Dot Source

type Dot :: Symboltype Dot = "."

#Composite Source

data Composite :: Symbol -> Typedata Composite (name :: Symbol)

#Path Source

data Path :: Symbol -> Symbol -> Typedata Path (alias :: Symbol) (field :: Symbol)

Qualified columns (e.g, table.column)

#ForeignKey Source

data ForeignKey :: Symbol -> Type -> Typedata ForeignKey (field :: Symbol) (table :: Type)

#Joined Source

data Joined (t :: Type)

A trick to mark left joined columns as nullable

Instances

#PrimaryKey Source

#Constraint Source

data Constraint :: forall n. n -> Type -> Typedata Constraint name t

#Unique Source

data Unique

#Column Source

data Column (t :: Type) (constraint :: Type)

Constructors

Instances

#C Source

data C :: forall k. k -> Type -> Typedata C n t

#ToType Source

class ToType (t :: Type)  where

String representation of field types

Members

Instances

#IsNullable Source

class IsNullable (t :: Type) 

Instances

#UnwrapNullable Source

class UnwrapNullable (w :: Type) (t :: Type) | w -> t

Convenience to remove nullable wrappers

Instances

#ToParameters Source

class ToParameters :: Row Type -> RowList Type -> Constraintclass ToParameters record (list :: RowList Type)  where

Members

Instances

#ToValue Source

class ToValue v  where

Converts a PureScript value into Postgres

Members

Instances

#UnwrapDefinition Source

class UnwrapDefinition (w :: Type) (t :: Type) | w -> t

Convenience to remove type wrappers

Instances

#AppendPath Source

class AppendPath :: Symbol -> Symbol -> Symbol -> Constraintclass AppendPath (alias :: Symbol) (name :: Symbol) (fullPath :: Symbol) | alias name -> fullPath

Simplify append qualifying column names

Instances

#path Source

path :: forall alias field path pathField. Append alias Dot path => Append path field pathField => Proxy alias -> Proxy field -> Path alias field

#(...) Source

Operator alias for Droplet.Language.Internal.Definition.path (non-associative / precedence 7)