@@ -113,10 +113,19 @@ renderAliased
113113renderAliased render (expression `As` alias) =
114114 render expression <> " AS " <> renderAlias alias
115115
116+class IsTableColumn table column expression where
117+ (!) :: Alias table -> Alias column -> expression
118+ infixl 9 !
119+instance IsTableColumn table column (Alias table, Alias column) where (!) = (,)
120+
116121data NullityType = Null PGType | NotNull PGType
117122
118123data ColumnType = Optional NullityType | Required NullityType
119124
125+data Grouping
126+ = Ungrouped
127+ | Grouped [(Symbol,Symbol)]
128+
120129type family BaseType (ty :: ColumnType) where
121130 BaseType (optionality (nullity pg)) = pg
122131
@@ -153,11 +162,3 @@ type family Rename alias0 alias1 xs where
153162type family Join xs ys where
154163 Join '[] ys = ys
155164 Join (x ': xs) ys = x ': Join xs ys
156−
157−data Grouping
158− = Ungrouped
159− | Grouped [(Symbol,Symbol)]
160−
161−class IsTableColumn table column expression where
162− (!) :: Alias table -> Alias column -> expression
163− infixl 9 !