@@ -1,5 +1,5 @@
11{-|
2−Module: Squeel.PostgreSQL.Schema
2+Module: Squeal.PostgreSQL.Schema
33Description: Embedding of PostgreSQL type and alias system
44Copyright: (c) Eitan Chatav, 2017
55Maintainer: eitan@morphism.tech
@@ -114,12 +114,12 @@ data NullityType
114114 | NotNull PGType -- ^ @NULL@ is absent
115115
116116-- | `ColumnType` encodes the allowance of @DEFAULT@ and the only way
117−-- to generate an `Optional` `Squeel.PostgreSQL.Statement.Expression`
118−-- is to use `Squeel.PostgreSQL.Statement.def`,
119−-- `Squeel.PostgreSQL.Statement.unDef` or `Squeel.PostgreSQL.Statement.param`.
117+-- to generate an `Optional` `Squeal.PostgreSQL.Statement.Expression`
118+-- is to use `Squeal.PostgreSQL.Statement.def`,
119+-- `Squeal.PostgreSQL.Statement.unDef` or `Squeal.PostgreSQL.Statement.param`.
120120data ColumnType
121121 = Optional NullityType
122− -- ^ @DEFAULT@ is an allowed `Squeel.PostgreSQL.Statement.Expression`
122+ -- ^ @DEFAULT@ is an allowed `Squeal.PostgreSQL.Statement.Expression`
123123 | Required NullityType
124124 -- ^ @DEFAULT@ is not allowed
125125
@@ -132,26 +132,26 @@ type ColumnsType = [(Symbol,ColumnType)]
132132type TablesType = [(Symbol,ColumnsType)]
133133
134134-- | `Grouping` is an auxiliary namespace, created by
135−-- @GROUP BY@ clauses (`Squeel.PostgreSQL.Statement.group`), and used by
135+-- @GROUP BY@ clauses (`Squeal.PostgreSQL.Statement.group`), and used
136136-- for typesafe aggregation
137137data Grouping
138138 = Ungrouped
139139 | Grouped [(Symbol,Symbol)]
140140
141141-- | `PGNum` is a constraint on `PGType` whose
142−-- `Squeel.PostgreSQL.Statement.Expression`s have a `Num` constraint.
142+-- `Squeal.PostgreSQL.Statement.Expression`s have a `Num` constraint.
143143type PGNum ty =
144144 In ty '[ 'PGint2, 'PGint4, 'PGint8, 'PGnumeric, 'PGfloat4, 'PGfloat8]
145145
146146-- | `PGFloating` is a constraint on `PGType` whose
147−-- `Squeel.PostgreSQL.Statement.Expression`s
147+-- `Squeal.PostgreSQL.Statement.Expression`s
148148-- have `Fractional` and `Floating` constraints.
149149type PGFloating ty = In ty '[ 'PGfloat4, 'PGfloat8, 'PGnumeric]
150150
151151-- | `PGIntegral` is a constraint on `PGType` whose
152−-- `Squeel.PostgreSQL.Statement.Expression`s
153−-- have `Squeel.PostgreSQL.Statement.div_` and
154−-- `Squeel.PostgreSQL.Statement.mod_` functions.
152+-- `Squeal.PostgreSQL.Statement.Expression`s
153+-- have `Squeal.PostgreSQL.Statement.div_` and
154+-- `Squeal.PostgreSQL.Statement.mod_` functions.
155155type PGIntegral ty = In ty '[ 'PGint2, 'PGint4, 'PGint8]
156156
157157-- | `:::` is the promoted version of `As`, a type level pair between
@@ -259,43 +259,43 @@ type family NullifyColumns (columns :: ColumnsType) :: ColumnsType where
259259
260260-- | `NullifyTables` is an idempotent that nullifies a `TablesType`
261261-- used to nullify the left or right hand side of an outer join
262−-- in a `Squeel.PostgreSQL.Statement.FromClause`
262+-- in a `Squeal.PostgreSQL.Statement.FromClause`
263263type family NullifyTables (tables :: TablesType) :: TablesType where
264264 NullifyTables '[] = '[]
265265 NullifyTables ((table ::: columns) ': tables) =
266266 (table ::: NullifyColumns columns) ': NullifyTables tables
267267
268268-- | `Join` is simply promoted `++` and is used in @JOIN@s in
269−-- `Squeel.PostgreSQL.Statement.FromClause`s.
269+-- `Squeal.PostgreSQL.Statement.FromClause`s.
270270type family Join xs ys where
271271 Join '[] ys = ys
272272 Join (x ': xs) ys = x ': Join xs ys
273273
274274-- | `Create alias x xs` adds `alias ::: x` to the end of `xs` and is used in
275−-- `Squeel.PostgreSQL.Statement.createTable` statements and in @ALTER TABLE@
276−-- `Squeel.PostgreSQL.Statement.addColumnDefault` and
277−-- `Squeel.PostgreSQL.Statement.addColumnNull` statements
275+-- `Squeal.PostgreSQL.Statement.createTable` statements and in @ALTER TABLE@
276+-- `Squeal.PostgreSQL.Statement.addColumnDefault` and
277+-- `Squeal.PostgreSQL.Statement.addColumnNull` statements
278278type family Create alias x xs where
279279 Create alias x '[] = '[alias ::: x]
280280 Create alias y (x ': xs) = x ': Create alias y xs
281281
282282-- | `Drop alias xs` removes the type associated with `alias` in `xs`
283−-- and is used in `Squeel.PostgreSQL.Statement.dropTable` statements
284−-- and in @ALTER TABLE@ `Squeel.PostgreSQL.Statement.dropColumn` statements
283+-- and is used in `Squeal.PostgreSQL.Statement.dropTable` statements
284+-- and in @ALTER TABLE@ `Squeal.PostgreSQL.Statement.dropColumn` statements
285285type family Drop alias xs where
286286 Drop alias ((alias ::: x) ': xs) = xs
287287 Drop alias (x ': xs) = x ': Drop alias xs
288288
289289-- | `Alter alias xs x` replaces the type associated with an `alias` in `xs`
290−-- with the type `x` and is used in `Squeel.PostgreSQL.Statement.alterTable`
291−-- and `Squeel.PostgreSQL.Statement.alterColumn`.
290+-- with the type `x` and is used in `Squeal.PostgreSQL.Statement.alterTable`
291+-- and `Squeal.PostgreSQL.Statement.alterColumn`.
292292type family Alter alias xs x where
293293 Alter alias ((alias ::: x0) ': xs) x1 = (alias ::: x1) ': xs
294294 Alter alias (x0 ': xs) x1 = x0 ': Alter alias xs x1
295295
296296-- | `Rename alias0 alias1 xs` replaces the alias `alias0` by `alias1` in `xs`
297−-- and is used in `Squeel.PostgreSQL.Statement.alterTableRename` and
298−-- `Squeel.PostgreSQL.Statement.renameColumn`
297+-- and is used in `Squeal.PostgreSQL.Statement.alterTableRename` and
298+-- `Squeal.PostgreSQL.Statement.renameColumn`
299299type family Rename alias0 alias1 xs where
300300 Rename alias0 alias1 ((alias0 ::: x0) ': xs) = (alias1 ::: x0) ': xs
301301 Rename alias0 alias1 (x ': xs) = x ': Rename alias0 alias1 xs