@@ -153,7 +153,7 @@ type Table = '[] :=>
156− setup :: Definition '["public" ::: '[]] '["public" ::: '["tab" ::: 'Table Table]]
156+ setup :: Definition (Public '[]) (Public '["tab" ::: 'Table Table])
157 setup = createTable #tab
157 setup = createTable #tab
158 (nullable int `as` #a :* nullable real `as` #b) Nil
158 (nullable int `as` #a :* nullable real `as` #b) Nil
159in printSQL setup
159in printSQL setup
@@ -189,11 +189,11 @@ type Table = '[] :=>
189 , "b" ::: 'NoDef :=> 'Null 'PGfloat4 ]
189 , "b" ::: 'NoDef :=> 'Null 'PGfloat4 ]
192−>>> type DB = '["public" ::: '["tab" ::: 'Table Table]]
192+>>> type Schemas = Public '["tab" ::: 'Table Table]
196− setup :: Definition DB DB
196+ setup :: Definition Schemas Schemas
197 setup = createTableIfNotExists #tab
197 setup = createTableIfNotExists #tab
198 (nullable int `as` #a :* nullable real `as` #b) Nil
198 (nullable int `as` #a :* nullable real `as` #b) Nil
199in printSQL setup
199in printSQL setup
@@ -280,7 +280,7 @@ type Schema = '[
283− definition :: Definition '["public" ::: '[]] '["public" ::: Schema]
283+ definition :: Definition (Public '[]) (Public Schema)
284 definition = createTable #tab
284 definition = createTable #tab
285 ( (int & notNullable) `as` #a :*
285 ( (int & notNullable) `as` #a :*
286 (int & notNullable) `as` #b )
286 (int & notNullable) `as` #b )
@@ -315,7 +315,7 @@ type Schema = '[
318− definition :: Definition '["public" ::: '[]] '["public" ::: Schema]
318+ definition :: Definition (Public '[]) (Public Schema)
319 definition = createTable #tab
319 definition = createTable #tab
320 ( (int & nullable) `as` #a :*
320 ( (int & nullable) `as` #a :*
321 (int & nullable) `as` #b )
321 (int & nullable) `as` #b )
@@ -345,12 +345,11 @@ type Schema = '[
345 "id" ::: 'Def :=> 'NotNull 'PGint4,
345 "id" ::: 'Def :=> 'NotNull 'PGint4,
346 "name" ::: 'NoDef :=> 'NotNull 'PGtext
346 "name" ::: 'NoDef :=> 'NotNull 'PGtext
348−type DB = '["public" ::: Schema]
353− definition :: Definition '["public" ::: '[]] DB
352+ definition :: Definition (Public '[]) (Public Schema)
354 definition = createTable #tab
353 definition = createTable #tab
355 ( serial `as` #id :*
354 ( serial `as` #id :*
356 (text & notNullable) `as` #name )
355 (text & notNullable) `as` #name )
@@ -396,7 +395,7 @@ type Schema =
399− setup :: Definition '["public" ::: '[]] '["public" ::: Schema]
398+ setup :: Definition (Public '[]) (Public Schema)
401 createTable #users
400 createTable #users
402 ( serial `as` #id :*
401 ( serial `as` #id :*
@@ -431,7 +430,7 @@ type Schema =
434− setup :: Definition '["public" ::: '[]] '["public" ::: Schema]
433+ setup :: Definition (Public '[]) (Public Schema)
436 createTable #employees
435 createTable #employees
437 ( serial `as` #id :*
436 ( serial `as` #id :*
@@ -534,7 +533,7 @@ DROP statements
537−-- definition :: Definition '["public" ::: '["muh_table" ::: 'Table t]] '["public" ::: '[]]
536+-- definition :: Definition '["public" ::: '["muh_table" ::: 'Table t]] (Public '[])
538-- definition = dropTable #muh_table
537-- definition = dropTable #muh_table
@@ -870,7 +869,7 @@ dropView vw = UnsafeDefinition $ "DROP VIEW" <+> renderQualifiedAlias vw <> ";"
871-- | Enumerated types are created using the `createTypeEnum` command, for example
870-- | Enumerated types are created using the `createTypeEnum` command, for example
873−-- >>> printSQL $ (createTypeEnum #mood (label @"sad" :* label @"ok" :* label @"happy") :: Definition '["public" ::: '[]] '["public" ::: '["mood" ::: 'Typedef ('PGenum '["sad","ok","happy"])]])
872+-- >>> printSQL $ (createTypeEnum #mood (label @"sad" :* label @"ok" :* label @"happy") :: Definition (Public '[]) '["public" ::: '["mood" ::: 'Typedef ('PGenum '["sad","ok","happy"])]])
874-- CREATE TYPE "mood" AS ENUM ('sad', 'ok', 'happy');
873-- CREATE TYPE "mood" AS ENUM ('sad', 'ok', 'happy');
875createTypeEnum
874createTypeEnum
876 :: (KnownSymbol enum, Has sch schemas schema, SOP.All KnownSymbol labels)
875 :: (KnownSymbol enum, Has sch schemas schema, SOP.All KnownSymbol labels)
@@ -890,7 +889,7 @@ createTypeEnum enum labels = UnsafeDefinition $
890-- >>> instance SOP.HasDatatypeInfo Schwarma
889-- >>> instance SOP.HasDatatypeInfo Schwarma
893−-- createSchwarma :: Definition '["public" ::: '[]] '["public" ::: '["schwarma" ::: 'Typedef (PG (Enumerated Schwarma))]]
892+-- createSchwarma :: Definition (Public '[]) '["public" ::: '["schwarma" ::: 'Typedef (PG (Enumerated Schwarma))]]
894-- createSchwarma = createTypeEnumFrom @Schwarma #schwarma
893-- createSchwarma = createTypeEnumFrom @Schwarma #schwarma
896-- printSQL createSchwarma
895-- printSQL createSchwarma
@@ -919,7 +918,7 @@ type PGcomplex = 'PGcomposite
922− setup :: Definition '["public" ::: '[]] '["public" ::: '["complex" ::: 'Typedef PGcomplex]]
921+ setup :: Definition (Public '[]) '["public" ::: '["complex" ::: 'Typedef PGcomplex]]
923 setup = createTypeComposite #complex
922 setup = createTypeComposite #complex
924 (float8 `as` #real :* float8 `as` #imaginary)
923 (float8 `as` #real :* float8 `as` #imaginary)
925in printSQL setup
924in printSQL setup
@@ -946,10 +945,10 @@ createTypeComposite ty fields = UnsafeDefinition $
946-- >>> data Complex = Complex {real :: Double, imaginary :: Double} deriving GHC.Generic
945-- >>> data Complex = Complex {real :: Double, imaginary :: Double} deriving GHC.Generic
947-- >>> instance SOP.Generic Complex
946-- >>> instance SOP.Generic Complex
948-- >>> instance SOP.HasDatatypeInfo Complex
947-- >>> instance SOP.HasDatatypeInfo Complex
949−-- >>> type DB = '["public" ::: '["complex" ::: 'Typedef (PG (Composite Complex))]]
948+-- >>> type Schema = '["complex" ::: 'Typedef (PG (Composite Complex))]
952−-- createComplex :: Definition '["public" ::: '[]] DB
951+-- createComplex :: Definition (Public '[]) (Public Schema)
953-- createComplex = createTypeCompositeFrom @Complex #complex
952-- createComplex = createTypeCompositeFrom @Complex #complex
955-- printSQL createComplex
954-- printSQL createComplex
@@ -978,7 +977,7 @@ instance (KnownSymbol alias, PGTyped schemas ty)
978-- >>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
977-- >>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
979-- >>> instance SOP.Generic Schwarma
978-- >>> instance SOP.Generic Schwarma
980-- >>> instance SOP.HasDatatypeInfo Schwarma
979-- >>> instance SOP.HasDatatypeInfo Schwarma
981−-- >>> printSQL (dropType #schwarma :: Definition '["public" ::: '["schwarma" ::: 'Typedef (PG (Enumerated Schwarma))]] '["public" ::: '[]])
980+-- >>> printSQL (dropType #schwarma :: Definition '["public" ::: '["schwarma" ::: 'Typedef (PG (Enumerated Schwarma))]] (Public '[]))
982-- DROP TYPE "schwarma";
981-- DROP TYPE "schwarma";
984 :: (Has sch schemas schema, Has td schema ('Typedef ty))
983 :: (Has sch schemas schema, Has td schema ('Typedef ty))