@@ -244,9 +244,9 @@ type Schema = '[
244244let
245245 definition :: Definition '[] Schema
246246 definition = createTable #tab
247− ( (int & notNullable) `As` #a :*
248− (int & notNullable) `As` #b :* Nil )
249− ( check (#a :* #b :* Nil) (#a .> #b) `As` #inequality :* Nil )
247+ ( (int & notNullable) `as` #a :*
248+ (int & notNullable) `as` #b )
249+ ( check (#a :* #b) (#a .> #b) `as` #inequality )
250250:}
251251
252252>>> printSQL definition
@@ -278,9 +278,9 @@ type Schema = '[
278278let
279279 definition :: Definition '[] Schema
280280 definition = createTable #tab
281− ( (int & nullable) `As` #a :*
282− (int & nullable) `As` #b :* Nil )
283− ( unique (#a :* #b :* Nil) `As` #uq_a_b :* Nil )
281+ ( (int & nullable) `as` #a :*
282+ (int & nullable) `as` #b )
283+ ( unique (#a :* #b) `as` #uq_a_b )
284284:}
285285
286286>>> printSQL definition
@@ -311,9 +311,9 @@ type Schema = '[
311311let
312312 definition :: Definition '[] Schema
313313 definition = createTable #tab
314− ( serial `As` #id :*
315− (text & notNullable) `As` #name :* Nil )
316− ( primaryKey #id `As` #pk_id :* Nil )
314+ ( serial `as` #id :*
315+ (text & notNullable) `as` #name )
316+ ( primaryKey #id `as` #pk_id )
317317:}
318318
319319>>> printSQL definition
@@ -357,16 +357,16 @@ let
357357 setup :: Definition '[] Schema
358358 setup =
359359 createTable #users
360− ( serial `As` #id :*
361− (text & notNullable) `As` #name :* Nil )
362− ( primaryKey #id `As` #pk_users :* Nil ) >>>
360+ ( serial `as` #id :*
361+ (text & notNullable) `as` #name )
362+ ( primaryKey #id `as` #pk_users ) >>>
363363 createTable #emails
364− ( serial `As` #id :*
365− (int & notNullable) `As` #user_id :*
366− (text & nullable) `As` #email :* Nil )
367− ( primaryKey #id `As` #pk_emails :*
364+ ( serial `as` #id :*
365+ (int & notNullable) `as` #user_id :*
366+ (text & nullable) `as` #email )
367+ ( primaryKey #id `as` #pk_emails :*
368368 foreignKey #user_id #users #id
369− OnDeleteCascade OnUpdateCascade `As` #fk_user_id :* Nil )
369+ OnDeleteCascade OnUpdateCascade `as` #fk_user_id )
370370in printSQL setup
371371:}
372372CREATE TABLE "users" ("id" serial, "name" text NOT NULL, CONSTRAINT "pk_users" PRIMARY KEY ("id"));
@@ -392,12 +392,12 @@ let
392392 setup :: Definition '[] Schema
393393 setup =
394394 createTable #employees
395− ( serial `As` #id :*
396− (text & notNullable) `As` #name :*
397− (integer & nullable) `As` #employer_id :* Nil )
398− ( primaryKey #id `As` #employees_pk :*
395+ ( serial `as` #id :*
396+ (text & notNullable) `as` #name :*
397+ (integer & nullable) `as` #employer_id )
398+ ( primaryKey #id `as` #employees_pk :*
399399 foreignKey #employer_id #employees #id
400− OnDeleteCascade OnUpdateCascade `As` #employees_employer_fk :* Nil )
400+ OnDeleteCascade OnUpdateCascade `as` #employees_employer_fk )
401401in printSQL setup
402402:}
403403CREATE TABLE "employees" ("id" serial, "name" text NOT NULL, "employer_id" integer NULL, CONSTRAINT "employees_pk" PRIMARY KEY ("id"), CONSTRAINT "employees_employer_fk" FOREIGN KEY ("employer_id") REFERENCES "employees" ("id") ON DELETE CASCADE ON UPDATE CASCADE);
@@ -546,7 +546,7 @@ newtype AlterTable
546546-- definition :: Definition
547547-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
548548-- '["tab" ::: 'Table ('["positive" ::: Check '["col"]] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
549−-- definition = alterTable #tab (addConstraint #positive (check (#col :* Nil) (#col .> 0)))
549+-- definition = alterTable #tab (addConstraint #positive (check #col (#col .> 0)))
550550-- in printSQL definition
551551-- :}
552552-- ALTER TABLE "tab" ADD CONSTRAINT "positive" CHECK (("col" > 0));
@@ -784,7 +784,7 @@ alterType ty = UnsafeAlterColumn $ "TYPE" <+> renderColumnTypeExpression ty
784784-- '[ "abc" ::: 'Table ('[] :=> '["a" ::: 'NoDef :=> 'Null 'PGint4, "b" ::: 'NoDef :=> 'Null 'PGint4, "c" ::: 'NoDef :=> 'Null 'PGint4])
785785-- , "bc" ::: 'View ('["b" ::: 'Null 'PGint4, "c" ::: 'Null 'PGint4])]
786786-- definition =
787−-- createView #bc (select (#b :* #c :* Nil) (from (table #abc)))
787+-- createView #bc (select (#b :* #c) (from (table #abc)))
788788-- in printSQL definition
789789-- :}
790790-- CREATE VIEW "bc" AS SELECT "b" AS "b", "c" AS "c" FROM "abc" AS "abc";