From ef1ee97ee679e7f509e9e26da9e3673edc59d5b2 Mon Sep 17 00:00:00 2001 From: David Vollbracht Date: Fri, 17 Nov 2023 16:40:34 -0600 Subject: [PATCH] Sets up `docs` for github pages deployment of docsite --- docs/README.md => README.md | 10 +- docs/Dockerfile | 5 - docs/contact.html | 76 + docs/css/default.css | 1 + docs/css/syntax.css | 66 + docs/docker-compose.yml | 18 - .../building-sql-expressions.html | 80 + ...ighting-n-plus-one-queries-with-plans.html | 80 + .../the-monad-orville-typeclass.html | 80 + ...add-orville-to-your-application-monad.html | 80 + docs/how-tos/how-to-execute-raw-sql.html | 80 + .../how-to-marshall-a-haskell-record.html | 80 + ...set-up-an-auto-incrementing-id-column.html | 80 + docs/index.html | 219 ++ .../Database-Orville-PostgreSQL-Conduit.html | 13 + ...atabase-Orville-PostgreSQL-Connection.html | 4 + .../Database-Orville-PostgreSQL-Core.html | 354 +++ .../Database-Orville-PostgreSQL-Expr.html | 1 + ...e-Orville-PostgreSQL-MonadBaseControl.html | 31 + ...base-Orville-PostgreSQL-MonadUnliftIO.html | 14 + ...e-Orville-PostgreSQL-Plan-Explanation.html | 1 + ...Database-Orville-PostgreSQL-Plan-Many.html | 30 + ...ase-Orville-PostgreSQL-Plan-Operation.html | 67 + ...tabase-Orville-PostgreSQL-Plan-Syntax.html | 24 + .../Database-Orville-PostgreSQL-Plan.html | 105 + .../Database-Orville-PostgreSQL-Popper.html | 4 + .../Database-Orville-PostgreSQL-Raw.html | 4 + ...Database-Orville-PostgreSQL-ResourceT.html | 12 + .../Database-Orville-PostgreSQL-Select.html | 1 + .../Database-Orville-PostgreSQL-Trigger.html | 1 + .../Database-Orville-PostgreSQL.html | 2 + .../doc-index-37.html | 1 + .../doc-index-46.html | 1 + .../doc-index-60.html | 1 + .../doc-index-62.html | 1 + .../doc-index-A.html | 1 + .../doc-index-All.html | 1 + .../doc-index-B.html | 1 + .../doc-index-C.html | 1 + .../doc-index-D.html | 1 + .../doc-index-E.html | 1 + .../doc-index-F.html | 1 + .../doc-index-G.html | 1 + .../doc-index-H.html | 1 + .../doc-index-I.html | 1 + .../doc-index-K.html | 1 + .../doc-index-L.html | 1 + .../doc-index-M.html | 1 + .../doc-index-N.html | 1 + .../doc-index-O.html | 1 + .../doc-index-P.html | 1 + .../doc-index-Q.html | 1 + .../doc-index-R.html | 1 + .../doc-index-S.html | 1 + .../doc-index-T.html | 1 + .../doc-index-U.html | 1 + .../doc-index-V.html | 1 + .../doc-index-W.html | 1 + .../doc-index.html | 1 + .../doc-index.json | 1 + .../haddock-bundle.min.js | 2 + .../hslogo-16.png | Bin 0 -> 1684 bytes .../orville-postgresql-legacy-docs/index.html | 1 + docs/orville-postgresql-legacy-docs/meta.json | 1 + docs/orville-postgresql-legacy-docs/minus.gif | Bin 0 -> 56 bytes docs/orville-postgresql-legacy-docs/ocean.css | 647 ++++++ .../orville-postgresql-legacy.txt | 2005 +++++++++++++++++ docs/orville-postgresql-legacy-docs/plus.gif | Bin 0 -> 59 bytes .../quick-jump.css | 164 ++ .../quick-jump.min.js | 2 + .../src/Data.Map.Helpers.html | 25 + .../Database.Orville.PostgreSQL.Conduit.html | 198 ++ ...atabase.Orville.PostgreSQL.Connection.html | 31 + .../src/Database.Orville.PostgreSQL.Core.html | 636 ++++++ .../src/Database.Orville.PostgreSQL.Expr.html | 24 + ...tgreSQL.Internal.ConstraintDefinition.html | 46 + ...e.Orville.PostgreSQL.Internal.Execute.html | 31 + ...Orville.PostgreSQL.Internal.Expr.Expr.html | 66 + ...lle.PostgreSQL.Internal.Expr.NameExpr.html | 41 + ...e.PostgreSQL.Internal.Expr.SelectExpr.html | 45 + ...le.PostgreSQL.Internal.Expr.WhereExpr.html | 164 ++ ...base.Orville.PostgreSQL.Internal.Expr.html | 15 + ...e.PostgreSQL.Internal.FieldDefinition.html | 235 ++ ...ville.PostgreSQL.Internal.FieldUpdate.html | 24 + ...rville.PostgreSQL.Internal.FromClause.html | 25 + ...e.Orville.PostgreSQL.Internal.FromSql.html | 90 + ...e.Orville.PostgreSQL.Internal.GroupBy.html | 36 + ...e.PostgreSQL.Internal.IndexDefinition.html | 103 + ...lle.PostgreSQL.Internal.MappendCompat.html | 15 + ...PostgreSQL.Internal.MigrateConstraint.html | 51 + ...ille.PostgreSQL.Internal.MigrateIndex.html | 45 + ...lle.PostgreSQL.Internal.MigrateSchema.html | 253 +++ ...e.PostgreSQL.Internal.MigrateSequence.html | 43 + ...ille.PostgreSQL.Internal.MigrateTable.html | 171 ++ ...le.PostgreSQL.Internal.MigrationError.html | 68 + ...lle.PostgreSQL.Internal.MigrationPlan.html | 68 + ...ase.Orville.PostgreSQL.Internal.Monad.html | 393 ++++ ...e.Orville.PostgreSQL.Internal.OrderBy.html | 51 + ...rville.PostgreSQL.Internal.PrimaryKey.html | 136 ++ ...rville.PostgreSQL.Internal.QueryCache.html | 134 ++ ....Orville.PostgreSQL.Internal.QueryKey.html | 133 ++ ...lle.PostgreSQL.Internal.RelationalMap.html | 288 +++ ...ville.PostgreSQL.Internal.SchemaState.html | 102 + ...se.Orville.PostgreSQL.Internal.Select.html | 77 + ...lle.PostgreSQL.Internal.SelectOptions.html | 147 ++ ...abase.Orville.PostgreSQL.Internal.Sql.html | 45 + ...e.Orville.PostgreSQL.Internal.SqlType.html | 427 ++++ ...e.PostgreSQL.Internal.TableDefinition.html | 28 + ...e.Orville.PostgreSQL.Internal.Trigger.html | 270 +++ ...ase.Orville.PostgreSQL.Internal.Types.html | 430 ++++ ...ase.Orville.PostgreSQL.Internal.Where.html | 257 +++ ...e.Orville.PostgreSQL.MonadBaseControl.html | 127 ++ ...base.Orville.PostgreSQL.MonadUnliftIO.html | 88 + ...atabase.Orville.PostgreSQL.Pagination.html | 54 + ...e.Orville.PostgreSQL.Plan.Explanation.html | 36 + ...Database.Orville.PostgreSQL.Plan.Many.html | 139 ++ ...ase.Orville.PostgreSQL.Plan.Operation.html | 447 ++++ ...tabase.Orville.PostgreSQL.Plan.Syntax.html | 52 + .../src/Database.Orville.PostgreSQL.Plan.html | 689 ++++++ .../Database.Orville.PostgreSQL.Popper.html | 589 +++++ .../src/Database.Orville.PostgreSQL.Raw.html | 94 + ...Database.Orville.PostgreSQL.ResourceT.html | 71 + .../Database.Orville.PostgreSQL.Select.html | 44 + .../Database.Orville.PostgreSQL.Trigger.html | 21 + .../src/Database.Orville.PostgreSQL.html | 17 + .../src/Paths_orville_postgresql_legacy.html | 51 + .../src/highlight.js | 27 + .../src/style.css | 55 + .../synopsis.png | Bin 0 -> 11327 bytes docs/tutorials/getting-started.html | 164 ++ docs/tutorials/using-json.html | 266 +++ docs/tutorials/using-migrations.html | 222 ++ docs/tutorials/using-plans.html | 372 +++ docs/tutorials/using-sql-marshaller.html | 206 ++ images/orville-waving-pennant.svg | 392 ++++ orville-docsite/scripts/build.sh | 4 + orville-docsite/site-builder/css/default.css | 14 + .../site-builder/images/haskell-logo.png | Bin 5674 -> 0 bytes .../Database-Orville-PostgreSQL-Conduit.html | 13 + ...atabase-Orville-PostgreSQL-Connection.html | 4 + .../Database-Orville-PostgreSQL-Core.html | 354 +++ .../Database-Orville-PostgreSQL-Expr.html | 1 + ...e-Orville-PostgreSQL-MonadBaseControl.html | 31 + ...base-Orville-PostgreSQL-MonadUnliftIO.html | 14 + ...e-Orville-PostgreSQL-Plan-Explanation.html | 1 + ...Database-Orville-PostgreSQL-Plan-Many.html | 30 + ...ase-Orville-PostgreSQL-Plan-Operation.html | 67 + ...tabase-Orville-PostgreSQL-Plan-Syntax.html | 24 + .../Database-Orville-PostgreSQL-Plan.html | 105 + .../Database-Orville-PostgreSQL-Popper.html | 4 + .../Database-Orville-PostgreSQL-Raw.html | 4 + ...Database-Orville-PostgreSQL-ResourceT.html | 12 + .../Database-Orville-PostgreSQL-Select.html | 1 + .../Database-Orville-PostgreSQL-Trigger.html | 1 + .../Database-Orville-PostgreSQL.html | 2 + .../doc-index-37.html | 1 + .../doc-index-46.html | 1 + .../doc-index-60.html | 1 + .../doc-index-62.html | 1 + .../doc-index-A.html | 1 + .../doc-index-All.html | 1 + .../doc-index-B.html | 1 + .../doc-index-C.html | 1 + .../doc-index-D.html | 1 + .../doc-index-E.html | 1 + .../doc-index-F.html | 1 + .../doc-index-G.html | 1 + .../doc-index-H.html | 1 + .../doc-index-I.html | 1 + .../doc-index-K.html | 1 + .../doc-index-L.html | 1 + .../doc-index-M.html | 1 + .../doc-index-N.html | 1 + .../doc-index-O.html | 1 + .../doc-index-P.html | 1 + .../doc-index-Q.html | 1 + .../doc-index-R.html | 1 + .../doc-index-S.html | 1 + .../doc-index-T.html | 1 + .../doc-index-U.html | 1 + .../doc-index-V.html | 1 + .../doc-index-W.html | 1 + .../doc-index.html | 1 + .../doc-index.json | 1 + .../haddock-bundle.min.js | 2 + .../hslogo-16.png | Bin 0 -> 1684 bytes .../orville-postgresql-legacy-docs/index.html | 1 + .../orville-postgresql-legacy-docs/meta.json | 1 + .../orville-postgresql-legacy-docs/minus.gif | Bin 0 -> 56 bytes .../orville-postgresql-legacy-docs/ocean.css | 647 ++++++ .../orville-postgresql-legacy.txt | 2005 +++++++++++++++++ .../orville-postgresql-legacy-docs/plus.gif | Bin 0 -> 59 bytes .../quick-jump.css | 164 ++ .../quick-jump.min.js | 2 + .../src/Data.Map.Helpers.html | 25 + .../Database.Orville.PostgreSQL.Conduit.html | 198 ++ ...atabase.Orville.PostgreSQL.Connection.html | 31 + .../src/Database.Orville.PostgreSQL.Core.html | 636 ++++++ .../src/Database.Orville.PostgreSQL.Expr.html | 24 + ...tgreSQL.Internal.ConstraintDefinition.html | 46 + ...e.Orville.PostgreSQL.Internal.Execute.html | 31 + ...Orville.PostgreSQL.Internal.Expr.Expr.html | 66 + ...lle.PostgreSQL.Internal.Expr.NameExpr.html | 41 + ...e.PostgreSQL.Internal.Expr.SelectExpr.html | 45 + ...le.PostgreSQL.Internal.Expr.WhereExpr.html | 164 ++ ...base.Orville.PostgreSQL.Internal.Expr.html | 15 + ...e.PostgreSQL.Internal.FieldDefinition.html | 235 ++ ...ville.PostgreSQL.Internal.FieldUpdate.html | 24 + ...rville.PostgreSQL.Internal.FromClause.html | 25 + ...e.Orville.PostgreSQL.Internal.FromSql.html | 90 + ...e.Orville.PostgreSQL.Internal.GroupBy.html | 36 + ...e.PostgreSQL.Internal.IndexDefinition.html | 103 + ...lle.PostgreSQL.Internal.MappendCompat.html | 15 + ...PostgreSQL.Internal.MigrateConstraint.html | 51 + ...ille.PostgreSQL.Internal.MigrateIndex.html | 45 + ...lle.PostgreSQL.Internal.MigrateSchema.html | 253 +++ ...e.PostgreSQL.Internal.MigrateSequence.html | 43 + ...ille.PostgreSQL.Internal.MigrateTable.html | 171 ++ ...le.PostgreSQL.Internal.MigrationError.html | 68 + ...lle.PostgreSQL.Internal.MigrationPlan.html | 68 + ...ase.Orville.PostgreSQL.Internal.Monad.html | 393 ++++ ...e.Orville.PostgreSQL.Internal.OrderBy.html | 51 + ...rville.PostgreSQL.Internal.PrimaryKey.html | 136 ++ ...rville.PostgreSQL.Internal.QueryCache.html | 134 ++ ....Orville.PostgreSQL.Internal.QueryKey.html | 133 ++ ...lle.PostgreSQL.Internal.RelationalMap.html | 288 +++ ...ville.PostgreSQL.Internal.SchemaState.html | 102 + ...se.Orville.PostgreSQL.Internal.Select.html | 77 + ...lle.PostgreSQL.Internal.SelectOptions.html | 147 ++ ...abase.Orville.PostgreSQL.Internal.Sql.html | 45 + ...e.Orville.PostgreSQL.Internal.SqlType.html | 427 ++++ ...e.PostgreSQL.Internal.TableDefinition.html | 28 + ...e.Orville.PostgreSQL.Internal.Trigger.html | 270 +++ ...ase.Orville.PostgreSQL.Internal.Types.html | 430 ++++ ...ase.Orville.PostgreSQL.Internal.Where.html | 257 +++ ...e.Orville.PostgreSQL.MonadBaseControl.html | 127 ++ ...base.Orville.PostgreSQL.MonadUnliftIO.html | 88 + ...atabase.Orville.PostgreSQL.Pagination.html | 54 + ...e.Orville.PostgreSQL.Plan.Explanation.html | 36 + ...Database.Orville.PostgreSQL.Plan.Many.html | 139 ++ ...ase.Orville.PostgreSQL.Plan.Operation.html | 447 ++++ ...tabase.Orville.PostgreSQL.Plan.Syntax.html | 52 + .../src/Database.Orville.PostgreSQL.Plan.html | 689 ++++++ .../Database.Orville.PostgreSQL.Popper.html | 589 +++++ .../src/Database.Orville.PostgreSQL.Raw.html | 94 + ...Database.Orville.PostgreSQL.ResourceT.html | 71 + .../Database.Orville.PostgreSQL.Select.html | 44 + .../Database.Orville.PostgreSQL.Trigger.html | 21 + .../src/Database.Orville.PostgreSQL.html | 17 + .../src/Paths_orville_postgresql_legacy.html | 51 + .../src/highlight.js | 27 + .../src/style.css | 55 + .../synopsis.png | Bin 0 -> 11327 bytes orville-docsite/site-builder/site.hs | 4 + orville-postgresql/scripts/build.sh | 9 - stack-gh-pages-haddock.sh | 67 - 256 files changed, 25745 insertions(+), 104 deletions(-) rename docs/README.md => README.md (96%) delete mode 100644 docs/Dockerfile create mode 100644 docs/contact.html create mode 100644 docs/css/default.css create mode 100644 docs/css/syntax.css delete mode 100644 docs/docker-compose.yml create mode 100644 docs/explanations/building-sql-expressions.html create mode 100644 docs/explanations/fighting-n-plus-one-queries-with-plans.html create mode 100644 docs/explanations/the-monad-orville-typeclass.html create mode 100644 docs/how-tos/how-to-add-orville-to-your-application-monad.html create mode 100644 docs/how-tos/how-to-execute-raw-sql.html create mode 100644 docs/how-tos/how-to-marshall-a-haskell-record.html create mode 100644 docs/how-tos/how-to-set-up-an-auto-incrementing-id-column.html create mode 100644 docs/index.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html create mode 100644 docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-37.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-46.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-60.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-62.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-A.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-All.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-B.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-C.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-D.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-E.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-F.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-G.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-H.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-I.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-K.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-L.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-M.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-N.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-O.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-P.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-Q.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-R.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-S.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-T.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-U.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-V.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index-W.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index.html create mode 100644 docs/orville-postgresql-legacy-docs/doc-index.json create mode 100644 docs/orville-postgresql-legacy-docs/haddock-bundle.min.js create mode 100644 docs/orville-postgresql-legacy-docs/hslogo-16.png create mode 100644 docs/orville-postgresql-legacy-docs/index.html create mode 100644 docs/orville-postgresql-legacy-docs/meta.json create mode 100644 docs/orville-postgresql-legacy-docs/minus.gif create mode 100644 docs/orville-postgresql-legacy-docs/ocean.css create mode 100644 docs/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt create mode 100644 docs/orville-postgresql-legacy-docs/plus.gif create mode 100644 docs/orville-postgresql-legacy-docs/quick-jump.css create mode 100644 docs/orville-postgresql-legacy-docs/quick-jump.min.js create mode 100644 docs/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html create mode 100644 docs/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html create mode 100644 docs/orville-postgresql-legacy-docs/src/highlight.js create mode 100644 docs/orville-postgresql-legacy-docs/src/style.css create mode 100644 docs/orville-postgresql-legacy-docs/synopsis.png create mode 100644 docs/tutorials/getting-started.html create mode 100644 docs/tutorials/using-json.html create mode 100644 docs/tutorials/using-migrations.html create mode 100644 docs/tutorials/using-plans.html create mode 100644 docs/tutorials/using-sql-marshaller.html create mode 100644 images/orville-waving-pennant.svg delete mode 100644 orville-docsite/site-builder/images/haskell-logo.png create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-37.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-46.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-60.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-62.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-A.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-All.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-B.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-C.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-D.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-E.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-F.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-G.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-H.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-I.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-K.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-L.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-M.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-N.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-O.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-P.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-Q.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-R.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-S.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-T.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-U.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-V.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-W.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.json create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/haddock-bundle.min.js create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/hslogo-16.png create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/index.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/meta.json create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/minus.gif create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/ocean.css create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/plus.gif create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.css create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.min.js create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/highlight.js create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/src/style.css create mode 100644 orville-docsite/site-builder/orville-postgresql-legacy-docs/synopsis.png delete mode 100644 stack-gh-pages-haddock.sh diff --git a/docs/README.md b/README.md similarity index 96% rename from docs/README.md rename to README.md index f717cef..6dc5372 100644 --- a/docs/README.md +++ b/README.md @@ -38,11 +38,11 @@ may be the right choice for you. See the tutorials, in order of increasing complexity: -* [Getting Started](../GETTING-STARTED.md) -* [Using SqlMarshaller](../SQL-MARSHALLER.md) -* [Using Plans](../PLAN.md) -* [Using Migrations](../MIGRATION.md) -* [Using JSON](../JSON.md) +* [Getting Started](GETTING-STARTED.md) +* [Using SqlMarshaller](SQL-MARSHALLER.md) +* [Using Plans](PLAN.md) +* [Using Migrations](MIGRATION.md) +* [Using JSON](JSON.md) Additional documentation is available in the Haddocks. diff --git a/docs/Dockerfile b/docs/Dockerfile deleted file mode 100644 index 76392ec..0000000 --- a/docs/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM haskell:9.4.4-buster -RUN apt update && apt -y install python3-pip postgresql screen -RUN pip3 install --user prysk -RUN curl -Lo ~/.local/bin/mdsh https://github.com/bashup/mdsh/raw/master/bin/mdsh && chmod +x ~/.local/bin/mdsh -RUN cabal update diff --git a/docs/contact.html b/docs/contact.html new file mode 100644 index 0000000..17bcd3e --- /dev/null +++ b/docs/contact.html @@ -0,0 +1,76 @@ + + + + + + + Orville - Contact + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

Contact

+

Orville is written and maintained by Flipstone Technology +Partners. You can reach the package maintainers at maintainers@flipstone.com.

+
+ + diff --git a/docs/css/default.css b/docs/css/default.css new file mode 100644 index 0000000..ac7d231 --- /dev/null +++ b/docs/css/default.css @@ -0,0 +1 @@ +html{font-size:62.5%;background-color:#0d0d13}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background-color:#13131e}::-webkit-scrollbar-thumb{background-color:#2e2e68}body{font-size:1.6rem;color:#c7c2c2;max-width:1200px;margin:0 auto}header{border-bottom:0.2rem solid #232629}.leftbar{position:fixed;top:0;bottom:0;width:200px;padding-left:20px;padding-right:20px;overflow:auto;scrollbar-width:thin}nav{margin-top:20px;margin-bottom:20px}main{margin-left:260px}nav a{display:block;margin-top:8px;margin-bottom:8px}a{text-decoration:none;color:#8383ff}a:visited{color:#6455f7}a:hover{color:#e768d4}footer{margin-top:3rem;padding:1.2rem 0;border-top:0.2rem solid #232629;font-size:1.2rem}h1{font-size:2.4rem}h2{font-size:2rem}article .header{font-size:1.4rem;font-style:italic;color:#555}.logo a{font-weight:bold}div.sourceCode{padding:5px 10px;margin-top:0px}.codeblock-label{background:#1f1f80;display:inline-block;padding:3px 10px}code:not(.sourceCode code){color:#e0a619} \ No newline at end of file diff --git a/docs/css/syntax.css b/docs/css/syntax.css new file mode 100644 index 0000000..1d2fc46 --- /dev/null +++ b/docs/css/syntax.css @@ -0,0 +1,66 @@ +pre > code.sourceCode { white-space: pre; position: relative; } +pre > code.sourceCode > span { line-height: 1.25; } +pre > code.sourceCode > span:empty { height: 1.2em; } +.sourceCode { overflow: visible; } +code.sourceCode > span { color: inherit; text-decoration: inherit; } +div.sourceCode { margin: 1em 0; } +pre.sourceCode { margin: 0; } +@media screen { +div.sourceCode { overflow: auto; } +} +@media print { +pre > code.sourceCode { white-space: pre-wrap; } +pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } +} +pre.numberSource code + { counter-reset: source-line 0; } +pre.numberSource code > span + { position: relative; left: -4em; counter-increment: source-line; } +pre.numberSource code > span > a:first-child::before + { content: counter(source-line); + position: relative; left: -1em; text-align: right; vertical-align: baseline; + border: none; display: inline-block; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; + background-color: #232629; + color: #7a7c7d; + } +pre.numberSource { margin-left: 3em; border-left: 1px solid #7a7c7d; padding-left: 4px; } +div.sourceCode + { color: #cfcfc2; background-color: #232629; } +@media screen { +pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } +} +code span { color: #cfcfc2; } /* Normal */ +code span.al { color: #95da4c; background-color: #4d1f24; font-weight: bold; } /* Alert */ +code span.an { color: #3f8058; } /* Annotation */ +code span.at { color: #2980b9; } /* Attribute */ +code span.bn { color: #f67400; } /* BaseN */ +code span.bu { color: #7f8c8d; } /* BuiltIn */ +code span.cf { color: #fdbc4b; font-weight: bold; } /* ControlFlow */ +code span.ch { color: #3daee9; } /* Char */ +code span.cn { color: #27aeae; font-weight: bold; } /* Constant */ +code span.co { color: #7a7c7d; } /* Comment */ +code span.cv { color: #7f8c8d; } /* CommentVar */ +code span.do { color: #a43340; } /* Documentation */ +code span.dt { color: #2980b9; } /* DataType */ +code span.dv { color: #f67400; } /* DecVal */ +code span.er { color: #da4453; text-decoration: underline; } /* Error */ +code span.ex { color: #0099ff; font-weight: bold; } /* Extension */ +code span.fl { color: #f67400; } /* Float */ +code span.fu { color: #8e44ad; } /* Function */ +code span.im { color: #27ae60; } /* Import */ +code span.in { color: #c45b00; } /* Information */ +code span.kw { color: #cfcfc2; font-weight: bold; } /* Keyword */ +code span.op { color: #cfcfc2; } /* Operator */ +code span.ot { color: #27ae60; } /* Other */ +code span.pp { color: #27ae60; } /* Preprocessor */ +code span.re { color: #2980b9; background-color: #153042; } /* RegionMarker */ +code span.sc { color: #3daee9; } /* SpecialChar */ +code span.ss { color: #da4453; } /* SpecialString */ +code span.st { color: #f44f4f; } /* String */ +code span.va { color: #27aeae; } /* Variable */ +code span.vs { color: #da4453; } /* VerbatimString */ +code span.wa { color: #da4453; } /* Warning */ diff --git a/docs/docker-compose.yml b/docs/docker-compose.yml deleted file mode 100644 index 3c20c18..0000000 --- a/docs/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: "3" -services: - pg: - image: postgres:15.0-alpine - environment: - POSTGRES_USER: orville_docs - POSTGRES_PASSWORD: orville - docs: - build: . - volumes: - - cabal:/root/.cabal - - ..:/orville-root - depends_on: - - pg - tty: true - working_dir: /docs -volumes: - cabal: diff --git a/docs/explanations/building-sql-expressions.html b/docs/explanations/building-sql-expressions.html new file mode 100644 index 0000000..a9ceb20 --- /dev/null +++ b/docs/explanations/building-sql-expressions.html @@ -0,0 +1,80 @@ + + + + + + + Orville - Building SQL Expressions (Upcoming) + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

Building SQL Expressions (Upcoming)

+
+
+

Coming Soon

+
+
+ +
+ + diff --git a/docs/explanations/fighting-n-plus-one-queries-with-plans.html b/docs/explanations/fighting-n-plus-one-queries-with-plans.html new file mode 100644 index 0000000..bd36c1d --- /dev/null +++ b/docs/explanations/fighting-n-plus-one-queries-with-plans.html @@ -0,0 +1,80 @@ + + + + + + + Orville - Fighting N+1 Queries with Plans (Upcoming) + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

Fighting N+1 Queries with Plans (Upcoming)

+
+
+

Coming Soon

+
+
+ +
+ + diff --git a/docs/explanations/the-monad-orville-typeclass.html b/docs/explanations/the-monad-orville-typeclass.html new file mode 100644 index 0000000..4724971 --- /dev/null +++ b/docs/explanations/the-monad-orville-typeclass.html @@ -0,0 +1,80 @@ + + + + + + + Orville - The MonadOrville Typeclass (Upcoming) + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

The MonadOrville Typeclass (Upcoming)

+
+
+

Coming Soon

+
+
+ +
+ + diff --git a/docs/how-tos/how-to-add-orville-to-your-application-monad.html b/docs/how-tos/how-to-add-orville-to-your-application-monad.html new file mode 100644 index 0000000..ee810d6 --- /dev/null +++ b/docs/how-tos/how-to-add-orville-to-your-application-monad.html @@ -0,0 +1,80 @@ + + + + + + + Orville - How To Add Orville to Your Application Monad (Upcoming) + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

How To Add Orville to Your Application Monad (Upcoming)

+
+
+

Coming Soon

+
+
+ +
+ + diff --git a/docs/how-tos/how-to-execute-raw-sql.html b/docs/how-tos/how-to-execute-raw-sql.html new file mode 100644 index 0000000..86dcad4 --- /dev/null +++ b/docs/how-tos/how-to-execute-raw-sql.html @@ -0,0 +1,80 @@ + + + + + + + Orville - How To Execute Raw SQL (Upcoming) + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

How To Execute Raw SQL (Upcoming)

+
+
+

Coming Soon

+
+
+ +
+ + diff --git a/docs/how-tos/how-to-marshall-a-haskell-record.html b/docs/how-tos/how-to-marshall-a-haskell-record.html new file mode 100644 index 0000000..00f3e7c --- /dev/null +++ b/docs/how-tos/how-to-marshall-a-haskell-record.html @@ -0,0 +1,80 @@ + + + + + + + Orville - How To Marshall a Haskell Record (Upcoming) + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

How To Marshall a Haskell Record (Upcoming)

+
+
+

Coming Soon

+
+
+ +
+ + diff --git a/docs/how-tos/how-to-set-up-an-auto-incrementing-id-column.html b/docs/how-tos/how-to-set-up-an-auto-incrementing-id-column.html new file mode 100644 index 0000000..ec429fc --- /dev/null +++ b/docs/how-tos/how-to-set-up-an-auto-incrementing-id-column.html @@ -0,0 +1,80 @@ + + + + + + + Orville - How To Set Up An Auto-incrementing Id Column (Upcoming) + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

How To Set Up An Auto-incrementing Id Column (Upcoming)

+
+
+

Coming Soon

+
+
+ +
+ + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..39168e9 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,219 @@ + + + + + + + Orville - Home + + + + +
+
+

+ + Orville Logo + +

+
+ + + +
+ Site proudly generated by + Hakyll +
+
+ +
+

Home

+

Orville’s goal is to provide a powerful API for applications to access +PostgreSQL databases with minimal use of sophisticated language techniques or +extensions. It strikes a balance between enforcing type-safety in database +interactions where it is reasonable and presenting type signatures that are +minimally complicated.

+

Why Orville?

+

Orville is not meant to replace existing PostgreSQL libraries in the Haskell +ecosystem, but to complement them. It has the power to satisfy most experienced +Haskell developers but strives to remain approachable to newcomers despite +this. Orville’s API is rich enough to be used in production on large and +sophisticated applications, but avoids complicated type-level programming. If +your application is too large to reasonably write all your SQL statements by +hand yet doesn’t require absolute type-safety between your custom SQL +statements, their result sets and the Haskell types they decode into, Orville +may be the right choice for you.

+

Feature Overview

+ +

Tutorials

+

See the tutorials, in order of increasing complexity:

+ +

Additional documentation is available in the Haddocks.

+

Just show me some code!

+

Ok! Here’s a very simple application that inserts some entities of a Pet +model and finds one of them based on its name.

+
+haskell +
+
module Main (main) where
+
+import Data.Int (Int32)
+import qualified Data.Text as T
+import qualified Orville.PostgreSQL as O
+import qualified Orville.PostgreSQL.AutoMigration as AutoMigration
+
+{- |
+  Pet is a plain old Haskell record that will be marshalled to and from the
+  @pet@ table.
+-}
+data Pet =
+  Pet
+    { petId :: PetId
+    , petName :: T.Text
+    }
+
+{- |
+  It's good practice to create newtype specific to each entity to hold its
+  primary key value
+-}
+newtype PetId = PetId Int32
+
+{- |
+  A marshaller must be defined to convert Pet to and from SQL.
+-}
+petMarshaller :: O.SqlMarshaller Pet Pet
+petMarshaller =
+  Pet
+    <$> O.marshallField petId petIdField
+    <*> O.marshallField petName nameField
+
+{- |
+  Defines the @id@ field for the marshaller to marshall the 'petId' record
+  field to and from.
+-}
+petIdField :: O.FieldDefinition O.NotNull PetId
+petIdField =
+  O.coerceField (O.integerField "id")
+
+{- |
+  Defines the @name@ field for the marshaller to marshall the 'petName' record
+  field to and from.
+-}
+nameField :: O.FieldDefinition O.NotNull T.Text
+nameField =
+  O.unboundedTextField "name"
+
+{- |
+  Marshaller above is associated with the @pet@ table. The marshallers fields
+  will define the column of the table.
+-}
+petTable :: O.TableDefinition (O.HasKey PetId) Pet Pet
+petTable =
+  O.mkTableDefinition
+    "pet"
+    (O.primaryKey petIdField)
+    petMarshaller
+
+{- |
+  A simple demo that connects to a database, inserts 2 pets and then finds the
+  pet named "Spot"
+-}
+main :: IO ()
+main = do
+  pool <-
+    O.createConnectionPool
+      O.ConnectionOptions
+        { O.connectionString = "host=localhost user=postgres password=postgres"
+        , O.connectionNoticeReporting = O.DisableNoticeReporting
+        , O.connectionPoolStripes = O.OneStripePerCapability
+        , O.connectionPoolMaxConnections = O.MaxConnectionsPerStripe 1
+        , O.connectionPoolLingerTime = 10
+        }
+
+  mbSpot <- O.runOrville pool insertAndFindSpot
+
+  case mbSpot of
+    Nothing -> putStrLn "No Spot Found!"
+    Just _spot -> putStrLn "Spot found!"
+
+{- |
+  The Orville monad provides a starter pack for running Orville operations
+  against a connection pool.
+-}
+insertAndFindSpot :: O.Orville (Maybe Pet)
+insertAndFindSpot = do
+  AutoMigration.autoMigrateSchema
+    AutoMigration.defaultOptions
+    [AutoMigration.SchemaTable petTable]
+
+  O.insertEntity petTable $
+    Pet
+      { petId = PetId 1
+      , petName = T.pack "FuFu"
+      }
+
+  O.insertEntity petTable $
+    Pet
+      { petId = PetId 2
+      , petName = T.pack "Spot"
+      }
+
+  O.findFirstEntityBy
+    petTable
+    (O.where_ (O.fieldEquals nameField (T.pack "Spot")))
+
+ + diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html new file mode 100644 index 0000000..1ec6bf4 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html @@ -0,0 +1,13 @@ +Database.Orville.PostgreSQL.Conduit

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Conduit

Description

 
Synopsis

Documentation

selectConduit :: (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m) => Select row -> ConduitT () row m () Source #

selectConduit provides a way to stream the results of a Select query + from the database one by one using the conduit library. You can fuse the + conduit built by this function with your own conduit pipeline to handle rows + individually in whatever fashion you need (e.g. turning them into rows of + CSV). This is useful if you want to be able to process many rows one by one. + You can aggregate the results however you require as part of the conduit + processing and then use runConduit (or runConduitRes) from the conduit + library to execute the processing pipeline. Alternatively, your web server + (wai, servant, etc) may provide support for converting a conduit into a + streaming HTTP response.

Beware: this function must load all the results into memory before streaming + can begin. For why, see https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html. + If memory use is a concern, try streamPages instead.

streamPages Source #

Arguments

:: (MonadOrville conn m, Bounded orderField, Enum orderField) 
=> TableDefinition readEnt write key 
-> FieldDefinition NotNull orderField 
-> (readEnt -> orderField) 
-> Maybe WhereCondition 
-> Word

number of rows fetched per page

-> ConduitT () readEnt m () 

Build a conduit source that is fed by querying one page worth of results + at a time. When the last row of the last page is consumed, the stream ends.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html new file mode 100644 index 0000000..bfbc911 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html @@ -0,0 +1,4 @@ +Database.Orville.PostgreSQL.Connection

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Connection

Description

 

Documentation

createConnectionPool Source #

Arguments

:: Int

Number of stripes in the connection pool

-> NominalDiffTime

Linger time before closing an idle connection

-> Int

Max number of connections to allocate per stripe

-> String

A PostgreSQL connection string

-> IO (Pool Connection) 

createConnectionPool allocates a pool of connections to a PosgreSQL + server. The returned pool can be used as the endpoint to + newOrvilleEnv + to construct.

data Pool a #

Instances
Show (Pool a) 
Instance details

Defined in Data.Pool

Methods

showsPrec :: Int -> Pool a -> ShowS #

show :: Pool a -> String #

showList :: [Pool a] -> ShowS #

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html new file mode 100644 index 0000000..f59d65a --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html @@ -0,0 +1,354 @@ +Database.Orville.PostgreSQL.Core

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Core

Description

Migration Guide: Although not all exports are identical, most of the items in +this module can now be imported from Orville.PostgreSQL.

Please note that the new LibPQ-based version of orville represents a complete +re-write of Orville from the ground up. As such many of the APIs have been +re-thought with the goal of providing stability and better experience long +term.

Major changes:

  • The library no longer allows the connection type to vary. It is intended only + to be used with PostgreSQL. Thus MonadOrville and other types that used to + have a conn type parameter no longer have that parameter.
  • OrvilleT has been removed in favor of simply using ReaderT. For trivial + cases (i.e. ReaderT over IO) a pre-packaged Orville monad is provided.
  • In TableDefinition, the order of the type parameters has changed from + TableDefinition readEnity writeEntity key to TableDefinition key + writeEntity readEntity. This make it more consistent with the order of these + arguments in other types. TableParams has been removed in favor of building + a basic table definition with the require parameters first and adding or + setting other optional items after initial construction.
  • RelationalMap has been replaced by SqlMarshaller. Many functions have + been renamed, but most functions have a direct or nearly direct translation + from the old ones. See the docs on the individual functions such as + attrField to see what has changed.
  • The auto-migration system is significantly improved. Standard indexes no + longer need to be given explicit names. Indexes and constraints are now + attached to TableDefinition rather than being their own schema items. + Indexes and constraints are no longer dropped explicitly -- they are dropped + automatically by Orville when they have been removed from the table + definiton.
  • A number of places that previously accepted [] now require NonEmpty + instead. This is done in places where an empty list would not be valid SQL. + For examples of this change see insertRecordMany and updateFields.
  • whereAnd and whereOr (which took lists) have been replaced + with binary boolean logic functions andExpr and orExpr. These functions + also have operator aliases ((.&&), (.||)).

The following items exported from this module have migration guide notes +available in their documentation:

Synopsis

Documentation

data TableDefinition readEntity writeEntity key Source #

Migration Guide: TableDefinition can now be imported from + PostgreSQL. The order of the type parameters has changed from + TableDefinition readEnity writeEntity key to TableDefinition key + writeEntity readEntity. In the new Orville tables without primary keys are + supported, so the key parameter must now be instantiated as either HasKey + keyType or NoKey.

A TableDefinition is the center of the Orville universe. A TableDefinition + defines the structure of a table in the database and associates it with a Haskell + datatype, usually a Haskell record type. The TableDefinition must specify how + the Haskell type is converted to and from the database schema, as as well as + provide same basic utility functions required by Orville for interacting with + the Haskell datatype.

Usually you will use TableParams to construct a TableDefinition in a more + concise way. This type is provided as an escape hatch for any situations where + TableParams is too restrictive for the sql mapping required by a type.

Constructors

TableDefinition 

Fields

  • tableName :: String

    The name of the table in the database.

  • tableFields :: [SomeField]

    A list of field definitions defining the table structure

  • tableSafeToDelete :: [String]

    A list of any columns that may be deleted from the table by Orville. + (Orville will never delete a column without being told it is safe)

  • tablePrimaryKey :: PrimaryKey key

    The statically typed field definition that is the primary key. Currently + this field must still by listed in tableFields

  • tableFromSql :: FromSql readEntity

    A definition of how to convert the haskell type from a sql row

  • tableToSql :: ToSql writeEntity ()

    A function to set the key on the entity

  • tableGetKey :: readEntity -> key

    A function to get the key on the entity

  • tableComments :: TableComments ()

    Any comments that might be interesting for developers to see. These + comments will get printed in the log if there is an erro while attempting + to migrate the table.

primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition Source #

primaryKeyIn builds a WhereCondition that will match all rows where the + primary key is equal to one of the given values. For single-field primary + keys this is equivalent to whereIn, but primaryKeyIn also handles + composite primary keys.

primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition Source #

primaryKeyEquals builds a WhereCondition that will match the row where + the primary key is equal to the given value. For single-field primary keys + this is equivalent to .==, but 'primaryKeyEquals also handles composite + primary keys.

primaryKeyDescription :: PrimaryKey key -> String Source #

primaryKeyDescription builds a user-readable representation of the + primary key for use in error messages and such. It is a comma-delimited + list of the names of the fields that make up the primary key.

primaryKeyToSql :: PrimaryKey key -> key -> [SqlValue] Source #

primaryKeyToSql converts a Haskell value for a primary key into the + (possibly multiple) sql values that represent the primary key in the + database.

primaryKey :: FieldDefinition NotNull key -> PrimaryKey key Source #

primaryKey constructs a single-field primary key from the FieldDefinition + that corresponds to the primary key's column. This is generally used while + building a TableDefinition.

compositePrimaryKey :: PrimaryKeyPart key -> [PrimaryKeyPart key] -> PrimaryKey key Source #

compositePrimaryKey constructs a multi-field primary key from the given + parts, each of which corresponds to one field in the primary key. You should + use this while building a TableDefinition for a table that you want to have + a multi-column primary key. See primaryKeyPart for how to build the parts + to be passed as parameters. Note: there is no special significance to the + first argument other than requiring that there is at least one field in the + primary key.

primaryKeyPart :: (key -> part) -> FieldDefinition NotNull part -> PrimaryKeyPart key Source #

primaryKeyPart builds on section of a composite primary key based on the + field definition that corresponds to that column of the primary key. The + function given is used to decompose the Haskell value for the composite key + into the individual parts so they can be converted to sql for things like + building WhereCondition

mkTableDefinition :: TableParams readEntity writeEntity key -> TableDefinition readEntity writeEntity key Source #

Migration Guide: This function has in the new orville to take the table name, + primary key definition and a SqlMarshaller (formerly RelationalMap). + Other options such as constraints, indexes, and columns to drop can be added + to the TableDefinition after the initial instantiation. The TableParams + type has been dropped for the new orville.

mkTableDefinition converts a TableParams to TableDefinition. Usually + this is used directly on a record literal of the TableParams. For + example:

 data Foo key = Foo key { fooId :: Record }
+ myTable :: TableDefinition Foo
+ myTable = mkTableDefinition $
+   TableParams
+     { tblName = "foo"
+     , tblMapper = User $ attrField fooId idField
+     , tableSafeToDelete = []
+     , tblSetKey = key foo -> foo { fooId = key }
+     , tblGetKey = fooId
+     , tblComments = []
+     }
+
+

data SqlType a Source #

SqlType defines the mapping of a Haskell type (a) to a SQL column type in the + database. This includes both how to convert the type to and from the raw values + read from the database as well as the schema information required to create + and migrate columns using the type.

Constructors

SqlType 

Fields

  • sqlTypeDDL :: String

    The raw SQL DDL to use when creating/migrating columns of this type + (not including any NULL or NOT NULL declarations)

  • sqlTypeReferenceDDL :: Maybe String

    The raw SQL DDL to use when creating/migrating columns with foreign + keys to this type. This is used foreignRefType to build a new SqlType + when making foreign key fields

  • sqlTypeId :: SqlTypeId

    sqlTypeId will be compared to the colType field found in the + SqlColDesc return by describeTable when determining whether + a column type change is required when migrating the database.

  • sqlTypeSqlSize :: Maybe Int

    'sqlTypeSqlSize will be compared to the colSize field found in the + SqlColDesc return by describeTable when determining whether + a column type change is required when migrating the database.

  • sqlTypeToSql :: a -> SqlValue

    A function for converting Haskell values of this type into values to + be stored in the database.

  • sqlTypeFromSql :: SqlValue -> Either RowDataErrorReason a

    A function for converting values of this are stored in the database + into Haskell values. This function should return 'Left + RowDataErrorReason' to indicate an error if the conversion is + impossible. Otherwise it should return Right the corresponding a + value.

serial :: SqlType Int32 Source #

serial defines a 32-bit auto-incrementing column type. This corresponds to + the SERIAL type in PostgreSQL.

bigserial :: SqlType Int64 Source #

bigserial defines a 64-bit auto-incrementing column type. This corresponds to + the BIGSERIAL type in PostgresSQL.

text :: Int -> SqlType Text Source #

text defines a fixed length text field type. This corresponds to a + "CHAR(len)" type in SQL.

varText :: Int -> SqlType Text Source #

varText defines a variable text field type with a max length. This + corresponds to a "VARCHAR(len)" type in SQL.

unboundedText :: SqlType Text Source #

unboundedText defines a fixed length text field type. This corresponds to a + TEXT type in PostgreSQL.

integer :: SqlType Int32 Source #

integer defines a 32-bit integer type. This corresponds to the INTEGER type in SQL.

bigInteger :: SqlType Int64 Source #

bigInteger defines a 64-bit integer type. This corresponds to the BIGINT + type in SQL.

double :: SqlType Double Source #

double defines a floating point numeric type. This corresponds to the "DOUBLE + PRECISION" type in SQL.

boolean :: SqlType Bool Source #

boolean defines a True/False boolean type. This corresponds to the BOOLEAN + type in SQL.

date :: SqlType Day Source #

date defines a type representing a calendar date (without time zone). It corresponds + to the DATE type in SQL.

timestamp :: SqlType UTCTime Source #

timestamp defines a type representing a particular point in time (without time zone). + It corresponds to the "TIMESTAMP with time zone" type in SQL.

Note: This is NOT a typo. The "TIMESTAMP with time zone" type in SQL does not include + any actual time zone information. For an excellent explanation of the complexities + involving this type, please see Chris Clark's blog post about it: + http://blog.untrod.com/2016/08/actually-understanding-timezones-in-postgresql.html

textSearchVector :: SqlType Text Source #

textSearchVector defines a type for indexed text searching. It corresponds to the + TSVECTOR type in PostgreSQL.

convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b Source #

Migration Guide: convertSqlType retains the same name

convertSqlType changes the Haskell type used by a SqlType in the same manner + as maybeConvertSqlType in cases where an a can always be converted to a b.

maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b Source #

Migration Guide: maybeConvertSqlType has been replaced with + tryConvertSqlType, which allows an error message to be returned when + conversion fails.

maybeConvertSqlType changes the Haskell type used by a SqlType without + changing the column type that will be used in the database schema. The + functions given will be used to convert the now Haskell type to and from the + original type when reading and writing values from the database. When reading + an a value from the database, the conversion function should produce + Nothing if the value cannot be successfully converted to a b.

data TableParams readEntity writeEntity key Source #

MigrationGuide: TableParams no longer exists. See the migration guide + for mkTableDefinition

TableParams is the simplest way to make a TableDefinition. You + can use mkTableDefinition to make a definition from the simplified + params. Where TableDefinition requires the tableFields, tableFromSql, + and tableToSql to all be defined separately and kept in sync, TableParams + provides a single tblMapper field that specifies all three simultaneously + and ensures they are consistent with one another.

Constructors

TableParams 

Fields

  • tblName :: String

    The name of the table in the database

  • tblMapper :: RelationalMap writeEntity readEntity

    The relational mapping that defines how the Haskell entity type + is converted both to and from sql. The fields utilized in the mapping + are used to automatically build the list of FieldDefinitions that + define the structure of the table in the database.

  • tblSafeToDelete :: [String]

    A list of any columns that may be deleted from the table by Orville. + (Orville will never delete a column without being told it is safe)

  • tblPrimaryKey :: PrimaryKey key

    A function to set the key on the entity

  • tblGetKey :: readEntity -> key

    A function to get the key on the entity

  • tblComments :: TableComments ()

    Any comments that might be interesting for developers to see. These + comments will get printed in the log if there is an erro while attempting + to migrate the table.

data RelationalMap a b Source #

Migration guide: This type has been replaced with the SqlMarshaller type in + the new orville. The interface is similar, though the names of the functions + have been updated in many cases. See the migration guides for those functions + to find their new names.

Instances
Profunctor RelationalMap Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.RelationalMap

Methods

dimap :: (a -> b) -> (c -> d) -> RelationalMap b c -> RelationalMap a d

lmap :: (a -> b) -> RelationalMap b c -> RelationalMap a c

rmap :: (b -> c) -> RelationalMap a b -> RelationalMap a c

(#.) :: Coercible c b => q b c -> RelationalMap a b -> RelationalMap a c

(.#) :: Coercible b a => RelationalMap b c -> q a b -> RelationalMap a c

Functor (RelationalMap a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.RelationalMap

Methods

fmap :: (a0 -> b) -> RelationalMap a a0 -> RelationalMap a b #

(<$) :: a0 -> RelationalMap a b -> RelationalMap a a0 #

Applicative (RelationalMap a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.RelationalMap

Methods

pure :: a0 -> RelationalMap a a0 #

(<*>) :: RelationalMap a (a0 -> b) -> RelationalMap a a0 -> RelationalMap a b #

liftA2 :: (a0 -> b -> c) -> RelationalMap a a0 -> RelationalMap a b -> RelationalMap a c #

(*>) :: RelationalMap a a0 -> RelationalMap a b -> RelationalMap a b #

(<*) :: RelationalMap a a0 -> RelationalMap a b -> RelationalMap a a0 #

fields :: RelationalMap a b -> [SomeField] Source #

Migration Guide: The fields in new orville's SqlMarshaller are somewhat + more sophisticated than those of a RelationalMap. The fields function is + no longer offered with this simple interface as a result, but the + foldMarshallerFields function can be used in combination with the + collectFromField helper to collect the desired information from each field.

mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c Source #

Migration Guide: mapAttr has been renamed to marshallNested

mapField :: FieldDefinition nullability a -> RelationalMap a a Source #

Migration Guide: mapField has been removed, though its functional + equivalent is marshallReadOnlyField

attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b Source #

Migration Guide: attrField has been renamed to marshallField

maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b) Source #

Migration Guide: maybeMapper has been renamed to marshallMaybe

prefixMap :: String -> RelationalMap a b -> RelationalMap a b Source #

Migration Guide: prefixMap has been renamed to prefixMarshaller

partialMap :: RelationalMap a (Either String a) -> RelationalMap a a Source #

Migration Guide: partialMap has been renamed to marshallPartial

readOnlyMap :: RelationalMap a b -> RelationalMap c b Source #

Migration Guide: readOnlyMap has been renamed to marshallReadOnly

readOnlyField :: FieldDefinition nullability a -> RelationalMap b a Source #

Migration Guide: readOnlyField has been renamed to marshallReadOnlyField

data OrvilleEnv conn Source #

Migration Guide: OrvilleEnv has been renamed to OrvilleState. It no + longer has any type paremeters. The connection type is fixed and cannot be + changed.

OrvilleEnv tracks all the environment information required for an + 'OrvilleT conn m' Monad to operate. Use newOrvilleEnv to construct + one.

newOrvilleEnv :: Pool conn -> OrvilleEnv conn Source #

Migration Guide: newOrvilleEnv has been renamed to newOrvilleState. The + new function requires a parameter to be passed before the connection pool to + specify the level of detail to be used when Orville reports errors.

newOrvilleEnv initialized an OrvilleEnv for service. The connection + pool provided will be used to obtain connections to the database ase + required. You can use the createConnectionPool + utility function to create a connection pool to a PosgreSQL server.

setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn Source #

Migration Guide: setStartTransactionSQL has been renamed to setBeginTransactionExpr

aroundRunningQuery :: (forall a. QueryType -> String -> IO a -> IO a) -> OrvilleEnv conn -> OrvilleEnv conn Source #

Migration Guide: aroundRunningQuery has been renamed to addSqlExecutionCallback

addTransactionCallBack :: (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn Source #

Migration Guide: addTransactionCallBack retains the same name

data TransactionEvent Source #

Instances
Enum TransactionEvent Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Eq TransactionEvent Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Ord TransactionEvent Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Read TransactionEvent Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Show TransactionEvent Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

data OrvilleT conn m a Source #

Migration Guide: OrvilleT has been removed. In its place you can simply use + a ReaderT OrvilleState. If you have another ReaderT layer in your monad + stack you can add the OrvilleState to the reader context for that layer + instead, which is more efficient than having multiple ReaderT layers. If + you have a simple case of OrvilleT conn IO the new Orville offers a simpler + Orville monad (not a transformer) to get you started.

Instances
MonadError e m => MonadError e (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

throwError :: e -> OrvilleT conn m a #

catchError :: OrvilleT conn m a -> (e -> OrvilleT conn m a) -> OrvilleT conn m a #

MonadBaseControl b m => MonadBaseControl b (OrvilleT conn m)

Because we recommend using MonadUnliftIO rather than MonadBaseControl, + we do not provide MonadBaseControl instance for OrvilleT by default + along with the definition. If you do need to use MonadBaseControl, + however, this is the canonical instance for OrvilleT.

Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

Associated Types

type StM (OrvilleT conn m) a :: Type

Methods

liftBaseWith :: (RunInBase (OrvilleT conn m) b -> b a) -> OrvilleT conn m a

restoreM :: StM (OrvilleT conn m) a -> OrvilleT conn m a

MonadBase b m => MonadBase b (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

liftBase :: b α -> OrvilleT conn m α

(Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

(IConnection conn, Monad m) => HasOrvilleContext conn (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

getOrvilleEnv :: OrvilleT conn m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleT conn m a -> OrvilleT conn m a Source #

MonadTrans (OrvilleT conn) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

lift :: Monad m => m a -> OrvilleT conn m a #

MonadTransControl (OrvilleT conn)

Because we recommend using MonadUnliftIO rather than MonadTransControl, + we do not provide MonadTransControl instance for OrvilleT by default + along with the definition. If you do need to use MonadTransControl, + however, this is the canonical instance for OrvilleT.

Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

Associated Types

type StT (OrvilleT conn) a :: Type

Methods

liftWith :: Monad m => (Run (OrvilleT conn) -> m a) -> OrvilleT conn m a

restoreT :: Monad m => m (StT (OrvilleT conn) a) -> OrvilleT conn m a

Monad m => Monad (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

(>>=) :: OrvilleT conn m a -> (a -> OrvilleT conn m b) -> OrvilleT conn m b #

(>>) :: OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m b #

return :: a -> OrvilleT conn m a #

fail :: String -> OrvilleT conn m a #

Functor m => Functor (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

fmap :: (a -> b) -> OrvilleT conn m a -> OrvilleT conn m b #

(<$) :: a -> OrvilleT conn m b -> OrvilleT conn m a #

MonadFail m => MonadFail (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

fail :: String -> OrvilleT conn m a #

Applicative m => Applicative (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

pure :: a -> OrvilleT conn m a #

(<*>) :: OrvilleT conn m (a -> b) -> OrvilleT conn m a -> OrvilleT conn m b #

liftA2 :: (a -> b -> c) -> OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m c #

(*>) :: OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m b #

(<*) :: OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m a #

MonadIO m => MonadIO (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

liftIO :: IO a -> OrvilleT conn m a #

Alternative m => Alternative (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

empty :: OrvilleT conn m a #

(<|>) :: OrvilleT conn m a -> OrvilleT conn m a -> OrvilleT conn m a #

some :: OrvilleT conn m a -> OrvilleT conn m [a] #

many :: OrvilleT conn m a -> OrvilleT conn m [a] #

MonadPlus m => MonadPlus (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

mzero :: OrvilleT conn m a #

mplus :: OrvilleT conn m a -> OrvilleT conn m a -> OrvilleT conn m a #

MonadCatch m => MonadCatch (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

catch :: Exception e => OrvilleT conn m a -> (e -> OrvilleT conn m a) -> OrvilleT conn m a

MonadMask m => MonadMask (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

mask :: ((forall a. OrvilleT conn m a -> OrvilleT conn m a) -> OrvilleT conn m b) -> OrvilleT conn m b

uninterruptibleMask :: ((forall a. OrvilleT conn m a -> OrvilleT conn m a) -> OrvilleT conn m b) -> OrvilleT conn m b

generalBracket :: OrvilleT conn m a -> (a -> ExitCase b -> OrvilleT conn m c) -> (a -> OrvilleT conn m b) -> OrvilleT conn m (b, c)

MonadThrow m => MonadThrow (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

throwM :: Exception e => e -> OrvilleT conn m a

MonadOrvilleControl m => MonadOrvilleControl (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleT conn m b) -> OrvilleT conn m b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleT conn m c -> OrvilleT conn m d -> OrvilleT conn m c Source #

MonadUnliftIO m => MonadUnliftIO (OrvilleT conn m) 
Instance details

Defined in Database.Orville.PostgreSQL.MonadUnliftIO

Methods

askUnliftIO :: OrvilleT conn m (UnliftIO (OrvilleT conn m))

withRunInIO :: ((forall a. OrvilleT conn m a -> IO a) -> IO b) -> OrvilleT conn m b

type StT (OrvilleT conn) a 
Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

type StT (OrvilleT conn) a = StT (ReaderT (OrvilleEnv conn)) a
type StM (OrvilleT conn m) a 
Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

type StM (OrvilleT conn m) a = ComposeSt (OrvilleT conn) m a

unOrvilleT :: OrvilleT conn m a -> ReaderT (OrvilleEnv conn) m a Source #

data SqlValue #

Instances
Eq SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Show SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Convertible Bool SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Bool -> ConvertResult SqlValue

Convertible Char SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Char -> ConvertResult SqlValue

Convertible Double SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Double -> ConvertResult SqlValue

Convertible Int SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Int -> ConvertResult SqlValue

Convertible Int32 SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Int32 -> ConvertResult SqlValue

Convertible Int64 SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Int64 -> ConvertResult SqlValue

Convertible Integer SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Integer -> ConvertResult SqlValue

Convertible Rational SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Rational -> ConvertResult SqlValue

Convertible Word32 SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Word32 -> ConvertResult SqlValue

Convertible Word64 SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Word64 -> ConvertResult SqlValue

Convertible String SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: String -> ConvertResult SqlValue

Convertible ByteString SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: ByteString -> ConvertResult SqlValue

Convertible ByteString SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: ByteString -> ConvertResult SqlValue

Convertible Text SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Text -> ConvertResult SqlValue

Convertible Text SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Text -> ConvertResult SqlValue

Convertible ZonedTime SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: ZonedTime -> ConvertResult SqlValue

Convertible LocalTime SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: LocalTime -> ConvertResult SqlValue

Convertible TimeOfDay SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: TimeOfDay -> ConvertResult SqlValue

Convertible UTCTime SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: UTCTime -> ConvertResult SqlValue

Convertible NominalDiffTime SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: NominalDiffTime -> ConvertResult SqlValue

Convertible DiffTime SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: DiffTime -> ConvertResult SqlValue

Convertible Day SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Day -> ConvertResult SqlValue

Convertible SqlValue Bool 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Bool

Convertible SqlValue Char 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Char

Convertible SqlValue Double 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Double

Convertible SqlValue Int 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Int

Convertible SqlValue Int32 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Int32

Convertible SqlValue Int64 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Int64

Convertible SqlValue Integer 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Integer

Convertible SqlValue Rational 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Rational

Convertible SqlValue Word32 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Word32

Convertible SqlValue Word64 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Word64

Convertible SqlValue String 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult String

Convertible SqlValue ByteString 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult ByteString

Convertible SqlValue ByteString 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult ByteString

Convertible SqlValue Text 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Text

Convertible SqlValue Text 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Text

Convertible SqlValue ZonedTime 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult ZonedTime

Convertible SqlValue LocalTime 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult LocalTime

Convertible SqlValue TimeOfDay 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult TimeOfDay

Convertible SqlValue UTCTime 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult UTCTime

Convertible SqlValue NominalDiffTime 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult NominalDiffTime

Convertible SqlValue DiffTime 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult DiffTime

Convertible SqlValue Day 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult Day

Convertible SqlValue SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult SqlValue

Convertible SqlValue CalendarTime 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult CalendarTime

Convertible SqlValue ClockTime 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult ClockTime

Convertible SqlValue TimeDiff 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult TimeDiff

Convertible CalendarTime SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: CalendarTime -> ConvertResult SqlValue

Convertible ClockTime SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: ClockTime -> ConvertResult SqlValue

Convertible TimeDiff SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: TimeDiff -> ConvertResult SqlValue

Convertible SqlValue a => Convertible SqlValue (Maybe a) 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult (Maybe a)

Convertible SqlValue (TimeOfDay, TimeZone) 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: SqlValue -> ConvertResult (TimeOfDay, TimeZone)

Convertible a SqlValue => Convertible (Maybe a) SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: Maybe a -> ConvertResult SqlValue

MonadState [SqlValue] (ToSql a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

get :: ToSql a [SqlValue] #

put :: [SqlValue] -> ToSql a () #

state :: ([SqlValue] -> (a0, [SqlValue])) -> ToSql a a0 #

Convertible (TimeOfDay, TimeZone) SqlValue 
Instance details

Defined in Database.HDBC.SqlValue

Methods

safeConvert :: (TimeOfDay, TimeZone) -> ConvertResult SqlValue

class IConnection conn => HasOrvilleContext conn m | m -> conn where Source #

Migration Guide: HasOrvilleContext has been renamed to HasOrvilleState. + getOrvilleEnv and localOrvilleEnv have been renamed to askOrvilleState + and localOrvilleState.

HasOrvilleContext defines the operations that must be available in your own + monad for managing the connection pool that Orville functions will use to + access the database and manage transaction state. In most cases you can + include OrvilleT in your Monad stack and then automatically derive an + instance of HasOrvilleContext.

You could also provide your own implementations of these functions + instead of using OrvilleT, if that is the easiest approach for + your Monad.

Methods

getOrvilleEnv :: m (OrvilleEnv conn) Source #

getOrvilleEnv fetches the Orville environment from the Monad context. + Analogous to ask from the Reader monad.

localOrvilleEnv Source #

Arguments

:: (OrvilleEnv conn -> OrvilleEnv conn) 
-> m a 
-> m a

localOrvilleEnv locally modifies the Orville environment for the + scope of the provided action. This allows Orville to track with + a connection is acquired, open transactions, etc. Analogous to local + from the Reader monad.

Instances
(Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (ResourceT m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.ResourceT

Methods

getOrvilleEnv :: ResourceT m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> ResourceT m a -> ResourceT m a Source #

(Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (StateT s m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

getOrvilleEnv :: StateT s m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> StateT s m a -> StateT s m a Source #

(IConnection conn, Monad m) => HasOrvilleContext conn (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

getOrvilleEnv :: OrvilleT conn m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleT conn m a -> OrvilleT conn m a Source #

(Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (ReaderT a m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

getOrvilleEnv :: ReaderT a m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> ReaderT a m a0 -> ReaderT a m a0 Source #

(Monad m, IConnection conn) => HasOrvilleContext conn (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

getOrvilleEnv :: OrvilleTriggerT trigger conn m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a Source #

class (Monad m, MonadIO m, HasOrvilleContext conn m, MonadThrow m, MonadOrvilleControl m, MonadFail m) => MonadOrville conn m Source #

Migration Guide: MonadOrville retains the same name, but the conn + parameter has been removed. MonadFail and MonadThrow have been removed as + superclass constraints.

MonadOrville does not have any methods of its own. Instead it brings all + the typeclass constraints required by Orville functions that need to access + the database into a single typeclass. In some cases you can include + OrvilleT in your Monad stack and then automatically derive an instance of + MonadOrville. However, more likely you are using some third party monad + somewhere in your stack that does not han a MonadOrvilleControl instance. + In this case you won't be able to derive MonadOrville, but providing a + simple empty instance will do:

   instance O.MonadOrville Postgres.Connection MyMonad
+ 
Instances
(MonadUnliftIO m, MonadOrville conn m) => MonadOrville conn (ResourceT m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.ResourceT

(Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

(Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrville conn m) => MonadOrville conn (ReaderT a m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

(Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a Source #

Migration Guide: runOrville now operates on the concrete Orville monad + becase OrvilleT has been removed. Assuming you are replacing usages of + OrvilleT with ReaderT you will want to replace usages of runOrville + with runReaderT.

mapOrvilleT :: Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b Source #

Migration Guide: mapOrvilleT has been removed because OrvilleT has been + removed. If you're replacing OrvilleT with ReaderT then mapOrvilleT + should be replaced with mapReaderT.

class MonadOrvilleControl m where Source #

Migration Guide: MonadOrvilleControl retains the same name. The + liftFinally member has been removed. There are new liftCatch and + liftMask members that must be implemented, however. Instances of the new + MonadOrvilleControl are provided for IO and ReaderT. Helper functions + for implmenting the members via UnliftIO can be found in + Orville.PostgreSQL.UnliftIO.

MonadOrvilleControl provides an interface for the kinds of IO operations + that Orville functions need to lift into the Monad providing the + MonadOrville instance. This typeclass allows users to provide their + own lifting strategies in case the Monad stack in question has special + needs. If you are only using ReaderT and OrvilleT layers in your + monad stack, you can probably implement this for your own Monad wrapper + type using the provided default functions and providing functions to + wrap and unwrapper your Monad layer:

   instance MonadOrvilleControl MyMonad where
+     liftWithConnection = defaultLiftWithConnection wrapMyMonad unWrapMyMonad
+     liftFinally = defaultLiftFinally wrapMyMonad unWrapMyMonad
+  

If you are using transformers in your monad stack beyond ReaderT, they + probably don't provide MonadOrvilleControl instances (e.g. third party + libraries). In this case, see MonadUnliftIO for more + help. If you're still stuck (because your library doesn't support + MonadTransControl), try MonadBaseControl instead. If + you're *still* stuck after that, please file an issue on Github at + https://github.com/flipstone/orville so we can can help out!

Methods

liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c Source #

Instances
MonadOrvilleControl IO Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> IO b) -> IO b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> IO c -> IO d -> IO c Source #

(MonadOrvilleControl m, MonadUnliftIO m) => MonadOrvilleControl (ResourceT m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.ResourceT

Methods

liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> ResourceT m b) -> ResourceT m b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> ResourceT m c -> ResourceT m d -> ResourceT m c Source #

MonadOrvilleControl m => MonadOrvilleControl (ReaderT a m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

liftWithConnection :: (forall a0. (conn -> IO a0) -> IO a0) -> (conn -> ReaderT a m b) -> ReaderT a m b Source #

liftFinally :: (forall a0 b. IO a0 -> IO b -> IO a0) -> ReaderT a m c -> ReaderT a m d -> ReaderT a m c Source #

MonadBaseControl IO m => MonadOrvilleControl (StateT a m) Source #

Because lifting control operations into StateT is fraught with peril, a + MonadOrvilleControl instance for StateT is provided here and implemented + via MonadBaseControl rather than together with the MonadOrvilleControl + definition. We do not recommend using stateful Monad transformer layers in + Monad stacks based on IO. For anyone that must, this is the canonical + instance for StateT

Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

Methods

liftWithConnection :: (forall a0. (conn -> IO a0) -> IO a0) -> (conn -> StateT a m b) -> StateT a m b Source #

liftFinally :: (forall a0 b. IO a0 -> IO b -> IO a0) -> StateT a m c -> StateT a m d -> StateT a m c Source #

MonadOrvilleControl m => MonadOrvilleControl (OrvilleT conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Monad

Methods

liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleT conn m b) -> OrvilleT conn m b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleT conn m c -> OrvilleT conn m d -> OrvilleT conn m c Source #

(Monad m, MonadOrvilleControl m) => MonadOrvilleControl (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleTriggerT trigger conn m c -> OrvilleTriggerT trigger conn m d -> OrvilleTriggerT trigger conn m c Source #

defaultLiftWithConnection :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a. (conn -> IO a) -> IO a) -> (conn -> n b) -> n b Source #

Migration Guide: defaultLiftWithConnection has been removed. In its + place you can use either the ReaderT instance of MonadOrvilleControl + or the helpers in Orville.PostgreSQL.UnliftIO.

defaultLiftWithConnection provides a simple definition of + liftWithConnection for MonadOrvilleControl instances when the Monad in + question is a wrapper around a type that already implements + MonadOrvilleControl

defaultLiftFinally :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a b. IO a -> IO b -> IO a) -> n c -> n d -> n c Source #

Migration Guide: defaultLiftWithConnection has been removed (along with + liftFinally)

defaultLiftFinally provides a simple definition of + liftWithConnection for MonadOrvilleControl instances when the Monad in + question is a wrapper around a type that already implements + MonadOrvilleControl

data QueryType Source #

withCachedConnection :: MonadOrville conn m => m a -> m a Source #

Migration Guide: withCachedConnection has been renamed to withConnection_

Runs an action with a cached connection. + Without using this, or wrapping calls in a transaction using withTransaction, successive + calls to functions like insertRecord and updateRecord are *not* guaranteed to occur on the + same connection.

withTransaction :: MonadOrville conn m => m a -> m a Source #

Migration Guide: withTransaction retains the same name.

data ColumnFlag Source #

Migration Guide: ColumnFlag has been removed. Depending on flag constructor + there may or may not be a replacement.

ColumnDefault - replaced by the setDefaultValue function in new orville + Unique - replaced by the addUniqueConstraint function in new orville + References - replaced by the addForeignKeyConstraint function in new orville + ColumnDescription - removed + AssignedByDatabase - removed, though many cases are handled by marshallReadOnlyField

Constructors

ColumnDefault a => Default a 
Unique 
References (TableDefinition readEntity writeEntity key) (FieldDefinition nullability key) 
ColumnDescription String 
AssignedByDatabase 

data Now Source #

Constructors

Now 

data FieldDefinition nullability a Source #

Migration Guide: The signature of the FieldDefinition type has not changed, + but many of the constructors and accessors have. See the migration guides + on individual functions for more info.

Instances
ColumnSpecifier (FieldDefinition nullability a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.FromSql

Methods

selectForm :: FieldDefinition nullability a -> SelectForm Source #

data Nullable Source #

Nullable is a values-less type used to track that a FieldDefinition + represents a field that is marked nullable in the database schema. See the + Nullability type for the value-level representation of field nullability.

data NotNull Source #

'NotNull is a values-less type used to track that a FieldDefinition + represents a field that is marked not-null in the database schema. See the + Nullability type for the value-level representation of field nullability.

data Nullability nullability where Source #

Nullability represents whether a field will be marked as NULL or 'NOT + NULL' in the database schema. It is a GADT so that the value constructors + can be used to record this knowledge in the type system as well. This allows + functions that work only on Nullable or NotNull fields to indicate this + in their type signatures as appropriate.

isFieldNullable :: FieldDefinition nullability a -> Bool Source #

Migration Guide: isFieldNullable has been replaced with + fieldIsNotNullable, which has the same signture but the Bool returned is + the opposite.

fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a Source #

Migration Guide: fieldOfType is essentially unchanged in the new orville.

textField :: String -> Int -> FieldDefinition NotNull Text Source #

Migration Guide: textField has been renamed to boundedTextField. It now + takes an Int32 rather than an Int

fixedTextField :: String -> Int -> FieldDefinition NotNull Text Source #

Migration Guide: fixedTextField retains the same name. It now + takes an Int32 rather than an Int

unboundedTextField :: String -> FieldDefinition NotNull Text Source #

Migration Guide: unboundedTextField retains the same name.

dayField :: String -> FieldDefinition NotNull Day Source #

Migration Guide: dayField has been renamed to dateField

utcTimeField :: String -> FieldDefinition NotNull UTCTime Source #

Migration Guide: utcTimeField has been renamed to utcTimestampField

int32Field :: String -> FieldDefinition NotNull Int32 Source #

Migration guide: int32Field has been renamed to integerField

int64Field :: String -> FieldDefinition NotNull Int64 Source #

Migration guide: int64Field has been renamed to bigIntegerField

doubleField :: String -> FieldDefinition NotNull Double Source #

Migration guide: doubleField retains the same name.

boolField :: String -> FieldDefinition NotNull Bool Source #

Migration guide: boolField has been renamed to booleanField

automaticIdField :: String -> FieldDefinition NotNull Int32 Source #

Migration guide: automaticIdField has been renamed to serialField

searchVectorField :: String -> FieldDefinition NotNull Text Source #

Migration guide: searchVectorField has been renamed to textSearchVectorField

nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a) Source #

Migration Guide: nullableField retains the same name

Makes a NotNull field Nullable by wrapping the Haskell type of the field + in Maybe. The field will be marked as NULL in the database schema and + the value Nothing will be used to represent NULL values when converting + to and from sql.

foreignKeyField :: String -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> FieldDefinition nullability key Source #

Migration Guide: foreignKeyField has been removed. It is replaced by + addForeignKeyConstraint which adds a foreign key constraint to an existing + FieldDefinition.

withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a Source #

Migration Guide: withFlag has been removed. See the migration guide + on ColumnFlag regarding the new API.

withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a Source #

Migration Guide: withName has been removed.

withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b Source #

Migration Guide: withConversion has been replaced with convertField, + whose arguments are flipped from those of withConversion. Note there is + also now a coerceField function that can be used with newtype wrappers, + provided the constructor is available where coerceField is used.

fieldFromSql :: FieldDefinition nullability a -> FromSql a Source #

Migration Guide: fieldFromSql has been replaced with fieldValueFromSqlValue

fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue Source #

Migration Guide: fieldToSqlValue has been renamed to fieldValueToSqlValue

data SomeField Source #

Constructors

SomeField (FieldDefinition nullability a) 

withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a Source #

Migration Guide: withPrefix has been replaced by prefixField whose + arguments are flipped relative to withPrefix

fieldType :: FieldDefinition nullability a -> SqlType a Source #

fieldFlags :: FieldDefinition nullability a -> [ColumnFlag] Source #

fieldFlags has been removed. See the new fieldDefaultValue and fieldTableConstraints functions

uniqueIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition Source #

Migration Guide: uniqueIndex no longer requires a name to be specified. + Migration will be done automatically by inspecting the structure of the + indexes that exist in the database. It also no longer accepts a + TableDefinition at the time of creating the IndexDefinition. Instead you + should use addTableIndexes to add the IndexDefinition to the + TableDefinition for the table that you wish to index.

If you wish to specify the index name explicitly, you can use + uniqueNamedIndex instead. If you do so, index migration will be managed by + comparing to the names of existing indexes rather than checking that the + index structure matches the Haskell definition.

simpleIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition Source #

Migration Guide: simpleIndex has been renamed to nonUniqueIndex. It no + longer requires a name to be specified. Migration will be done automatically + be inspecting the structure of the indexes that exist in the database. It + also no longer accepts a TableDefinition at the time of creating the + IndexDefinition. Instead you should use addTableIndexes to add the + IndexDefinition to the TableDefinition for the table that you wish to + index.

If you wish to specify the index name explicitly, you can use + nonUniqueNamedIndex instead. If you do so, index migration will be managed + by comparing to the names of existing indexes rather than checking that the + index structure matches the Haskell definition.

simplePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition Source #

Works much the same as simpleIndex but takes a list of strings that are the conditions of a + where clause on index creation for partial indexes

uniquePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition Source #

Works much the same as uniqueIndex but takes a list of strings that are the conditions of a + where clause on index creation for partial indexes

uniqueConstraint :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> ConstraintDefinition Source #

Migration Guide: uniqueConstraint no longer accepts a name parameter. + Instead the constraint is migrated automatically based on the structure of + existing constraints found in the database. It also no longer accepts a + TableDefinition. Instead you should use addTableConstraints to add the + ConstraintDefinition to the table that you wish to apply the constraint to.

dropConstraint :: TableDefinition readEntity writeEntity key -> String -> SchemaItem Source #

Migration Guide: dropConstraint has been removed. Constraints are now + dropped automatically during auto-migration when they are removed from the + TableDefinition.

data FromSql a Source #

Instances
Functor FromSql Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

fmap :: (a -> b) -> FromSql a -> FromSql b #

(<$) :: a -> FromSql b -> FromSql a #

Applicative FromSql Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

pure :: a -> FromSql a #

(<*>) :: FromSql (a -> b) -> FromSql a -> FromSql b #

liftA2 :: (a -> b -> c) -> FromSql a -> FromSql b -> FromSql c #

(*>) :: FromSql a -> FromSql b -> FromSql b #

(<*) :: FromSql a -> FromSql b -> FromSql a #

data FromSqlError Source #

Constructors

RowDataError !RowDataErrorDetails

Captures a failure in the translation of a SQL value from a particular + field to it's corresponding Haskell values.

MissingColumn !MissingColumnDetails

An expected column was not returned by the database

ConversionError !ConversionErrorDetails

A conversion between haskell representations failed at a point where + we don't know what column the value came from. This is the case when + using the partialMap combinator.

data RowDataErrorDetails Source #

Constructors

RowDataErrorDetails 

Fields

data RowDataErrorReason Source #

Constructors

TypeMismatch

Sql value has a different type than expected

Fields

IntegralOutOfBounds

An integer value was outside the expected bounds.

Fields

DecodingFailure !String

Generic decoding failure

data ConversionErrorDetails Source #

Constructors

ConversionErrorDetails 

Fields

showFromSqlErrorMinimal :: FromSqlError -> String Source #

Shows the error in a way that should not contain any potentially sensitive + data. This is used for the Show instance.

showFromSqlErrorForLogging :: FromSqlError -> String Source #

Shows the error in a way appropriate for logging within an application. + The resulting string contains information that is useful for debugging but + is potentially undesirable to expose outside of the application (such as + primary key values).

showSqlValueType :: SqlValue -> String Source #

User friendly identifier labels for SqlValues

col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a Source #

data ToSql a b Source #

Instances
MonadReader a (ToSql a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

ask :: ToSql a a #

local :: (a -> a) -> ToSql a a0 -> ToSql a a0 #

reader :: (a -> a0) -> ToSql a a0 #

Monad (ToSql a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

(>>=) :: ToSql a a0 -> (a0 -> ToSql a b) -> ToSql a b #

(>>) :: ToSql a a0 -> ToSql a b -> ToSql a b #

return :: a0 -> ToSql a a0 #

fail :: String -> ToSql a a0 #

Functor (ToSql a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

fmap :: (a0 -> b) -> ToSql a a0 -> ToSql a b #

(<$) :: a0 -> ToSql a b -> ToSql a a0 #

Applicative (ToSql a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

pure :: a0 -> ToSql a a0 #

(<*>) :: ToSql a (a0 -> b) -> ToSql a a0 -> ToSql a b #

liftA2 :: (a0 -> b -> c) -> ToSql a a0 -> ToSql a b -> ToSql a c #

(*>) :: ToSql a a0 -> ToSql a b -> ToSql a b #

(<*) :: ToSql a a0 -> ToSql a b -> ToSql a a0 #

MonadState [SqlValue] (ToSql a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Types

Methods

get :: ToSql a [SqlValue] #

put :: [SqlValue] -> ToSql a () #

state :: ([SqlValue] -> (a0, [SqlValue])) -> ToSql a a0 #

getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity () Source #

getComponent :: (entity -> a) -> ToSql a () -> ToSql entity () Source #

data SchemaItem Source #

Migration Guide: SchemaItem retains the same name. The Index, + DropIndex, Constraint and DropConstraint constructors have been + removed. These items are now added to the TableDefinition via + addTableConstraints and addTableIndexes. The remaining constructors have + been prefixed with the word Schema (e.g. Table has been renamed to + SchemaTable). There is no explicit replacement for DropIndex and + DropConstraint. Orville will automatically drop indexes and constraints + that are no longer mentioned on the TableDefinition for any tables that it + migrates.

type SchemaDefinition = [SchemaItem] Source #

Migration Guide: SchemaDefinition has been removed. Use [SchemaItem] + instead.

type Record = Int Source #

Migration Guide: Record has been removed. It's recommended that you + create a separate record key type for each of your entities instead.

whereAnd :: [WhereCondition] -> WhereCondition Source #

Migration Guide: whereAnd has been removed. Use the binary function + andExpr to combine BooleanExpr expressions instead. andExpr is also + available as the operator (.&&)

whereOr :: [WhereCondition] -> WhereCondition Source #

Migration Guide: whereOr has been removed. Use the binary function + orExpr to combine BooleanExpr expressions instead. orExpr is also + available as the operator (.||)

whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition Source #

Migration Guide: whereIn has been renamed to fieldIn. It now takes a + NonEmpty list of values to reflect this is a requirement in SQL.

whereLike :: FieldDefinition nullability a -> String -> WhereCondition Source #

Migration Guide: whereLike has been renamed to fieldLike. It now takes a + T.Text value rather than a String.

whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition Source #

Migration Guide: whereLikeInsensitive has been renamed to + fieldLikeInsensitive. It now takes a T.Text value rather than a String.

whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition Source #

Migration Guide: whereNotIn has been renamed to fieldNotIn. It now takes a + NonEmpty list of values to reflect this is a requirement in SQL.

whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition Source #

Migration Guide: whereQualified has been removed. If you need qualified + column references you can use the SQL building functions found in + Orville.PostgreSQL.Expr to build them. The qualifyColumn function can be + used to qualify column references in that context. BooleanExpr values built + directly this way can be easily used in conjuction with other helpers such as + fieldEquals which also build BooleanExpr values themselves.

whereRaw :: String -> [SqlValue] -> WhereCondition Source #

Migration Guide: whereRaw has been removed. In its place you should use the + more general functions such as unsafeSqlExpression or unsafeRawSql in the + Orville.PostgreSQL.Raw.RawSql module to build a BooleanExpr.

whereToSql :: [WhereCondition] -> (String, [SqlValue]) Source #

Migration Guide: whereToSql has been removed. It is replaced by the more + general toBytesAndParams function in Orville.PostgreSQL.Raw.RawSql.

isNull :: FieldDefinition Nullable a -> WhereCondition Source #

Migration Guide: isNull has been renamed to fieldIsNull

isNotNull :: FieldDefinition Nullable a -> WhereCondition Source #

Migration Guide: isNotNull has been renamed to fieldIsNotNull

(.==) :: FieldDefinition nullability a -> a -> WhereCondition Source #

(.<>) :: FieldDefinition nullability a -> a -> WhereCondition Source #

(.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition Source #

(%==) :: FieldDefinition nullability a -> a -> WhereCondition Source #

(.>) :: FieldDefinition nullability a -> a -> WhereCondition Source #

(.>=) :: FieldDefinition nullability a -> a -> WhereCondition Source #

(.<) :: FieldDefinition nullability a -> a -> WhereCondition Source #

(.<=) :: FieldDefinition nullability a -> a -> WhereCondition Source #

order :: ToOrderBy a => a -> SortDirection -> SelectOptions Source #

groupBy :: ToGroupBy a => a -> SelectOptions Source #

(<>) :: Semigroup a => a -> a -> a infixr 6 #

An associative operation.

(.:=) :: FieldDefinition nullability a -> a -> FieldUpdate Source #

migrateSchema :: MonadOrville conn m => SchemaDefinition -> m () Source #

Migration Guide: migrateSchema has been renamed to autoMigrateSchema

migrateSchema will attempt to make changes to the actual database schema + that it it matches the provided SchemaDefinition. Unsafe migrations such as + dropping tables or columns are never attempted unless the SchemaDefinition + explicitly states that the items are safe to drop. Column types may be changed, + but will fail if the database cannot successfully make the request type change.

generateMigrationPlan :: MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan) Source #

Migration Guide: generateMigrationPlan retains the same name. It has + changed to always return a MigrationPlan. You can use check whether + migrationPlanSteps is as empty list if you wish to determine whether any + migrations will be performed by the plan.

generateMigrationPlan inspects the state of the actual database schema and + constructs a plan describing what changes would be made to make it match the + provided SchemaDefinition. If the actual schema already matches the + definition, Nothing will be returned.

data MigrationPlan Source #

Migration Guide: MigrationPlan retains the same name.

data MigrationItem Source #

Migration Guide: MigrationItem has been renamed to MigrationStep, which + is now a simple RawSql wrapper. You can use RawSql.toExampleBytes if you + wish to render it to a bytestring for display purposes.

migrationPlanItems :: MigrationPlan -> [MigrationItem] Source #

Migration Guide: migrationPlanItems has been renamed to + migrationPlanSteps

data Pagination m entity Source #

Constructors

Pagination 

Fields

buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> m (Pagination m readEnt) Source #

selectAll :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m [readEntity] Source #

Migration Guide: selectAll has been renamed to findEntitiesBy

selectFirst :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m (Maybe readEntity) Source #

Migration Guide: selectFirst has been renamed to findFirstEntityBy

deleteRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m () Source #

Migration Guide: deleteRecord has been renamed to deleteEntity. Note + that there are also new variant functions deleteAndReturnEntity and + deleteEntityAndReturnRowCount that return Maybe readEntity and Int + respectively.

deleteWhere :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [WhereCondition] -> m Integer Source #

Migration Guide: deleteWhere has been renamed to deleteEntities. It + now takes a Maybe BooleanExpr rather than [WhereCondition]

findRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m (Maybe readEntity) Source #

Migration Guide: findRecord has been renamed to findEntity

findRecords :: (Ord key, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> [key] -> m (Map key readEntity) Source #

Migration Guide: findRecords has been renamed to findEntities. It now + requires a NonEmpty key rather than simply [key] and returns a + [readEntity] instead of a Map.

findRecordsBy :: (Ord fieldValue, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> m (Map fieldValue [readEntity]) Source #

Migration Guide: findRecordsBy has been renamed to findEntitiesBy. It + no longer takes a FieldDefinition to group by. Instead it simply returns + a [readEntity]

insertRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity Source #

Migration Guide: insertRecord has been renamed to insertAndReturnEntity. + Note there are also new variant functions insertEntity and + insertEntityAndReturnRowCount that return () and Int respectively.

insertRecordMany :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m () Source #

Migration Guide: insertRecordMany has been renamed to insertEntities. It + now requires a NonEmpty writeEntity rather than [writeEntity]. Note that + there are also new variant functions insertAndReturnEntities and + insertEntitiesAndReturnRowCount.

insertRecordManyReturning :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m [readEntity] Source #

Migration Guide: insertRecordManyReturning has been renamed to + insertAndReturnEntities.

updateFields :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [FieldUpdate] -> [WhereCondition] -> m Integer Source #

Migration Guide: updateFields has been renamed to + updateFieldsAndReturnRowCount, but now takes a NonEmpty SetClause instead + of a [Field Update] and a Maybe BooleanExpr instead of a + [WhereCondition].

updateFields still exists as a variant of this function, but returns () + rather than Int. updateFieldsAndReturnEntities is now available as well.

updateRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> writeEntity -> m () Source #

Migration Guide: updateRecord has been renamed to updateEntity. Note that + there are also new variant functions updateAndReturnEntity and + updateEntityAndReturnRowCount@.

createIndexesConcurrently :: MonadOrville conn m => [IndexDefinition] -> m () Source #

Migration Plan: createIndexesConcurrently has been removed. You should now + use setIndexCreationStrategy Asynchronous instead.

createIndexesConcurrently will create the given indexes, if they do not exist using the + PostgreSQL concurrently feature. However, this does *not* mean the the function happens + concurrently. This will wait for PostgreSQL to return, but other operations to the table will be + allowed during index creation.

Note: PostgreSQL does not allow CREATE INDEX CONCURRENTLY to appear inside of a transaction. Use + this function with care.

dropIndexesConcurrently :: MonadOrville conn m => [String] -> m () Source #

Migration Guide: dropIndexesConcurrently has been removed.

dropIndexesConcurrently will drop each of the given indexes with the CONCURRENTLY keyword, + allowing for other table operations to continue while the index is dropped. However there are + several caveats that come with this as noted at + https://www.postgresql.org/docs/9.6/sql-dropindex.html . Much like createIndexesConcurrently + this cannot be used in a transaction. But further this cannot drop indexes that support UNIQUE or + PRIMARY KEY constraints.

Use this with care.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html new file mode 100644 index 0000000..5a0c074 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Expr

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Expr

Description

 

Documentation

data Expr a Source #

Instances
GenerateSql a => GenerateSql (Expr a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Expr.Expr

expr :: a -> Expr a Source #

qualified :: QualifySql form => form -> String -> form Source #

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html new file mode 100644 index 0000000..2701b21 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html @@ -0,0 +1,31 @@ +Database.Orville.PostgreSQL.MonadBaseControl

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.MonadBaseControl

Description

MonadBaseControl provides functions and instances for +using MonadOrville and OrvilleT for situations where you need to use +MonadBaseControl. If you do not know if you need MonadBaseControl, then +you probably don't need to use this module. If you are thinking about +using MonadBaseControl instead of MonadUnliftIO, we recommend +reading Michael Snoyman's excellent "A Tale of Two Brackets" +(https:/www.fpcomplete.comblog201706/tale-of-two-brackets) if you +have not already done so.

If you're still here after reading above, this module provides +the functions you need to implement MonadOrvilleControl for your +Monad stack using its MonadBaseControl instance. The most common way +to do this is simply to add the following MonadOrvilleControl instance:

 instance MonadOrvilleControl MyMonad where
+   liftWithConnection = liftWithConnectionViaBaseControl
+   liftFinally = liftFinallyViaBaseControl
+

This module also provides a MonadOrvilleControl for StateT as well as +MonadBaseControl and MonadTransControl instances for OrvilleT and +OrvilleTriggerT.

Synopsis

Documentation

liftWithConnectionViaBaseControl :: MonadBaseControl IO m => (forall b. (conn -> IO b) -> IO b) -> (conn -> m a) -> m a Source #

liftWithConnectionViaBaseControl can be use as the implementation of + liftWithConnection for MonadOrvilleControl when the Monad + implements MonadBaseControl.

liftFinallyViaBaseControl :: MonadBaseControl IO m => (forall c d. IO c -> IO d -> IO c) -> m a -> m b -> m a Source #

liftFinallyViaBaseControl can be use as the implementation of + 'liftFinally for MonadOrvilleControl when the Monad + implements MonadBaseControl.

Orphan instances

MonadBaseControl b m => MonadBaseControl b (OrvilleT conn m) Source #

Because we recommend using MonadUnliftIO rather than MonadBaseControl, + we do not provide MonadBaseControl instance for OrvilleT by default + along with the definition. If you do need to use MonadBaseControl, + however, this is the canonical instance for OrvilleT.

Instance details

Associated Types

type StM (OrvilleT conn m) a :: Type

Methods

liftBaseWith :: (RunInBase (OrvilleT conn m) b -> b a) -> OrvilleT conn m a

restoreM :: StM (OrvilleT conn m) a -> OrvilleT conn m a

MonadBaseControl b m => MonadBaseControl b (OrvilleTriggerT trigger conn m) Source # 
Instance details

Associated Types

type StM (OrvilleTriggerT trigger conn m) a :: Type

Methods

liftBaseWith :: (RunInBase (OrvilleTriggerT trigger conn m) b -> b a) -> OrvilleTriggerT trigger conn m a

restoreM :: StM (OrvilleTriggerT trigger conn m) a -> OrvilleTriggerT trigger conn m a

MonadTransControl (OrvilleT conn) Source #

Because we recommend using MonadUnliftIO rather than MonadTransControl, + we do not provide MonadTransControl instance for OrvilleT by default + along with the definition. If you do need to use MonadTransControl, + however, this is the canonical instance for OrvilleT.

Instance details

Associated Types

type StT (OrvilleT conn) a :: Type

Methods

liftWith :: Monad m => (Run (OrvilleT conn) -> m a) -> OrvilleT conn m a

restoreT :: Monad m => m (StT (OrvilleT conn) a) -> OrvilleT conn m a

MonadTransControl (OrvilleTriggerT trigger conn) Source # 
Instance details

Associated Types

type StT (OrvilleTriggerT trigger conn) a :: Type

Methods

liftWith :: Monad m => (Run (OrvilleTriggerT trigger conn) -> m a) -> OrvilleTriggerT trigger conn m a

restoreT :: Monad m => m (StT (OrvilleTriggerT trigger conn) a) -> OrvilleTriggerT trigger conn m a

MonadBaseControl IO m => MonadOrvilleControl (StateT a m) Source #

Because lifting control operations into StateT is fraught with peril, a + MonadOrvilleControl instance for StateT is provided here and implemented + via MonadBaseControl rather than together with the MonadOrvilleControl + definition. We do not recommend using stateful Monad transformer layers in + Monad stacks based on IO. For anyone that must, this is the canonical + instance for StateT

Instance details

Methods

liftWithConnection :: (forall a0. (conn -> IO a0) -> IO a0) -> (conn -> StateT a m b) -> StateT a m b Source #

liftFinally :: (forall a0 b. IO a0 -> IO b -> IO a0) -> StateT a m c -> StateT a m d -> StateT a m c Source #

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html new file mode 100644 index 0000000..12fcd88 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html @@ -0,0 +1,14 @@ +Database.Orville.PostgreSQL.MonadUnliftIO

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.MonadUnliftIO

Description

MonadUnliftIO provides functions and instances for using +MonadOrville and OrvilleT for Monad transformer stacks that are using +MonadUnliftIO. The most common way to do this is simply to add the +following MonadOrvilleControl instance:

 instance MonadOrvilleControl MyMonad where
+   liftWithConnection = liftWithConnectionViaUnliftIO
+   liftFinally = liftFinallyViaUnliftIO
+

This module also provides a MonadUnliftIO instance for OrvilleT and OrvilleTrigger. +|

Synopsis

Documentation

liftWithConnectionViaUnliftIO :: MonadUnliftIO m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b Source #

liftWithConnectionViaUnliftIO can be use as the implementation of + liftWithConnection for MonadOrvilleControl when the Monad + implements MonadUnliftIO. + |

liftFinallyViaUnliftIO :: MonadUnliftIO m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c Source #

liftFinallyViaUnliftIO can be use as the implementation of + liftFinally for MonadOrvilleControl when the Monad + implements MonadUnliftIO. + |

Orphan instances

MonadUnliftIO m => MonadUnliftIO (OrvilleT conn m) Source # 
Instance details

Methods

askUnliftIO :: OrvilleT conn m (UnliftIO (OrvilleT conn m))

withRunInIO :: ((forall a. OrvilleT conn m a -> IO a) -> IO b) -> OrvilleT conn m b

MonadUnliftIO m => MonadUnliftIO (OrvilleTriggerT trigger conn m) Source # 
Instance details

Methods

askUnliftIO :: OrvilleTriggerT trigger conn m (UnliftIO (OrvilleTriggerT trigger conn m))

withRunInIO :: ((forall a. OrvilleTriggerT trigger conn m a -> IO a) -> IO b) -> OrvilleTriggerT trigger conn m b

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html new file mode 100644 index 0000000..d6d9d7e --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Plan.Explanation

orville-postgresql-legacy-0.9.0.1: ORM

Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Plan.Explanation

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html new file mode 100644 index 0000000..8540c84 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html @@ -0,0 +1,30 @@ +Database.Orville.PostgreSQL.Plan.Many

orville-postgresql-legacy-0.9.0.1: ORM

Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Plan.Many

Synopsis

Documentation

data Many k a Source #

A 'Many k a' represents a group of values keyed by list of parameters and + is used to return the results of executing an Orville Plan with a list of + input parameters. If you need to find the result of the query associated + with a particular input parameter, you can use lookup to find it. If you + don't care about the association with particular inputs, you can simply + use elems to get a list of all the results.

Instances
Functor (Many k) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Plan.Many

Methods

fmap :: (a -> b) -> Many k a -> Many k b #

(<$) :: a -> Many k b -> Many k a #

data NotAKey Source #

NotAKey is returned from various Many related functions when presented + with an input parameter that was not one of the original inputs that the + Many was constructed with.

Constructors

NotAKey 

fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a Source #

fromKeys constructs a Many value from a list of keys and a function that + maps them to their values. The order and duplication of keys in the list will + be preserved by the Many type in the relevant functions. The mapping + function provided should be a total function -- i.e. it should not produce a + runtime error. If it is not possible to map every k (even those not in the + input list provided to fromKeys), the values should be wrapped in an + appropriate type such as Maybe so that an empty or default value can be + returned.

lookup :: k -> Many k a -> Either NotAKey a Source #

lookup returns the value for the given parameter. If the given k is + not one of the original input values that the Many was constructed with, + the mapping function given at the contructor will determine what value to + return. Often this will be whatever a reasonable empty or default value for + the type a is.

keys :: Many k a -> [k] Source #

keys fetches the list of keys from a Many. Note that is a list and not + a set. Many preserves the order and duplication of any key values that were + in the key list at the time of construction.

elems :: Many k a -> [a] Source #

elems returns all the values that correspond the keys of the Many. The + values will be returned in the same order that the keys were present at the + time of creation, though if you truly care about this it's probably better to + use lookup to make that correspondence explicit.

map :: (a -> b) -> Many k a -> Many k b Source #

map calls a function on all the values found in a Many collection.

toMap :: Ord k => Many k a -> Map k a Source #

toMap converts the Many into a Map value. If all you wanted to do was + find the value for a specific key, you should probably use lookup instead.

apply :: Many param (a -> b) -> Many param a -> Many param b Source #

apply allows you to apply many functions to many values. The function + associated with each parameter is applied to the value associated with the + same paremeter.

(If you're looking for pure or an Applicative instance for Many, this + is as good as it gets. Many cannot be an Applicative because there is no + correct implementation of pure that we can reasonably provide).

compose :: Many b c -> Many a b -> Many a c Source #

compose uses the values of a Many value as keys to a second Many to + create a Many mapping from the original keys to the final values.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html new file mode 100644 index 0000000..f5a83ff --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html @@ -0,0 +1,67 @@ +Database.Orville.PostgreSQL.Plan.Operation

orville-postgresql-legacy-0.9.0.1: ORM

Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Plan.Operation

Synopsis

Documentation

data Operation param result Source #

Operation provides a stucture for building primitive operations that can be + incorporated into a Plan. An Operation + provides base case implementations of the various plan execution functions. + You only need to care about this type if you want to create new custom + operations to include in a Plan beyond + those already provided in the Plan + api.

Constructors

Operation 

Fields

data AssertionFailed Source #

AssertionFailed may be returned from the execute functions of an + Operation to indicate that some expected invariant has failed. For example, + following a foreign key that is enforced by the database only to find that no + record exists. When an Operation returns an AssertionFailed value during + plan execution the error is thrown as an exception using the + MonadThrow instance for whatever monad the plan is + executing in.

findOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue (Maybe readEntity) Source #

findOne builds a planning primitive that finds (at most) one row from the + given table where the column value for the provided FieldDefinition matches + the plan's input parameter. When executed on multiple parameters it fetches + all rows where the field matches the inputs and arbitrarily picks at most one + of those rows to use as the result for each input.

findOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue (Maybe readEntity) Source #

findOneWhere is similar to findOne but allows a WhereCondition to be + specified that is added to the database query to restrict which rows are + returned.

findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue [readEntity] Source #

findAll builds a planning primitive that finds all the rows from the + given table where the column value for the provided field matches the + plan's input parameter. Where executed on multiple parameters all rows + are fetch in a single query and then associated with their respective + inputs after being fetched.

findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue [readEntity] Source #

findAllWhere is similar to findAll but allows a WhereCondition to be + specified that is added to the database query to restrict which rows are + returned.

findSelect :: Select row -> Operation param [row] Source #

findSelect builds a plan Operation where the select that is run does not + use the input parameters for the plan in any way. If the + executeOperationMany function of the resulting Operation will run the + query once and use the entire result set as the result each of the input + parameters in turn.

askParam :: Operation param param Source #

askParam simply returns the paremeter given from the plan.

assertRight :: Operation (Either String a) a Source #

assertRight returns the value on the Right side of an Either. If + the Either is a Left, it raises AssertionFailed with the message + from the left side of the either.

data SelectOperation param row result Source #

SelectOperation is a helper type for building Operation primitives that + run Select queries. Specifying the fields of SelectOperation and then + using the selectOperation function to build an Operation is more + convenient that building functions to execute the queries thate are required + by the Operation type.

Constructors

SelectOperation 

Fields

  • selectOne :: param -> Select row

    selectOne will be called to build the Select query that should + be run when there is a single input parameter while executing a plan. + Note that the "One-ness" here refers to the single input parameter + rather than result. See produceResult below for more information + about returning one values vs. many from a SelectOperation.

  • selectMany :: [param] -> Select row

    selectMany will be called to build the Select query that should + be run when there are multiple parameters while executing a plan. + Note that the "Many-ness" here refers to the multiple input parameters + rather than result. See produceResult below for more information + about returning one values vs. many from a SelectOperation.

  • explainSelectOne :: Select row

    explainSelectOne should show a representative query of what will + be returned when selectOne is used. No input parameter is available + here to build the query, however, because this value is used to + explain a plan without actually running it.

  • explainSelectMany :: Select row

    explainSelectMany should show a representative query of what will + be returned when 'selectMany is used. No input parameters are available + here to build the query, however, because this value is used to + explain a plan without actually running it.

  • categorizeRow :: row -> param

    categorizeRow will be used when a plan is executed with multiple + parameters to determine which input parameter the row should be + associated with.

  • produceResult :: [row] -> result

    produceResult will be used convert the row type returned by the + Select queries for the operation input the result type that is + present as the output of the operation. The input rows will be all the + inputs associated with a single parameter. The result type + constructed here need not be a single value. For instance, findAll + uses the list type as the result type and findOne uses Maybe.

selectOperation :: Ord param => SelectOperation param row result -> Operation param result Source #

selectOperation builds a primitive planning Operation using the functions + given by a SelectOperation. If you are implementing a custom operation that + runs a select statement, it is probably easier to use this function rather + than building the Operation functions directly.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html new file mode 100644 index 0000000..95b7e1a --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html @@ -0,0 +1,24 @@ +Database.Orville.PostgreSQL.Plan.Syntax

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2021
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Plan.Syntax

Description

This module exports the bind function as >>= so that it can be used in +conjuction with the QualifiedDo language extension to write plans using do +syntax like so:

+module MyModule where
+
+import qualified Orville.PostgreSQL.Plan.Syntax as PlanSyntax
+
+data FooFamily =
+  FooFamily
+    { foo :: Foo
+    , children :: [FooChildren]
+    , pets :: [FooPets]
+    }
+
+findFooFamily = PlanSyntax.do $
+  fooHeader <- Plan.findOne fooTable fooIdField
+  fooChildren <- Plan.findAll fooChildTable fooIdField
+  fooPets <- Plan.findAll fooPetTable fooIdField
+
+  FooFamily
+    $ Plan.use fooHeader
+    * Plan.use fooChildren
+    * Plan.use fooPets
+
Synopsis

Documentation

(>>=) :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result Source #

An operator alias of bind so that it can be used with QualifiedDo.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html new file mode 100644 index 0000000..4796b95 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html @@ -0,0 +1,105 @@ +Database.Orville.PostgreSQL.Plan

orville-postgresql-legacy-0.9.0.1: ORM

Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Plan

Synopsis

Documentation

data Plan scope param result Source #

A Plan is an executable set of queries that can be executed to load data + from the database, using the results of prior queries as input parameters to + following queries in controlled ways. In particular, the "controlled" aspect + of this allows plans that take a single input to be adapted to take multiple + input parameters in a list without the resulting plan executing N+1 queries. + This restriction means that while query results can be used as input + parameters to later queries, they cannot be used to decide to run completely + different queries based on other query results. Allowing this would prevent + the Plan structure from eliminating N+1 query loops.

Note that during execution queries are never combined across tables to form + joins or subqueries. Queries are still executed in the same sequence as + specified in the plan, just on all the inputs at once rather than in a loop. + If you need to do a join with a plan, you can always construction your + own custom Operation and use planOperation to incorporate into a plan.

The param type variable indicates what type of value is expected as input + when the plan is executed.

The result type for a plan indicates what Haskell type is produced + when the plan is executed.

The scope type is used internally by Orville to track the plan is currently + executed against a single input or multiple inputs. This type parameter + should never specified as a concrete type in user code, but must be exposed + as a variable to ensure that execute scope is tracked correctly through + usages of bind.

Instances
Functor (Plan scope param) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Plan

Methods

fmap :: (a -> b) -> Plan scope param a -> Plan scope param b #

(<$) :: a -> Plan scope param b -> Plan scope param a #

Applicative (Plan scope param) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Plan

Methods

pure :: a -> Plan scope param a #

(<*>) :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b #

liftA2 :: (a -> b -> c) -> Plan scope param a -> Plan scope param b -> Plan scope param c #

(*>) :: Plan scope param a -> Plan scope param b -> Plan scope param b #

(<*) :: Plan scope param a -> Plan scope param b -> Plan scope param a #

data Planned scope param a Source #

A Planned value is a wrapper around the results of previous run queries + when using the bind function. At the time that you are writing a plan you + do not know whether the Plan will be run with a single input or multiple + inputs. A Planned value may end up being either an individual item or a + list of items. Due to this, your ability to interact with the value is + limited to the use of fmap to extract (or build) other values from the + results. Planned values can be used together with the use function to + make a Plan that produces the extracted value.

Note that while Planned could provide an Applicative instance as well, it + does not to avoid confusion with Applicative instance for Plan itself. + If you need to build a value from several Planned values using + Applicative, you should call use on each of the values and use the + Applicative instance for Plan.

Instances
Functor (Planned scope param) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Plan

Methods

fmap :: (a -> b) -> Planned scope param a -> Planned scope param b #

(<$) :: a -> Planned scope param b -> Planned scope param a #

data Execute Source #

Execute is a tag type used by as the scope variable for + Plan values when executing them via the execute function.

data Explain Source #

Explain is an tag type used as the scope variable when explaining a + Plan via the explain function.

askParam :: Plan scope param param Source #

askParam allows the input parameter for the plan to be retrieved as the + result of the plan. Together with bind you can use this to get access to + the input parameter as a Planned value.

Using a Plan after it is constructed

execute :: MonadOrville conn m => Plan Execute param result -> param -> m result Source #

execute accepts the input parameter (or parameters) expected by a Plan + and runs the plan to completion, either throwing an AssertionFailed + exception in the monad m or producing the expected result.

If you have a plan that takes one input and want to provide a list of + input, use planMany to adapt it to a multple-input plan before calling + execute.

explain :: Plan Explain param result -> [String] Source #

explain produces a textual description of the steps outlined by + a Plan -- in most cases example SQL queries. If you want to see + the explanation of how the plan will run with multiple input parameters, + you can use planMany to adapt it before calling explain.

Making a Plan to find rows in the database

findMaybeOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue (Maybe readEntity) Source #

findMaybeOne constructs a Plan that will find at most one row from + the given table where the plan's input value matches the given database + field.

findMaybeOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue (Maybe readEntity) Source #

findMaybeOneWhere is similar to findMaybeOne, but allows a + WhereCondition to be specified to restrict which rows are matched by the + database query.

findOne :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity Source #

findOne is an alias to findOneShowVia that uses the Show instance of + fieldValue when producing a failure message in the result the entity cannot + be found.

findOneShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity Source #

findOneShowVia is similar to 'findMaybeOne, but it expects that there will + always be a row found matching the plan's input value. If no row is found an + AssertionFailed exception will be thrown. This is a useful convenience + when looking up foreign-key associations that are expected to be enforced by + the database itself.

findOneWhere :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity Source #

findOneWhere is an alias to findOneWhereShowVia that uses the Show instance of + fieldValue when producing a failure message in the result the entity cannot + be found.

findOneWhereShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity Source #

findOneWhereShowVia is similar to findOneShowVia, but allows a WhereCondition to be + specified to restrict which rows are matched by the database query.

findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue [readEntity] Source #

findAll constructs a Plan that will find all the rows from the given + table there the plan's input value matches the given database field.

findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue [readEntity] Source #

findAllWhere is similar to findAll, but allows a WhereCondition to be + specified to restrict which rows are matched by the database query.

Creating a multi-step Plan from other Plan values

bind :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result Source #

bind gives access to the results of a plan to use as input values to future + plans. The plan result is given the input parameter to the provided function, + which must produce the remaining Plan to be executed. The value will be + wrapped in the Planned type, which may represent either a result or + multiple results, depending on whether one plan is currently be executed with + one and multiple input parameters. This ensures that the caller produces only + a single remaining Plan to be used for all inputs when there are multiple + to eliminate the need to possibly run different queries for different inputs + (which would an introduce N+1 query execution).

The Planned value (or values) provided by bind have actually been + retrieved from the database, so the value can be used multiple times when + constructing the remaining Plan without fear of causing the query to run + multiple times.

Also see use for how to lift a Planned value back into a Plan.

use :: Planned scope param a -> Plan scope param a Source #

use constructs a Plan that always produces the Planned value + as its result, regardless of the parameter given as input to the plan.

using :: Planned scope param a -> Plan scope a b -> Plan scope param b Source #

using uses a Planned value in the input to another Plan. The + resulting plan will ignore its input and use the Planned value as + the input to produce its result instead.

chain :: Plan scope a b -> Plan scope b c -> Plan scope a c Source #

chain connects the output of one plan to the input of another to form a + larger plan that will execute the first followed by the second.

apply :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b Source #

apply applies a function produced by a plan to the value produced + by another plan. This is usually used via the <*> operator through + the Applicative instance for Plan.

planMany :: (forall manyScope. Plan manyScope param result) -> Plan scope [param] (Many param result) Source #

planMany adapts a plan that takes a single input parameter to work on + multiple input parameters. When the new plan is executed each query will + execute in the same basic order, but with adjusted conditions to find all the + rows for all inputs at once rather than running the planned queries once for + each input.

planList :: (forall scope. Plan scope param result) -> Plan listScope [param] [result] Source #

planList lifts a plan so both its param and result become lists. + This saves you from having to fmap in elems when all you want back + from a Many is the list of results inside it.

focusParam :: (a -> b) -> Plan scope b result -> Plan scope a result Source #

focusParam builds a plan from a function and an existing plan taking the + result of that function as input. This is especially useful when there is some + structure, and a plan that only needs a part of that structure as input. The + function argument can access part of the structure for the plan argument to use, + so the final returned plan can take the entire structure as input.

planEither :: Plan scope leftParam leftResult -> Plan scope rightParam rightResult -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult) Source #

planEither lets you construct a plan that branches by executing a different + plan for the Left and Right sides of an Either value. When used with a + single input parameter only one of the two plans will be used, based on the + input parameter. When used on multiple input parameters, each of the two + plans will be executed only once with all the Left and Right values + provided as input parameters respectively.

planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b) Source #

planMaybe lifts a plan so both its param and result become Maybes. This is + useful when modifying an existing plan to deal with optionality. Writing just + one plan can then easily produce both the required and optional versions.

Bridges from other types into Plan

data AssertionFailed Source #

AssertionFailed may be returned from the execute functions of an + Operation to indicate that some expected invariant has failed. For example, + following a foreign key that is enforced by the database only to find that no + record exists. When an Operation returns an AssertionFailed value during + plan execution the error is thrown as an exception using the + MonadThrow instance for whatever monad the plan is + executing in.

assert :: (param -> a -> Either String b) -> Plan scope param a -> Plan scope param b Source #

assert allows you to make an assertion about a plans result that will throw + an AssertionFailed failed exception during execution if it proves to be + false. The first parameter is the assertion function, which should return + either an error message to be given in the exception or the value to be used + as the plan's result.

planSelect :: Select row -> Plan scope () [row] Source #

planSelect allows any Orville Select query to be incorporated into a + plan. Note that the Select cannot depend on the plan's input parameters in + this case. If the plan is executed with multiple inputs the same set of all + the results will be used as the results for each of the input parameters.

planOperation :: Operation param result -> Plan scope param result Source #

planOperation allows any primitive Operation to be used as an atomic step + in a plan. When the plan is executed, the appropriate Operation functions + will be used depending on the execution context.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html new file mode 100644 index 0000000..4736a5d --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html @@ -0,0 +1,4 @@ +Database.Orville.PostgreSQL.Popper

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Popper

Description

 
Synopsis

Documentation

data PopError Source #

Constructors

MissingRecord (TableDefinition readEntity writeEntity key) (PrimaryKey key) key 
MissingRecordBy (TableDefinition readEntity writeEntity key) (FieldDefinition nullability fieldValue) fieldValue 
Unpoppable String 

data Popper a b Source #

Instances
Arrow Popper Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Popper

Methods

arr :: (b -> c) -> Popper b c #

first :: Popper b c -> Popper (b, d) (c, d) #

second :: Popper b c -> Popper (d, b) (d, c) #

(***) :: Popper b c -> Popper b' c' -> Popper (b, b') (c, c') #

(&&&) :: Popper b c -> Popper b c' -> Popper b (c, c') #

ArrowChoice Popper Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Popper

Methods

left :: Popper b c -> Popper (Either b d) (Either c d) #

right :: Popper b c -> Popper (Either d b) (Either d c) #

(+++) :: Popper b c -> Popper b' c' -> Popper (Either b b') (Either c c') #

(|||) :: Popper b d -> Popper c d -> Popper (Either b c) d #

Functor (Popper a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Popper

Methods

fmap :: (a0 -> b) -> Popper a a0 -> Popper a b #

(<$) :: a0 -> Popper a b -> Popper a a0 #

Applicative (Popper a) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Popper

Methods

pure :: a0 -> Popper a a0 #

(<*>) :: Popper a (a0 -> b) -> Popper a a0 -> Popper a b #

liftA2 :: (a0 -> b -> c) -> Popper a a0 -> Popper a b -> Popper a c #

(*>) :: Popper a a0 -> Popper a b -> Popper a b #

(<*) :: Popper a a0 -> Popper a b -> Popper a a0 #

Category Popper Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Popper

Methods

id :: Popper a a #

(.) :: Popper b c -> Popper a b -> Popper a c #

data Popped a Source #

Instances
Functor Popped Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Popper

Methods

fmap :: (a -> b) -> Popped a -> Popped b #

(<$) :: a -> Popped b -> Popped a #

Applicative Popped Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Popper

Methods

pure :: a -> Popped a #

(<*>) :: Popped (a -> b) -> Popped a -> Popped b #

liftA2 :: (a -> b -> c) -> Popped a -> Popped b -> Popped c #

(*>) :: Popped a -> Popped b -> Popped b #

(<*) :: Popped a -> Popped b -> Popped a #

(>>>) :: Category cat => cat a b -> cat b c -> cat a c infixr 1 #

Left-to-right composition

(<<<) :: Category cat => cat b c -> cat a b -> cat a c infixr 1 #

Right-to-left composition

fromKern :: (a -> b) -> Popper a b Source #

hasMany :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue [readEntity] Source #

hasManyIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue [readEntity]) Source #

hasOneIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue readEntity) Source #

hasManyInWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper [fieldValue] (Map fieldValue [readEntity]) Source #

hasManyWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue [readEntity] Source #

hasOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue (Maybe readEntity) Source #

hasOne' :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue readEntity Source #

hasOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue (Maybe readEntity) Source #

popMissingRecord :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue PopError Source #

onKern :: (a -> b -> c) -> Popper b a -> Popper b c Source #

pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b) Source #

popThrow :: MonadOrville conn m => Popper a b -> a -> m b Source #

popFirst :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a (Maybe readEntity) Source #

popMany :: Popper a b -> Popper [a] [b] Source #

onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b Source #

popQuery :: String -> (forall conn m. MonadOrville conn m => m b) -> Popper a b Source #

popQuery embeds an Orville operation in a popper. It is left up to the + programmer to ensure that the Orville operation does not do any updates + to the database, but only does queries.

The initial string argument is a description of the query to put into + the results of explain

popRecord :: TableDefinition readEntity writeEntity key -> key -> Popper a (Maybe readEntity) Source #

popRecord' :: TableDefinition readEntity writeEntity key -> key -> Popper a readEntity Source #

popTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a [readEntity] Source #

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html new file mode 100644 index 0000000..2ceb12c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html @@ -0,0 +1,4 @@ +Database.Orville.PostgreSQL.Raw

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Raw

Description

 
Synopsis

Documentation

selectSql :: MonadOrville conn m => String -> [SqlValue] -> FromSql result -> m [result] Source #

decodeSqlRows :: MonadOrville conn m => FromSql result -> ResultSet -> m [result] Source #

withConnection :: MonadOrville conn m => (conn -> m a) -> m a Source #

withTransaction :: MonadOrville conn m => m a -> m a Source #

Migration Guide: withTransaction retains the same name.

withCachedConnection :: MonadOrville conn m => m a -> m a Source #

Migration Guide: withCachedConnection has been renamed to withConnection_

Runs an action with a cached connection. + Without using this, or wrapping calls in a transaction using withTransaction, successive + calls to functions like insertRecord and updateRecord are *not* guaranteed to occur on the + same connection.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html new file mode 100644 index 0000000..7dec2a6 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html @@ -0,0 +1,12 @@ +Database.Orville.PostgreSQL.ResourceT

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.ResourceT

Description

ResourceT provides ResourceT instance of the Orville typeclasses for situations +where you might need it. In particular, if you are using the conduit library, you +may want to wrap ResourceT around your normal monad stack, in which case you'll need +the MonadOrville instance provided here to use selectConduit.

These instances are not included in the default exports for Orville because the required +either a MonadUnliftIO or MonadBaseControl instance of the monad underlying ResourceT, +depending on the version of ResourceT you are using. For resource-1.1.10 and above you +must provide MonadUnliftIO instance. For versions prior to 1.1.10 you must provide a +MonadBaseControl instance.

This is required by MonadOrville requires an instance to MonadBaseControl to be defined. +The instance provided here can only use one lifting strategy, one we choose MonadUnliftIO +wherever possible (both by our own opinion and because later versions of ResourceT have +removed MonadBaseControl support). MonadBaseControl is used for versions of ResourceT +before ResourceT supported MonadUnliftIO.

Orphan instances

(MonadUnliftIO m, MonadOrville conn m) => MonadOrville conn (ResourceT m) Source # 
Instance details

(Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (ResourceT m) Source # 
Instance details

Methods

getOrvilleEnv :: ResourceT m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> ResourceT m a -> ResourceT m a Source #

(MonadOrvilleControl m, MonadUnliftIO m) => MonadOrvilleControl (ResourceT m) Source # 
Instance details

Methods

liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> ResourceT m b) -> ResourceT m b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> ResourceT m c -> ResourceT m d -> ResourceT m c Source #

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html new file mode 100644 index 0000000..fa2f633 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Select

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Select

Description

 
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html new file mode 100644 index 0000000..9046aff --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Trigger

orville-postgresql-legacy-0.9.0.1: ORM

Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL.Trigger

Documentation

insertTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, InsertTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity Source #

class InsertTrigger trigger readEntity where Source #

Methods

insertTriggers :: readEntity -> [trigger] Source #

updateTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, UpdateTrigger trigger readEntity writeEntity) => TableDefinition readEntity writeEntity key -> readEntity -> writeEntity -> m () Source #

class UpdateTrigger trigger readEntity writeEntity where Source #

Methods

updateTriggers :: readEntity -> writeEntity -> [trigger] Source #

deleteTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, DeleteTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> readEntity -> m () Source #

class DeleteTrigger trigger readEntity where Source #

Methods

deleteTriggers :: readEntity -> [trigger] Source #

class MonadTrigger trigger m | m -> trigger where Source #

Methods

runTriggers :: [trigger] -> m () Source #

Instances
MonadIO m => MonadTrigger trigger (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

runTriggers :: [trigger] -> OrvilleTriggerT trigger conn m () Source #

data OrvilleTriggerT trigger conn m a Source #

Instances
MonadError e m => MonadError e (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

throwError :: e -> OrvilleTriggerT trigger conn m a #

catchError :: OrvilleTriggerT trigger conn m a -> (e -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m a #

MonadBaseControl b m => MonadBaseControl b (OrvilleTriggerT trigger conn m) 
Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

Associated Types

type StM (OrvilleTriggerT trigger conn m) a :: Type

Methods

liftBaseWith :: (RunInBase (OrvilleTriggerT trigger conn m) b -> b a) -> OrvilleTriggerT trigger conn m a

restoreM :: StM (OrvilleTriggerT trigger conn m) a -> OrvilleTriggerT trigger conn m a

MonadBase b m => MonadBase b (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

liftBase :: b α -> OrvilleTriggerT trigger conn m α

(Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

(Monad m, IConnection conn) => HasOrvilleContext conn (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

getOrvilleEnv :: OrvilleTriggerT trigger conn m (OrvilleEnv conn) Source #

localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a Source #

MonadIO m => MonadTrigger trigger (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

runTriggers :: [trigger] -> OrvilleTriggerT trigger conn m () Source #

MonadTrans (OrvilleTriggerT trigger conn) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

lift :: Monad m => m a -> OrvilleTriggerT trigger conn m a #

MonadTransControl (OrvilleTriggerT trigger conn) 
Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

Associated Types

type StT (OrvilleTriggerT trigger conn) a :: Type

Methods

liftWith :: Monad m => (Run (OrvilleTriggerT trigger conn) -> m a) -> OrvilleTriggerT trigger conn m a

restoreT :: Monad m => m (StT (OrvilleTriggerT trigger conn) a) -> OrvilleTriggerT trigger conn m a

Monad m => Monad (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

(>>=) :: OrvilleTriggerT trigger conn m a -> (a -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b #

(>>) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m b #

return :: a -> OrvilleTriggerT trigger conn m a #

fail :: String -> OrvilleTriggerT trigger conn m a #

Functor m => Functor (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

fmap :: (a -> b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b #

(<$) :: a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m a #

MonadFail m => MonadFail (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

fail :: String -> OrvilleTriggerT trigger conn m a #

Applicative m => Applicative (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

pure :: a -> OrvilleTriggerT trigger conn m a #

(<*>) :: OrvilleTriggerT trigger conn m (a -> b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b #

liftA2 :: (a -> b -> c) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m c #

(*>) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m b #

(<*) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m a #

MonadIO m => MonadIO (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

liftIO :: IO a -> OrvilleTriggerT trigger conn m a #

Alternative m => Alternative (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

empty :: OrvilleTriggerT trigger conn m a #

(<|>) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a #

some :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m [a] #

many :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m [a] #

MonadPlus m => MonadPlus (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

mzero :: OrvilleTriggerT trigger conn m a #

mplus :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a #

MonadCatch m => MonadCatch (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

catch :: Exception e => OrvilleTriggerT trigger conn m a -> (e -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m a

MonadMask m => MonadMask (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

mask :: ((forall a. OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b

uninterruptibleMask :: ((forall a. OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b

generalBracket :: OrvilleTriggerT trigger conn m a -> (a -> ExitCase b -> OrvilleTriggerT trigger conn m c) -> (a -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m (b, c)

MonadThrow m => MonadThrow (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

throwM :: Exception e => e -> OrvilleTriggerT trigger conn m a

(Monad m, MonadOrvilleControl m) => MonadOrvilleControl (OrvilleTriggerT trigger conn m) Source # 
Instance details

Defined in Database.Orville.PostgreSQL.Internal.Trigger

Methods

liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b Source #

liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleTriggerT trigger conn m c -> OrvilleTriggerT trigger conn m d -> OrvilleTriggerT trigger conn m c Source #

MonadUnliftIO m => MonadUnliftIO (OrvilleTriggerT trigger conn m) 
Instance details

Defined in Database.Orville.PostgreSQL.MonadUnliftIO

Methods

askUnliftIO :: OrvilleTriggerT trigger conn m (UnliftIO (OrvilleTriggerT trigger conn m))

withRunInIO :: ((forall a. OrvilleTriggerT trigger conn m a -> IO a) -> IO b) -> OrvilleTriggerT trigger conn m b

type StT (OrvilleTriggerT trigger conn) a 
Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

type StT (OrvilleTriggerT trigger conn) a
type StM (OrvilleTriggerT trigger conn m) a 
Instance details

Defined in Database.Orville.PostgreSQL.MonadBaseControl

type StM (OrvilleTriggerT trigger conn m) a

committedTriggers :: RecordedTriggers trigger -> [trigger] Source #

runOrvilleTriggerT :: MonadIO m => OrvilleTriggerT trigger conn m a -> Pool conn -> m (a, [trigger]) Source #

mapOrvilleTriggerT :: Monad n => (m a -> n b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn n b Source #

liftOrville :: Monad m => OrvilleT conn m a -> OrvilleTriggerT trigger conn m a Source #

askTriggers :: MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger) Source #

clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m () Source #

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html new file mode 100644 index 0000000..c30cb78 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html @@ -0,0 +1,2 @@ +Database.Orville.PostgreSQL

orville-postgresql-legacy-0.9.0.1: ORM

CopyrightFlipstone Technology Partners 2016-2018
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Database.Orville.PostgreSQL

Description

See Database.Orville.PostgreSQL.Core for information about migrating to the +new LibPQ-based Orville.

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-37.html b/docs/orville-postgresql-legacy-docs/doc-index-37.html new file mode 100644 index 0000000..6d70956 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-37.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - %)

orville-postgresql-legacy-0.9.0.1: ORM

Index - %

%==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-46.html b/docs/orville-postgresql-legacy-docs/doc-index-46.html new file mode 100644 index 0000000..03da229 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-46.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - .)

orville-postgresql-legacy-0.9.0.1: ORM

Index - .

.:=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<-Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.>=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-60.html b/docs/orville-postgresql-legacy-docs/doc-index-60.html new file mode 100644 index 0000000..6f58944 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-60.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - <)

orville-postgresql-legacy-0.9.0.1: ORM

Index - <

<<<Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
<>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-62.html b/docs/orville-postgresql-legacy-docs/doc-index-62.html new file mode 100644 index 0000000..d952e0e --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-62.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - >)

orville-postgresql-legacy-0.9.0.1: ORM

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-A.html b/docs/orville-postgresql-legacy-docs/doc-index-A.html new file mode 100644 index 0000000..91d8635 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-A.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - A)

orville-postgresql-legacy-0.9.0.1: ORM

Index - A

abortPopDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
actualColumnsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
addTransactionCallBackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
aliasedDatabase.Orville.PostgreSQL.Expr
apply 
1 (Function)Database.Orville.PostgreSQL.Plan.Many
2 (Function)Database.Orville.PostgreSQL.Plan
aroundRunningQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
AscendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
askParam 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
askTriggersDatabase.Orville.PostgreSQL.Trigger
assertDatabase.Orville.PostgreSQL.Plan
AssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation, Database.Orville.PostgreSQL.Plan
assertRightDatabase.Orville.PostgreSQL.Plan.Operation
AssignedByDatabaseDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
attrFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
automaticIdFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-All.html b/docs/orville-postgresql-legacy-docs/doc-index-All.html new file mode 100644 index 0000000..a72f74b --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-All.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index)

orville-postgresql-legacy-0.9.0.1: ORM

Index

%==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.:=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<-Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.<>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
.>=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
<<<Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
<>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
>>=Database.Orville.PostgreSQL.Plan.Syntax
>>>Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
abortPopDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
actualColumnsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
addTransactionCallBackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
aliasedDatabase.Orville.PostgreSQL.Expr
apply 
1 (Function)Database.Orville.PostgreSQL.Plan.Many
2 (Function)Database.Orville.PostgreSQL.Plan
aroundRunningQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
AscendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
askParam 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
askTriggersDatabase.Orville.PostgreSQL.Trigger
assertDatabase.Orville.PostgreSQL.Plan
AssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation, Database.Orville.PostgreSQL.Plan
assertRightDatabase.Orville.PostgreSQL.Plan.Operation
AssignedByDatabaseDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
attrFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
automaticIdFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
bigIntegerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
bigserialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
bindDatabase.Orville.PostgreSQL.Plan
booleanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
boolFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
buildPaginationDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
categorizeRowDatabase.Orville.PostgreSQL.Plan.Operation
certainlyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
certainly'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
chainDatabase.Orville.PostgreSQL.Plan
clearTriggersDatabase.Orville.PostgreSQL.Trigger
colDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnDefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnSpecifierDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
committedTriggersDatabase.Orville.PostgreSQL.Trigger
composeDatabase.Orville.PostgreSQL.Plan.Many
compositePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConnectionDatabase.Orville.PostgreSQL.Connection
ConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
constraintBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConstraintDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
constraintNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
constraintTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
convErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
convErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConversionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConversionErrorDetails 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
convertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
createConnectionPoolDatabase.Orville.PostgreSQL.Connection
CreatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
createIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
dateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
dayFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DDLQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
decodeSqlRowsDatabase.Orville.PostgreSQL.Raw
DecodingFailureDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
defaultLiftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
defaultLiftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DeleteQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
deleteRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DeleteTriggerDatabase.Orville.PostgreSQL.Trigger
deleteTriggeredDatabase.Orville.PostgreSQL.Trigger
deleteTriggersDatabase.Orville.PostgreSQL.Trigger
deleteWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DescendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
distinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
doubleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
doubleFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
dropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
dropIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropSequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
elemsDatabase.Orville.PostgreSQL.Plan.Many
ExecuteDatabase.Orville.PostgreSQL.Plan
executeDatabase.Orville.PostgreSQL.Plan
executeOperationManyDatabase.Orville.PostgreSQL.Plan.Operation
executeOperationOneDatabase.Orville.PostgreSQL.Plan.Operation
ExplainDatabase.Orville.PostgreSQL.Plan
explain 
1 (Function)Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
2 (Function)Database.Orville.PostgreSQL.Plan
explainLinesDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
explainOperationManyDatabase.Orville.PostgreSQL.Plan.Operation
explainOperationOneDatabase.Orville.PostgreSQL.Plan.Operation
explainSelectManyDatabase.Orville.PostgreSQL.Plan.Operation
explainSelectOneDatabase.Orville.PostgreSQL.Plan.Operation
explainStepDatabase.Orville.PostgreSQL.Plan.Explanation
ExplanationDatabase.Orville.PostgreSQL.Plan.Explanation
explanationStepsDatabase.Orville.PostgreSQL.Plan.Explanation
ExprDatabase.Orville.PostgreSQL.Expr
exprDatabase.Orville.PostgreSQL.Expr
FieldDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldFlagsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldOfTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldToSqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
FieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findAll 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findAllWhere 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findMaybeOneDatabase.Orville.PostgreSQL.Plan
findMaybeOneWhereDatabase.Orville.PostgreSQL.Plan
findOne 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findOneShowViaDatabase.Orville.PostgreSQL.Plan
findOneWhere 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findOneWhereShowViaDatabase.Orville.PostgreSQL.Plan
findRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findRecordsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findRecordsByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findSelectDatabase.Orville.PostgreSQL.Plan.Operation
fixedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
focusParamDatabase.Orville.PostgreSQL.Plan
foreignKeyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
FromClauseDatabase.Orville.PostgreSQL.Select
fromClauseRawDatabase.Orville.PostgreSQL.Select
fromClauseTableDatabase.Orville.PostgreSQL.Select
fromClauseTableNameDatabase.Orville.PostgreSQL.Select
fromKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
fromKeysDatabase.Orville.PostgreSQL.Plan.Many
FromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
FromSqlErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
generateMigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
GenerateSqlDatabase.Orville.PostgreSQL.Expr
generateSqlDatabase.Orville.PostgreSQL.Expr
getComponentDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
getFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
getOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
groupByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
hasManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasManyInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasManyInWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasManyWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOneDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOne'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOneInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOneWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
HasOrvilleContextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
IndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
IndexDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexUniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
InsertQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
insertRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
insertRecordManyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
insertRecordManyReturningDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
InsertTriggerDatabase.Orville.PostgreSQL.Trigger
insertTriggeredDatabase.Orville.PostgreSQL.Trigger
insertTriggersDatabase.Orville.PostgreSQL.Trigger
int32FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
int64FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
integerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
IntegralOutOfBoundsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
isFieldNullableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
isNotNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
isNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
kernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
keysDatabase.Orville.PostgreSQL.Plan.Many
liftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
liftFinallyViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
liftFinallyViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
liftOrvilleDatabase.Orville.PostgreSQL.Trigger
liftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
liftWithConnectionViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
liftWithConnectionViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
limitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
localOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
lookupDatabase.Orville.PostgreSQL.Plan.Many
ManyDatabase.Orville.PostgreSQL.Plan.Many
mapDatabase.Orville.PostgreSQL.Plan.Many
mapAttrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
mapFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
mapOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
mapOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
maybeConvertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
maybeMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrateSchemaDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationExecutionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationItem 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrationItemDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrationItemSchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationLockExcessiveRetryErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrationPlanItemsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MissingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
missingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MissingColumnDetails 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
MissingRecordByDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
mkAssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation
mkTableDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MonadOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MonadOrvilleControlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MonadTriggerDatabase.Orville.PostgreSQL.Trigger
NameExprDatabase.Orville.PostgreSQL.Expr
NameFormDatabase.Orville.PostgreSQL.Expr
newOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
noCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
noExplanationDatabase.Orville.PostgreSQL.Plan.Explanation
NotAKey 
1 (Type/Class)Database.Orville.PostgreSQL.Plan.Many
2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Many
NotNull 
1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
Now 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
NullabilityDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
Nullable 
1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
nullableFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OccurredAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
offsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
onKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
onPopManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
Operation 
1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
orderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrderByClause 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ormEnvPoolDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
pageNextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
pageRowsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
Pagination 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
partialMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
PlanDatabase.Orville.PostgreSQL.Plan
planEitherDatabase.Orville.PostgreSQL.Plan
planListDatabase.Orville.PostgreSQL.Plan
planManyDatabase.Orville.PostgreSQL.Plan
planMaybeDatabase.Orville.PostgreSQL.Plan
PlannedDatabase.Orville.PostgreSQL.Plan
planOperationDatabase.Orville.PostgreSQL.Plan
planSelectDatabase.Orville.PostgreSQL.Plan
PoolDatabase.Orville.PostgreSQL.Connection
popDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PopErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popFirstDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popMaybeDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popMissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PoppedDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PoppedErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PoppedValueDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PopperDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popQueryDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popRecord'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popTableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popThrowDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
prefixMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
PrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyEqualsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyPartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
produceResultDatabase.Orville.PostgreSQL.Plan.Operation
qualifiedDatabase.Orville.PostgreSQL.Expr
QueryTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RawExprDatabase.Orville.PostgreSQL.Expr
rawSqlDatabase.Orville.PostgreSQL.Expr
rawSqlExprDatabase.Orville.PostgreSQL.Expr
readOnlyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
readOnlyMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RecordedTriggersDatabase.Orville.PostgreSQL.Trigger
ReferencesDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RelationalMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ResultSetDatabase.Orville.PostgreSQL.Raw
RowDataErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RowDataErrorDetails 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RowDataErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
rowErrorColumnNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
rowErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
rowErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
runOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
runOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
runSelectDatabase.Orville.PostgreSQL.Select
runTriggersDatabase.Orville.PostgreSQL.Trigger
sayDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SchemaDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
searchVectorFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectDatabase.Orville.PostgreSQL.Select
selectAllDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectColumnDatabase.Orville.PostgreSQL.Expr
selectConduitDatabase.Orville.PostgreSQL.Conduit
selectDistinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectExprDatabase.Orville.PostgreSQL.Expr
selectFieldDatabase.Orville.PostgreSQL.Select
selectFirstDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectForm 
1 (Type/Class)Database.Orville.PostgreSQL.Expr
2 (Data Constructor)Database.Orville.PostgreSQL.Expr
selectFormDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectFormAliasDatabase.Orville.PostgreSQL.Expr
selectFormColumnDatabase.Orville.PostgreSQL.Expr
selectManyDatabase.Orville.PostgreSQL.Plan.Operation
selectOneDatabase.Orville.PostgreSQL.Plan.Operation
SelectOperation 
1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
selectOperationDatabase.Orville.PostgreSQL.Plan.Operation
selectOptGroupDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectOptions 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptionsToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptLimitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptOffsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptOrderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectQueryDatabase.Orville.PostgreSQL.Select
selectQueryColumnsDatabase.Orville.PostgreSQL.Select
selectQueryRawDatabase.Orville.PostgreSQL.Select
selectQueryRawRowsDatabase.Orville.PostgreSQL.Select
selectQueryRowsDatabase.Orville.PostgreSQL.Select
selectQueryTableDatabase.Orville.PostgreSQL.Select
selectSqlDatabase.Orville.PostgreSQL.Raw
selectSqlRowsDatabase.Orville.PostgreSQL.Raw
SequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceCacheDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceCurrValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceCycleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SequenceDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceIncrementDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceMaxValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceMinValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceNextValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceSetValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
serialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
setStartTransactionSQLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
showFromSqlErrorForLoggingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
showFromSqlErrorMinimalDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
showSqlValueTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
simpleIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
simplePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SomeField 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SortDirectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SqlType 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeIdDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeReferenceDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeSqlSizeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
streamPagesDatabase.Orville.PostgreSQL.Conduit
TableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TableDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TableParams 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tablePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblPrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
textDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
textFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
textSearchVectorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
timestampDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
toColumnDefaultSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
toMapDatabase.Orville.PostgreSQL.Plan.Many
ToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionCommitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionEventDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionRollbackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TypeMismatchDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
unboundedTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
unboundedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uncommittedTriggersDatabase.Orville.PostgreSQL.Trigger
unescapedNameDatabase.Orville.PostgreSQL.Expr
UniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uniqueConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uniqueIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uniquePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
unOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
UnpoppableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
UpdatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
updateFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
UpdateQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
updateRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
updateSqlDatabase.Orville.PostgreSQL.Raw
UpdateTriggerDatabase.Orville.PostgreSQL.Trigger
updateTriggeredDatabase.Orville.PostgreSQL.Trigger
updateTriggersDatabase.Orville.PostgreSQL.Trigger
useDatabase.Orville.PostgreSQL.Plan
usingDatabase.Orville.PostgreSQL.Plan
utcTimeFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
varTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereAndDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
WhereConditionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereLikeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereLikeInsensitiveDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereNotInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereOrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereQualifiedDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereRawDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
where_Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withCachedConnectionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withConnectionDatabase.Orville.PostgreSQL.Raw
withConversionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withPrefixDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withTransactionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-B.html b/docs/orville-postgresql-legacy-docs/doc-index-B.html new file mode 100644 index 0000000..51df001 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-B.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - B)

orville-postgresql-legacy-0.9.0.1: ORM

Index - B

bigIntegerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
bigserialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
bindDatabase.Orville.PostgreSQL.Plan
booleanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
boolFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
buildPaginationDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-C.html b/docs/orville-postgresql-legacy-docs/doc-index-C.html new file mode 100644 index 0000000..8b97bd1 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-C.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - C)

orville-postgresql-legacy-0.9.0.1: ORM

Index - C

categorizeRowDatabase.Orville.PostgreSQL.Plan.Operation
certainlyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
certainly'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
chainDatabase.Orville.PostgreSQL.Plan
clearTriggersDatabase.Orville.PostgreSQL.Trigger
colDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnDefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ColumnSpecifierDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
committedTriggersDatabase.Orville.PostgreSQL.Trigger
composeDatabase.Orville.PostgreSQL.Plan.Many
compositePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConnectionDatabase.Orville.PostgreSQL.Connection
ConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
constraintBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConstraintDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
constraintNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
constraintTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
convErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
convErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConversionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ConversionErrorDetails 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
convertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
createConnectionPoolDatabase.Orville.PostgreSQL.Connection
CreatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
createIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-D.html b/docs/orville-postgresql-legacy-docs/doc-index-D.html new file mode 100644 index 0000000..5d4bbac --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-D.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - D)

orville-postgresql-legacy-0.9.0.1: ORM

Index - D

dateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
dayFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DDLQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
decodeSqlRowsDatabase.Orville.PostgreSQL.Raw
DecodingFailureDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
defaultLiftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
defaultLiftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DeleteQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
deleteRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DeleteTriggerDatabase.Orville.PostgreSQL.Trigger
deleteTriggeredDatabase.Orville.PostgreSQL.Trigger
deleteTriggersDatabase.Orville.PostgreSQL.Trigger
deleteWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DescendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
distinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
doubleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
doubleFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
dropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
dropIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropSequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
DropTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-E.html b/docs/orville-postgresql-legacy-docs/doc-index-E.html new file mode 100644 index 0000000..3f3e781 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-E.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - E)

orville-postgresql-legacy-0.9.0.1: ORM

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-F.html b/docs/orville-postgresql-legacy-docs/doc-index-F.html new file mode 100644 index 0000000..af713f9 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-F.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - F)

orville-postgresql-legacy-0.9.0.1: ORM

Index - F

FieldDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldFlagsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldOfTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldToSqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
FieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
fieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findAll 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findAllWhere 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findMaybeOneDatabase.Orville.PostgreSQL.Plan
findMaybeOneWhereDatabase.Orville.PostgreSQL.Plan
findOne 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findOneShowViaDatabase.Orville.PostgreSQL.Plan
findOneWhere 
1 (Function)Database.Orville.PostgreSQL.Plan.Operation
2 (Function)Database.Orville.PostgreSQL.Plan
findOneWhereShowViaDatabase.Orville.PostgreSQL.Plan
findRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findRecordsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findRecordsByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
findSelectDatabase.Orville.PostgreSQL.Plan.Operation
fixedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
focusParamDatabase.Orville.PostgreSQL.Plan
foreignKeyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
FromClauseDatabase.Orville.PostgreSQL.Select
fromClauseRawDatabase.Orville.PostgreSQL.Select
fromClauseTableDatabase.Orville.PostgreSQL.Select
fromClauseTableNameDatabase.Orville.PostgreSQL.Select
fromKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
fromKeysDatabase.Orville.PostgreSQL.Plan.Many
FromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
FromSqlErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-G.html b/docs/orville-postgresql-legacy-docs/doc-index-G.html new file mode 100644 index 0000000..f67a8c8 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-G.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - G)

orville-postgresql-legacy-0.9.0.1: ORM

Index - G

generateMigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
GenerateSqlDatabase.Orville.PostgreSQL.Expr
generateSqlDatabase.Orville.PostgreSQL.Expr
getComponentDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
getFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
getOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
groupByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-H.html b/docs/orville-postgresql-legacy-docs/doc-index-H.html new file mode 100644 index 0000000..20b854a --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-H.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - H)

orville-postgresql-legacy-0.9.0.1: ORM

Index - H

hasManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasManyInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasManyInWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasManyWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOneDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOne'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOneInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
hasOneWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
HasOrvilleContextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-I.html b/docs/orville-postgresql-legacy-docs/doc-index-I.html new file mode 100644 index 0000000..f6776e6 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-I.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - I)

orville-postgresql-legacy-0.9.0.1: ORM

Index - I

IndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
IndexDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
indexUniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
InsertQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
insertRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
insertRecordManyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
insertRecordManyReturningDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
InsertTriggerDatabase.Orville.PostgreSQL.Trigger
insertTriggeredDatabase.Orville.PostgreSQL.Trigger
insertTriggersDatabase.Orville.PostgreSQL.Trigger
int32FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
int64FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
integerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
IntegralOutOfBoundsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
isFieldNullableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
isNotNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
isNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-K.html b/docs/orville-postgresql-legacy-docs/doc-index-K.html new file mode 100644 index 0000000..fef96c5 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-K.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - K)

orville-postgresql-legacy-0.9.0.1: ORM

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-L.html b/docs/orville-postgresql-legacy-docs/doc-index-L.html new file mode 100644 index 0000000..ada9a49 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-L.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - L)

orville-postgresql-legacy-0.9.0.1: ORM

Index - L

liftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
liftFinallyViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
liftFinallyViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
liftOrvilleDatabase.Orville.PostgreSQL.Trigger
liftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
liftWithConnectionViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
liftWithConnectionViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
limitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
localOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
lookupDatabase.Orville.PostgreSQL.Plan.Many
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-M.html b/docs/orville-postgresql-legacy-docs/doc-index-M.html new file mode 100644 index 0000000..c3e5444 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-M.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - M)

orville-postgresql-legacy-0.9.0.1: ORM

Index - M

ManyDatabase.Orville.PostgreSQL.Plan.Many
mapDatabase.Orville.PostgreSQL.Plan.Many
mapAttrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
mapFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
mapOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
mapOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
maybeConvertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
maybeMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrateSchemaDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationExecutionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationItem 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrationItemDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrationItemSchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationLockExcessiveRetryErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
migrationPlanItemsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MissingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
missingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MissingColumnDetails 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
MissingRecordByDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
mkAssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation
mkTableDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MonadOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MonadOrvilleControlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
MonadTriggerDatabase.Orville.PostgreSQL.Trigger
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-N.html b/docs/orville-postgresql-legacy-docs/doc-index-N.html new file mode 100644 index 0000000..ee38adf --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-N.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - N)

orville-postgresql-legacy-0.9.0.1: ORM

Index - N

NameExprDatabase.Orville.PostgreSQL.Expr
NameFormDatabase.Orville.PostgreSQL.Expr
newOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
noCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
noExplanationDatabase.Orville.PostgreSQL.Plan.Explanation
NotAKey 
1 (Type/Class)Database.Orville.PostgreSQL.Plan.Many
2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Many
NotNull 
1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
Now 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
NullabilityDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
Nullable 
1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
nullableFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-O.html b/docs/orville-postgresql-legacy-docs/doc-index-O.html new file mode 100644 index 0000000..d9364db --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-O.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - O)

orville-postgresql-legacy-0.9.0.1: ORM

Index - O

OccurredAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
offsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
onKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
onPopManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
Operation 
1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
orderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrderByClause 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ormEnvPoolDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
OrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-P.html b/docs/orville-postgresql-legacy-docs/doc-index-P.html new file mode 100644 index 0000000..ecdb78b --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-P.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - P)

orville-postgresql-legacy-0.9.0.1: ORM

Index - P

pageNextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
pageRowsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
Pagination 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
partialMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
PlanDatabase.Orville.PostgreSQL.Plan
planEitherDatabase.Orville.PostgreSQL.Plan
planListDatabase.Orville.PostgreSQL.Plan
planManyDatabase.Orville.PostgreSQL.Plan
planMaybeDatabase.Orville.PostgreSQL.Plan
PlannedDatabase.Orville.PostgreSQL.Plan
planOperationDatabase.Orville.PostgreSQL.Plan
planSelectDatabase.Orville.PostgreSQL.Plan
PoolDatabase.Orville.PostgreSQL.Connection
popDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PopErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popFirstDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popMaybeDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popMissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PoppedDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PoppedErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PoppedValueDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
PopperDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popQueryDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popRecord'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popTableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
popThrowDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
prefixMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
PrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyEqualsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyPartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
primaryKeyToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
produceResultDatabase.Orville.PostgreSQL.Plan.Operation
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-Q.html b/docs/orville-postgresql-legacy-docs/doc-index-Q.html new file mode 100644 index 0000000..3d58f71 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-Q.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - Q)

orville-postgresql-legacy-0.9.0.1: ORM

Index - Q

qualifiedDatabase.Orville.PostgreSQL.Expr
QueryTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-R.html b/docs/orville-postgresql-legacy-docs/doc-index-R.html new file mode 100644 index 0000000..97864f8 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-R.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - R)

orville-postgresql-legacy-0.9.0.1: ORM

Index - R

RawExprDatabase.Orville.PostgreSQL.Expr
rawSqlDatabase.Orville.PostgreSQL.Expr
rawSqlExprDatabase.Orville.PostgreSQL.Expr
readOnlyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
readOnlyMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RecordedTriggersDatabase.Orville.PostgreSQL.Trigger
ReferencesDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RelationalMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
ResultSetDatabase.Orville.PostgreSQL.Raw
RowDataErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RowDataErrorDetails 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
RowDataErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
rowErrorColumnNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
rowErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
rowErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
runOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
runOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
runSelectDatabase.Orville.PostgreSQL.Select
runTriggersDatabase.Orville.PostgreSQL.Trigger
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-S.html b/docs/orville-postgresql-legacy-docs/doc-index-S.html new file mode 100644 index 0000000..37028c3 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-S.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - S)

orville-postgresql-legacy-0.9.0.1: ORM

Index - S

sayDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SchemaDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
searchVectorFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectDatabase.Orville.PostgreSQL.Select
selectAllDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectColumnDatabase.Orville.PostgreSQL.Expr
selectConduitDatabase.Orville.PostgreSQL.Conduit
selectDistinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectExprDatabase.Orville.PostgreSQL.Expr
selectFieldDatabase.Orville.PostgreSQL.Select
selectFirstDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectForm 
1 (Type/Class)Database.Orville.PostgreSQL.Expr
2 (Data Constructor)Database.Orville.PostgreSQL.Expr
selectFormDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectFormAliasDatabase.Orville.PostgreSQL.Expr
selectFormColumnDatabase.Orville.PostgreSQL.Expr
selectManyDatabase.Orville.PostgreSQL.Plan.Operation
selectOneDatabase.Orville.PostgreSQL.Plan.Operation
SelectOperation 
1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
selectOperationDatabase.Orville.PostgreSQL.Plan.Operation
selectOptGroupDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectOptions 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptionsToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptLimitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptOffsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptOrderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectOptWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SelectQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
selectQueryDatabase.Orville.PostgreSQL.Select
selectQueryColumnsDatabase.Orville.PostgreSQL.Select
selectQueryRawDatabase.Orville.PostgreSQL.Select
selectQueryRawRowsDatabase.Orville.PostgreSQL.Select
selectQueryRowsDatabase.Orville.PostgreSQL.Select
selectQueryTableDatabase.Orville.PostgreSQL.Select
selectSqlDatabase.Orville.PostgreSQL.Raw
selectSqlRowsDatabase.Orville.PostgreSQL.Raw
SequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceCacheDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceCurrValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceCycleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SequenceDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceIncrementDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceMaxValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceMinValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceNextValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceSetValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sequenceStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
serialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
setStartTransactionSQLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
showFromSqlErrorForLoggingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
showFromSqlErrorMinimalDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
showSqlValueTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
simpleIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
simplePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SomeField 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SortDirectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SqlType 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeIdDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeReferenceDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeSqlSizeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
sqlTypeToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
SqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
streamPagesDatabase.Orville.PostgreSQL.Conduit
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-T.html b/docs/orville-postgresql-legacy-docs/doc-index-T.html new file mode 100644 index 0000000..90ba74d --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-T.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - T)

orville-postgresql-legacy-0.9.0.1: ORM

Index - T

TableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TableDefinition 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TableParams 
1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tablePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tableToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblPrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
tblSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
textDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
textFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
textSearchVectorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
timestampDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
toColumnDefaultSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
toMapDatabase.Orville.PostgreSQL.Plan.Many
ToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionCommitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionEventDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionRollbackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TransactionStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
TypeMismatchDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-U.html b/docs/orville-postgresql-legacy-docs/doc-index-U.html new file mode 100644 index 0000000..b8a16d2 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-U.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - U)

orville-postgresql-legacy-0.9.0.1: ORM

Index - U

unboundedTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
unboundedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uncommittedTriggersDatabase.Orville.PostgreSQL.Trigger
unescapedNameDatabase.Orville.PostgreSQL.Expr
UniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uniqueConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uniqueIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
uniquePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
unOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
UnpoppableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
UpdatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
updateFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
UpdateQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
updateRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
updateSqlDatabase.Orville.PostgreSQL.Raw
UpdateTriggerDatabase.Orville.PostgreSQL.Trigger
updateTriggeredDatabase.Orville.PostgreSQL.Trigger
updateTriggersDatabase.Orville.PostgreSQL.Trigger
useDatabase.Orville.PostgreSQL.Plan
usingDatabase.Orville.PostgreSQL.Plan
utcTimeFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-V.html b/docs/orville-postgresql-legacy-docs/doc-index-V.html new file mode 100644 index 0000000..f47c6bf --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-V.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - V)

orville-postgresql-legacy-0.9.0.1: ORM

Index - V

varTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index-W.html b/docs/orville-postgresql-legacy-docs/doc-index-W.html new file mode 100644 index 0000000..5beac7c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index-W.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - W)

orville-postgresql-legacy-0.9.0.1: ORM

Index - W

whereAndDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
WhereConditionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereLikeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereLikeInsensitiveDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereNotInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereOrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereQualifiedDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereRawDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
whereToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
where_Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withCachedConnectionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withConnectionDatabase.Orville.PostgreSQL.Raw
withConversionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withPrefixDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
withTransactionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index.html b/docs/orville-postgresql-legacy-docs/doc-index.html new file mode 100644 index 0000000..fd53e3a --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index)

orville-postgresql-legacy-0.9.0.1: ORM

\ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/doc-index.json b/docs/orville-postgresql-legacy-docs/doc-index.json new file mode 100644 index 0000000..47befa5 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/doc-index.json @@ -0,0 +1 @@ +[{"display_html":"createConnectionPool :: Int -> NominalDiffTime -> Int -> String -> IO (Pool Connection)","name":"createConnectionPool","module":"Database.Orville.PostgreSQL.Connection","link":"Database-Orville-PostgreSQL-Connection.html#v:createConnectionPool"},{"display_html":"data Pool a","name":"Pool","module":"Database.Orville.PostgreSQL.Connection","link":"Database-Orville-PostgreSQL-Connection.html#t:Pool"},{"display_html":"data Connection","name":"Connection","module":"Database.Orville.PostgreSQL.Connection","link":"Database-Orville-PostgreSQL-Connection.html#t:Connection"},{"display_html":"data RawExpr","name":"RawExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:RawExpr"},{"display_html":"rawSql :: String -> RawExpr","name":"rawSql","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:rawSql"},{"display_html":"class GenerateSql expr where","name":"GenerateSql generateSql","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:GenerateSql"},{"display_html":"data Expr a","name":"Expr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:Expr"},{"display_html":"rawSqlExpr :: String -> Expr a","name":"rawSqlExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:rawSqlExpr"},{"display_html":"expr :: a -> Expr a","name":"expr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:expr"},{"display_html":"type NameExpr = Expr NameForm","name":"NameExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:NameExpr"},{"display_html":"data NameForm","name":"NameForm","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:NameForm"},{"display_html":"unescapedName :: NameForm -> String","name":"unescapedName","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:unescapedName"},{"display_html":"type SelectExpr = Expr SelectForm","name":"SelectExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:SelectExpr"},{"display_html":"data SelectForm = SelectForm {}","name":"SelectForm SelectForm selectFormColumn selectFormAlias","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:SelectForm"},{"display_html":"selectColumn :: NameForm -> SelectForm","name":"selectColumn","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:selectColumn"},{"display_html":"qualified :: QualifySql form => form -> String -> form","name":"qualified","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:qualified"},{"display_html":"aliased :: SelectForm -> NameForm -> SelectForm","name":"aliased","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:aliased"},{"display_html":"data Explanation","name":"Explanation","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#t:Explanation"},{"display_html":"noExplanation :: Explanation","name":"noExplanation","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#v:noExplanation"},{"display_html":"explainStep :: String -> Explanation","name":"explainStep","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#v:explainStep"},{"display_html":"explanationSteps :: Explanation -> [String]","name":"explanationSteps","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#v:explanationSteps"},{"display_html":"data Many k a","name":"Many","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#t:Many"},{"display_html":"data NotAKey = NotAKey","name":"NotAKey NotAKey","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#t:NotAKey"},{"display_html":"fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a","name":"fromKeys","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:fromKeys"},{"display_html":"lookup :: k -> Many k a -> Either NotAKey a","name":"lookup","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:lookup"},{"display_html":"keys :: Many k a -> [k]","name":"keys","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:keys"},{"display_html":"elems :: Many k a -> [a]","name":"elems","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:elems"},{"display_html":"map :: (a -> b) -> Many k a -> Many k b","name":"map","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:map"},{"display_html":"toMap :: Ord k => Many k a -> Map k a","name":"toMap","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:toMap"},{"display_html":"apply :: Many param (a -> b) -> Many param a -> Many param b","name":"apply","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:apply"},{"display_html":"compose :: Many b c -> Many a b -> Many a c","name":"compose","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:compose"},{"display_html":"data Select row","name":"Select","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#t:Select"},{"display_html":"selectQuery :: FromSql row -> FromClause -> SelectOptions -> Select row","name":"selectQuery","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQuery"},{"display_html":"selectQueryTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Select readEntity","name":"selectQueryTable","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryTable"},{"display_html":"selectQueryRows :: [SelectExpr] -> FromClause -> SelectOptions -> Select [(String, SqlValue)]","name":"selectQueryRows","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryRows"},{"display_html":"selectQueryRaw :: FromSql row -> String -> [SqlValue] -> Select row","name":"selectQueryRaw","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryRaw"},{"display_html":"selectQueryRawRows :: String -> [SqlValue] -> Select [(String, SqlValue)]","name":"selectQueryRawRows","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryRawRows"},{"display_html":"selectQueryColumns :: [SelectExpr] -> FromSql row -> FromClause -> SelectOptions -> Select row","name":"selectQueryColumns","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryColumns"},{"display_html":"selectField :: FieldDefinition nulability a -> SelectForm","name":"selectField","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectField"},{"display_html":"data FromClause","name":"FromClause","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#t:FromClause"},{"display_html":"fromClauseRaw :: String -> FromClause","name":"fromClauseRaw","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:fromClauseRaw"},{"display_html":"fromClauseTableName :: String -> FromClause","name":"fromClauseTableName","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:fromClauseTableName"},{"display_html":"fromClauseTable :: TableDefinition readEntity writeEntity key -> FromClause","name":"fromClauseTable","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:fromClauseTable"},{"display_html":"runSelect :: MonadOrville conn m => Select row -> m [row]","name":"runSelect","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:runSelect"},{"display_html":"selectSql :: MonadOrville conn m => String -> [SqlValue] -> FromSql result -> m [result]","name":"selectSql","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:selectSql"},{"display_html":"selectSqlRows :: MonadOrville conn m => String -> [SqlValue] -> m ResultSet","name":"selectSqlRows","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:selectSqlRows"},{"display_html":"decodeSqlRows :: MonadOrville conn m => FromSql result -> ResultSet -> m [result]","name":"decodeSqlRows","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:decodeSqlRows"},{"display_html":"type ResultSet = [[(String, SqlValue)]]","name":"ResultSet","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#t:ResultSet"},{"display_html":"updateSql :: MonadOrville conn m => String -> [SqlValue] -> m Integer","name":"updateSql","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:updateSql"},{"display_html":"withConnection :: MonadOrville conn m => (conn -> m a) -> m a","name":"withConnection","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:withConnection"},{"display_html":"withTransaction :: MonadOrville conn m => m a -> m a","name":"withTransaction","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:withTransaction"},{"display_html":"withCachedConnection :: MonadOrville conn m => m a -> m a","name":"withCachedConnection","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:withCachedConnection"},{"display_html":"selectConduit :: (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m) => Select row -> ConduitT () row m ()","name":"selectConduit","module":"Database.Orville.PostgreSQL.Conduit","link":"Database-Orville-PostgreSQL-Conduit.html#v:selectConduit"},{"display_html":"streamPages :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> ConduitT () readEnt m ()","name":"streamPages","module":"Database.Orville.PostgreSQL.Conduit","link":"Database-Orville-PostgreSQL-Conduit.html#v:streamPages"},{"display_html":"data TableDefinition readEntity writeEntity key = TableDefinition {}","name":"TableDefinition TableDefinition tableName tableFields tableSafeToDelete tablePrimaryKey tableFromSql tableToSql tableGetKey tableComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TableDefinition"},{"display_html":"data PrimaryKey key","name":"PrimaryKey","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:PrimaryKey"},{"display_html":"primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition","name":"primaryKeyIn","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyIn"},{"display_html":"primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition","name":"primaryKeyEquals","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyEquals"},{"display_html":"primaryKeyDescription :: PrimaryKey key -> String","name":"primaryKeyDescription","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyDescription"},{"display_html":"primaryKeyToSql :: PrimaryKey key -> key -> [SqlValue]","name":"primaryKeyToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyToSql"},{"display_html":"primaryKey :: FieldDefinition NotNull key -> PrimaryKey key","name":"primaryKey","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKey"},{"display_html":"compositePrimaryKey :: PrimaryKeyPart key -> [PrimaryKeyPart key] -> PrimaryKey key","name":"compositePrimaryKey","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:compositePrimaryKey"},{"display_html":"primaryKeyPart :: (key -> part) -> FieldDefinition NotNull part -> PrimaryKeyPart key","name":"primaryKeyPart","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyPart"},{"display_html":"mkTableDefinition :: TableParams readEntity writeEntity key -> TableDefinition readEntity writeEntity key","name":"mkTableDefinition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mkTableDefinition"},{"display_html":"data SqlType a = SqlType {}","name":"SqlType SqlType sqlTypeDDL sqlTypeReferenceDDL sqlTypeId sqlTypeSqlSize sqlTypeToSql sqlTypeFromSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SqlType"},{"display_html":"serial :: SqlType Int32","name":"serial","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:serial"},{"display_html":"bigserial :: SqlType Int64","name":"bigserial","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:bigserial"},{"display_html":"text :: Int -> SqlType Text","name":"text","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:text"},{"display_html":"varText :: Int -> SqlType Text","name":"varText","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:varText"},{"display_html":"unboundedText :: SqlType Text","name":"unboundedText","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:unboundedText"},{"display_html":"integer :: SqlType Int32","name":"integer","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:integer"},{"display_html":"bigInteger :: SqlType Int64","name":"bigInteger","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:bigInteger"},{"display_html":"double :: SqlType Double","name":"double","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:double"},{"display_html":"boolean :: SqlType Bool","name":"boolean","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:boolean"},{"display_html":"date :: SqlType Day","name":"date","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:date"},{"display_html":"timestamp :: SqlType UTCTime","name":"timestamp","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:timestamp"},{"display_html":"textSearchVector :: SqlType Text","name":"textSearchVector","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:textSearchVector"},{"display_html":"convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b","name":"convertSqlType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:convertSqlType"},{"display_html":"maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b","name":"maybeConvertSqlType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:maybeConvertSqlType"},{"display_html":"data TableParams readEntity writeEntity key = TableParams {}","name":"TableParams TableParams tblName tblMapper tblSafeToDelete tblPrimaryKey tblGetKey tblComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TableParams"},{"display_html":"data RelationalMap a b","name":"RelationalMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:RelationalMap"},{"display_html":"fields :: RelationalMap a b -> [SomeField]","name":"fields","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fields"},{"display_html":"mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c","name":"mapAttr","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mapAttr"},{"display_html":"mapField :: FieldDefinition nullability a -> RelationalMap a a","name":"mapField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mapField"},{"display_html":"attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b","name":"attrField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:attrField"},{"display_html":"maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b)","name":"maybeMapper","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:maybeMapper"},{"display_html":"prefixMap :: String -> RelationalMap a b -> RelationalMap a b","name":"prefixMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:prefixMap"},{"display_html":"partialMap :: RelationalMap a (Either String a) -> RelationalMap a a","name":"partialMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:partialMap"},{"display_html":"readOnlyMap :: RelationalMap a b -> RelationalMap c b","name":"readOnlyMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:readOnlyMap"},{"display_html":"readOnlyField :: FieldDefinition nullability a -> RelationalMap b a","name":"readOnlyField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:readOnlyField"},{"display_html":"data OrvilleEnv conn","name":"OrvilleEnv","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OrvilleEnv"},{"display_html":"newOrvilleEnv :: Pool conn -> OrvilleEnv conn","name":"newOrvilleEnv","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:newOrvilleEnv"},{"display_html":"setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn","name":"setStartTransactionSQL","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:setStartTransactionSQL"},{"display_html":"aroundRunningQuery :: (forall a. QueryType -> String -> IO a -> IO a) -> OrvilleEnv conn -> OrvilleEnv conn","name":"aroundRunningQuery","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:aroundRunningQuery"},{"display_html":"addTransactionCallBack :: (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn","name":"addTransactionCallBack","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:addTransactionCallBack"},{"display_html":"ormEnvPool :: OrvilleEnv conn -> Pool conn","name":"ormEnvPool","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:ormEnvPool"},{"display_html":"data TransactionEvent","name":"TransactionEvent TransactionStart TransactionCommit TransactionRollback","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TransactionEvent"},{"display_html":"data OrvilleT conn m a","name":"OrvilleT","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OrvilleT"},{"display_html":"unOrvilleT :: OrvilleT conn m a -> ReaderT (OrvilleEnv conn) m a","name":"unOrvilleT","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:unOrvilleT"},{"display_html":"data SqlValue","name":"SqlValue","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SqlValue"},{"display_html":"class IConnection conn => HasOrvilleContext conn m | m -> conn where","name":"HasOrvilleContext getOrvilleEnv localOrvilleEnv","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:HasOrvilleContext"},{"display_html":"class (Monad m, MonadIO m, HasOrvilleContext conn m, MonadThrow m, MonadOrvilleControl m, MonadFail m) => MonadOrville conn m","name":"MonadOrville","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MonadOrville"},{"display_html":"runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a","name":"runOrville","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:runOrville"},{"display_html":"mapOrvilleT :: Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b","name":"mapOrvilleT","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mapOrvilleT"},{"display_html":"class MonadOrvilleControl m where","name":"MonadOrvilleControl liftWithConnection liftFinally","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MonadOrvilleControl"},{"display_html":"defaultLiftWithConnection :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a. (conn -> IO a) -> IO a) -> (conn -> n b) -> n b","name":"defaultLiftWithConnection","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:defaultLiftWithConnection"},{"display_html":"defaultLiftFinally :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a b. IO a -> IO b -> IO a) -> n c -> n d -> n c","name":"defaultLiftFinally","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:defaultLiftFinally"},{"display_html":"data QueryType","name":"QueryType SelectQuery InsertQuery UpdateQuery DeleteQuery DDLQuery","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:QueryType"},{"display_html":"withCachedConnection :: MonadOrville conn m => m a -> m a","name":"withCachedConnection","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withCachedConnection"},{"display_html":"withTransaction :: MonadOrville conn m => m a -> m a","name":"withTransaction","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withTransaction"},{"display_html":"data ColumnFlag","name":"ColumnFlag Unique Default References ColumnDescription AssignedByDatabase","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ColumnFlag"},{"display_html":"class ColumnDefault a where","name":"ColumnDefault toColumnDefaultSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ColumnDefault"},{"display_html":"data Now = Now","name":"Now Now","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Now"},{"display_html":"data FieldDefinition nullability a","name":"FieldDefinition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FieldDefinition"},{"display_html":"data Nullable","name":"Nullable","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Nullable"},{"display_html":"data NotNull","name":"NotNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:NotNull"},{"display_html":"data Nullability nullability where","name":"Nullability Nullable NotNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Nullability"},{"display_html":"isFieldNullable :: FieldDefinition nullability a -> Bool","name":"isFieldNullable","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:isFieldNullable"},{"display_html":"fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a","name":"fieldOfType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldOfType"},{"display_html":"textField :: String -> Int -> FieldDefinition NotNull Text","name":"textField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:textField"},{"display_html":"fixedTextField :: String -> Int -> FieldDefinition NotNull Text","name":"fixedTextField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fixedTextField"},{"display_html":"unboundedTextField :: String -> FieldDefinition NotNull Text","name":"unboundedTextField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:unboundedTextField"},{"display_html":"dayField :: String -> FieldDefinition NotNull Day","name":"dayField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:dayField"},{"display_html":"utcTimeField :: String -> FieldDefinition NotNull UTCTime","name":"utcTimeField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:utcTimeField"},{"display_html":"int32Field :: String -> FieldDefinition NotNull Int32","name":"int32Field","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:int32Field"},{"display_html":"int64Field :: String -> FieldDefinition NotNull Int64","name":"int64Field","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:int64Field"},{"display_html":"doubleField :: String -> FieldDefinition NotNull Double","name":"doubleField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:doubleField"},{"display_html":"boolField :: String -> FieldDefinition NotNull Bool","name":"boolField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:boolField"},{"display_html":"automaticIdField :: String -> FieldDefinition NotNull Int32","name":"automaticIdField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:automaticIdField"},{"display_html":"searchVectorField :: String -> FieldDefinition NotNull Text","name":"searchVectorField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:searchVectorField"},{"display_html":"nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a)","name":"nullableField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:nullableField"},{"display_html":"foreignKeyField :: String -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> FieldDefinition nullability key","name":"foreignKeyField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:foreignKeyField"},{"display_html":"withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a","name":"withFlag","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withFlag"},{"display_html":"withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a","name":"withName","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withName"},{"display_html":"withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b","name":"withConversion","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withConversion"},{"display_html":"fieldFromSql :: FieldDefinition nullability a -> FromSql a","name":"fieldFromSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldFromSql"},{"display_html":"fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue","name":"fieldToSqlValue","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldToSqlValue"},{"display_html":"data SomeField = SomeField (FieldDefinition nullability a)","name":"SomeField SomeField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SomeField"},{"display_html":"withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a","name":"withPrefix","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withPrefix"},{"display_html":"fieldName :: FieldDefinition nullability a -> String","name":"fieldName","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldName"},{"display_html":"fieldType :: FieldDefinition nullability a -> SqlType a","name":"fieldType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldType"},{"display_html":"fieldFlags :: FieldDefinition nullability a -> [ColumnFlag]","name":"fieldFlags","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldFlags"},{"display_html":"data IndexDefinition = IndexDefinition {}","name":"IndexDefinition IndexDefinition indexName indexUnique indexTable indexBody","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:IndexDefinition"},{"display_html":"uniqueIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition","name":"uniqueIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:uniqueIndex"},{"display_html":"simpleIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition","name":"simpleIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:simpleIndex"},{"display_html":"simplePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition","name":"simplePartialIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:simplePartialIndex"},{"display_html":"uniquePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition","name":"uniquePartialIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:uniquePartialIndex"},{"display_html":"data ConstraintDefinition = ConstraintDefinition {}","name":"ConstraintDefinition ConstraintDefinition constraintName constraintTable constraintBody","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ConstraintDefinition"},{"display_html":"data SequenceDefinition = SequenceDefinition {}","name":"SequenceDefinition SequenceDefinition sequenceName sequenceIncrement sequenceMinValue sequenceMaxValue sequenceStart sequenceCache sequenceCycle","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SequenceDefinition"},{"display_html":"uniqueConstraint :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> ConstraintDefinition","name":"uniqueConstraint","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:uniqueConstraint"},{"display_html":"dropConstraint :: TableDefinition readEntity writeEntity key -> String -> SchemaItem","name":"dropConstraint","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:dropConstraint"},{"display_html":"data FromSql a","name":"FromSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FromSql"},{"display_html":"data FromSqlError","name":"FromSqlError RowDataError MissingColumn ConversionError","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FromSqlError"},{"display_html":"data RowDataErrorDetails = RowDataErrorDetails {}","name":"RowDataErrorDetails RowDataErrorDetails rowErrorReason rowErrorColumnName rowErrorPrimaryKeys","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:RowDataErrorDetails"},{"display_html":"data RowDataErrorReason","name":"RowDataErrorReason DecodingFailure IntegralOutOfBounds TypeMismatch","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:RowDataErrorReason"},{"display_html":"data MissingColumnDetails = MissingColumnDetails {}","name":"MissingColumnDetails MissingColumnDetails missingColumn actualColumns","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MissingColumnDetails"},{"display_html":"data ConversionErrorDetails = ConversionErrorDetails {}","name":"ConversionErrorDetails ConversionErrorDetails convErrorReason convErrorPrimaryKeys","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ConversionErrorDetails"},{"display_html":"showFromSqlErrorMinimal :: FromSqlError -> String","name":"showFromSqlErrorMinimal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:showFromSqlErrorMinimal"},{"display_html":"showFromSqlErrorForLogging :: FromSqlError -> String","name":"showFromSqlErrorForLogging","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:showFromSqlErrorForLogging"},{"display_html":"showSqlValueType :: SqlValue -> String","name":"showSqlValueType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:showSqlValueType"},{"display_html":"class ColumnSpecifier col where","name":"ColumnSpecifier selectForm","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ColumnSpecifier"},{"display_html":"col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a","name":"col","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:col"},{"display_html":"data ToSql a b","name":"ToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ToSql"},{"display_html":"getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity ()","name":"getField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:getField"},{"display_html":"getComponent :: (entity -> a) -> ToSql a () -> ToSql entity ()","name":"getComponent","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:getComponent"},{"display_html":"data SchemaItem","name":"SchemaItem Constraint Table DropTable Index DropIndex DropConstraint Sequence DropSequence","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SchemaItem"},{"display_html":"type SchemaDefinition = [SchemaItem]","name":"SchemaDefinition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SchemaDefinition"},{"display_html":"type Record = Int","name":"Record","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Record"},{"display_html":"type CreatedAt = UTCTime","name":"CreatedAt","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:CreatedAt"},{"display_html":"type UpdatedAt = UTCTime","name":"UpdatedAt","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:UpdatedAt"},{"display_html":"type OccurredAt = UTCTime","name":"OccurredAt","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OccurredAt"},{"display_html":"data TableComments a","name":"TableComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TableComments"},{"display_html":"noComments :: TableComments ()","name":"noComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:noComments"},{"display_html":"say :: String -> (Int, Int, Int) -> String -> TableComments ()","name":"say","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:say"},{"display_html":"data WhereCondition","name":"WhereCondition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:WhereCondition"},{"display_html":"whereAnd :: [WhereCondition] -> WhereCondition","name":"whereAnd","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereAnd"},{"display_html":"whereOr :: [WhereCondition] -> WhereCondition","name":"whereOr","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereOr"},{"display_html":"whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition","name":"whereIn","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereIn"},{"display_html":"whereLike :: FieldDefinition nullability a -> String -> WhereCondition","name":"whereLike","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereLike"},{"display_html":"whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition","name":"whereLikeInsensitive","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereLikeInsensitive"},{"display_html":"whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition","name":"whereNotIn","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereNotIn"},{"display_html":"whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition","name":"whereQualified","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereQualified"},{"display_html":"whereRaw :: String -> [SqlValue] -> WhereCondition","name":"whereRaw","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereRaw"},{"display_html":"whereToSql :: [WhereCondition] -> (String, [SqlValue])","name":"whereToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereToSql"},{"display_html":"isNull :: FieldDefinition Nullable a -> WhereCondition","name":"isNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:isNull"},{"display_html":"isNotNull :: FieldDefinition Nullable a -> WhereCondition","name":"isNotNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:isNotNull"},{"display_html":"(.==) :: FieldDefinition nullability a -> a -> WhereCondition","name":".==","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-61--61-"},{"display_html":"(.<>) :: FieldDefinition nullability a -> a -> WhereCondition","name":".<>","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60--62-"},{"display_html":"(.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition","name":".<-","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60--45-"},{"display_html":"(%==) :: FieldDefinition nullability a -> a -> WhereCondition","name":"%==","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:-37--61--61-"},{"display_html":"(.>) :: FieldDefinition nullability a -> a -> WhereCondition","name":".>","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-62-"},{"display_html":"(.>=) :: FieldDefinition nullability a -> a -> WhereCondition","name":".>=","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-62--61-"},{"display_html":"(.<) :: FieldDefinition nullability a -> a -> WhereCondition","name":".<","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60-"},{"display_html":"(.<=) :: FieldDefinition nullability a -> a -> WhereCondition","name":".<=","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60--61-"},{"display_html":"data SelectOptions = SelectOptions {}","name":"SelectOptions SelectOptions selectDistinct selectOptWhere selectOptOrder selectOptLimit selectOptOffset selectOptGroup","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SelectOptions"},{"display_html":"where_ :: WhereCondition -> SelectOptions","name":"where_","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:where_"},{"display_html":"distinct :: SelectOptions","name":"distinct","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:distinct"},{"display_html":"order :: ToOrderBy a => a -> SortDirection -> SelectOptions","name":"order","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:order"},{"display_html":"limit :: Int -> SelectOptions","name":"limit","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:limit"},{"display_html":"offset :: Int -> SelectOptions","name":"offset","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:offset"},{"display_html":"groupBy :: ToGroupBy a => a -> SelectOptions","name":"groupBy","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:groupBy"},{"display_html":"selectOptionsToSql :: SelectOptions -> (String, [SqlValue])","name":"selectOptionsToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:selectOptionsToSql"},{"display_html":"(<>) :: Semigroup a => a -> a -> a","name":"<>","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:-60--62-"},{"display_html":"data FieldUpdate","name":"FieldUpdate","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FieldUpdate"},{"display_html":"fieldUpdate :: FieldDefinition nullability a -> a -> FieldUpdate","name":"fieldUpdate","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldUpdate"},{"display_html":"(.:=) :: FieldDefinition nullability a -> a -> FieldUpdate","name":".:=","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.:-61-"},{"display_html":"data OrderByClause = OrderByClause String [SqlValue] SortDirection","name":"OrderByClause OrderByClause","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OrderByClause"},{"display_html":"data SortDirection","name":"SortDirection Ascending Descending","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SortDirection"},{"display_html":"migrateSchema :: MonadOrville conn m => SchemaDefinition -> m ()","name":"migrateSchema","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:migrateSchema"},{"display_html":"data MigrationError","name":"MigrationError MigrationLockExcessiveRetryError MigrationExecutionError","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MigrationError"},{"display_html":"generateMigrationPlan :: MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan)","name":"generateMigrationPlan","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:generateMigrationPlan"},{"display_html":"data MigrationPlan","name":"MigrationPlan","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MigrationPlan"},{"display_html":"data MigrationItem = MigrationItem {}","name":"MigrationItem MigrationItem migrationItemSchemaItem migrationItemDDL","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MigrationItem"},{"display_html":"migrationPlanItems :: MigrationPlan -> [MigrationItem]","name":"migrationPlanItems","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:migrationPlanItems"},{"display_html":"data Pagination m entity = Pagination {}","name":"Pagination Pagination pageRows pageNext","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Pagination"},{"display_html":"buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> m (Pagination m readEnt)","name":"buildPagination","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:buildPagination"},{"display_html":"selectAll :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m [readEntity]","name":"selectAll","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:selectAll"},{"display_html":"selectFirst :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m (Maybe readEntity)","name":"selectFirst","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:selectFirst"},{"display_html":"deleteRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m ()","name":"deleteRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:deleteRecord"},{"display_html":"deleteWhere :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [WhereCondition] -> m Integer","name":"deleteWhere","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:deleteWhere"},{"display_html":"findRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m (Maybe readEntity)","name":"findRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:findRecord"},{"display_html":"findRecords :: (Ord key, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> [key] -> m (Map key readEntity)","name":"findRecords","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:findRecords"},{"display_html":"findRecordsBy :: (Ord fieldValue, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> m (Map fieldValue [readEntity])","name":"findRecordsBy","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:findRecordsBy"},{"display_html":"insertRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity","name":"insertRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:insertRecord"},{"display_html":"insertRecordMany :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m ()","name":"insertRecordMany","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:insertRecordMany"},{"display_html":"insertRecordManyReturning :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m [readEntity]","name":"insertRecordManyReturning","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:insertRecordManyReturning"},{"display_html":"updateFields :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [FieldUpdate] -> [WhereCondition] -> m Integer","name":"updateFields","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:updateFields"},{"display_html":"updateRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> writeEntity -> m ()","name":"updateRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:updateRecord"},{"display_html":"sequenceNextVal :: MonadOrville conn m => SequenceDefinition -> m Int","name":"sequenceNextVal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:sequenceNextVal"},{"display_html":"sequenceSetVal :: MonadOrville conn m => SequenceDefinition -> Int -> m Int","name":"sequenceSetVal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:sequenceSetVal"},{"display_html":"sequenceCurrVal :: MonadOrville conn m => SequenceDefinition -> m Int","name":"sequenceCurrVal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:sequenceCurrVal"},{"display_html":"createIndexesConcurrently :: MonadOrville conn m => [IndexDefinition] -> m ()","name":"createIndexesConcurrently","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:createIndexesConcurrently"},{"display_html":"dropIndexesConcurrently :: MonadOrville conn m => [String] -> m ()","name":"dropIndexesConcurrently","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:dropIndexesConcurrently"},{"display_html":"data PopError","name":"PopError MissingRecord MissingRecordBy Unpoppable","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#t:PopError"},{"display_html":"data Popper a b","name":"Popper","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#t:Popper"},{"display_html":"data Popped a","name":"Popped PoppedError PoppedValue","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#t:Popped"},{"display_html":"(>>>) :: Category cat => cat a b -> cat b c -> cat a c","name":">>>","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:-62--62--62-"},{"display_html":"(<<<) :: Category cat => cat b c -> cat a b -> cat a c","name":"<<<","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:-60--60--60-"},{"display_html":"abortPop :: PopError -> Popper a b","name":"abortPop","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:abortPop"},{"display_html":"certainly :: PopError -> Popper (Maybe b) b","name":"certainly","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:certainly"},{"display_html":"certainly' :: Popper a PopError -> Popper a (Maybe b) -> Popper a b","name":"certainly'","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:certainly-39-"},{"display_html":"fromKern :: (a -> b) -> Popper a b","name":"fromKern","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:fromKern"},{"display_html":"hasMany :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue [readEntity]","name":"hasMany","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasMany"},{"display_html":"hasManyIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue [readEntity])","name":"hasManyIn","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasManyIn"},{"display_html":"hasOneIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue readEntity)","name":"hasOneIn","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOneIn"},{"display_html":"hasManyInWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper [fieldValue] (Map fieldValue [readEntity])","name":"hasManyInWhere","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasManyInWhere"},{"display_html":"hasManyWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue [readEntity]","name":"hasManyWhere","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasManyWhere"},{"display_html":"hasOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue (Maybe readEntity)","name":"hasOne","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOne"},{"display_html":"hasOne' :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue readEntity","name":"hasOne'","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOne-39-"},{"display_html":"hasOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue (Maybe readEntity)","name":"hasOneWhere","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOneWhere"},{"display_html":"kern :: Popper a a","name":"kern","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:kern"},{"display_html":"popMissingRecord :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue PopError","name":"popMissingRecord","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popMissingRecord"},{"display_html":"onKern :: (a -> b -> c) -> Popper b a -> Popper b c","name":"onKern","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:onKern"},{"display_html":"pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b)","name":"pop","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:pop"},{"display_html":"popThrow :: MonadOrville conn m => Popper a b -> a -> m b","name":"popThrow","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popThrow"},{"display_html":"popFirst :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a (Maybe readEntity)","name":"popFirst","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popFirst"},{"display_html":"popMany :: Popper a b -> Popper [a] [b]","name":"popMany","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popMany"},{"display_html":"onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b","name":"onPopMany","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:onPopMany"},{"display_html":"popMaybe :: Popper a b -> Popper (Maybe a) (Maybe b)","name":"popMaybe","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popMaybe"},{"display_html":"popQuery :: String -> (forall conn m. MonadOrville conn m => m b) -> Popper a b","name":"popQuery","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popQuery"},{"display_html":"popRecord :: TableDefinition readEntity writeEntity key -> key -> Popper a (Maybe readEntity)","name":"popRecord","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popRecord"},{"display_html":"popRecord' :: TableDefinition readEntity writeEntity key -> key -> Popper a readEntity","name":"popRecord'","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popRecord-39-"},{"display_html":"popTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a [readEntity]","name":"popTable","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popTable"},{"display_html":"explain :: Popper a b -> String","name":"explain","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:explain"},{"display_html":"explainLines :: Popper a b -> [String]","name":"explainLines","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:explainLines"},{"display_html":"data Operation param result = Operation {}","name":"Operation Operation executeOperationOne executeOperationMany explainOperationOne explainOperationMany","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#t:Operation"},{"display_html":"data AssertionFailed","name":"AssertionFailed","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#t:AssertionFailed"},{"display_html":"mkAssertionFailed :: String -> AssertionFailed","name":"mkAssertionFailed","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:mkAssertionFailed"},{"display_html":"findOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue (Maybe readEntity)","name":"findOne","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findOne"},{"display_html":"findOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue (Maybe readEntity)","name":"findOneWhere","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findOneWhere"},{"display_html":"findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue [readEntity]","name":"findAll","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findAll"},{"display_html":"findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue [readEntity]","name":"findAllWhere","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findAllWhere"},{"display_html":"findSelect :: Select row -> Operation param [row]","name":"findSelect","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findSelect"},{"display_html":"askParam :: Operation param param","name":"askParam","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:askParam"},{"display_html":"assertRight :: Operation (Either String a) a","name":"assertRight","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:assertRight"},{"display_html":"data SelectOperation param row result = SelectOperation {}","name":"SelectOperation SelectOperation selectOne selectMany explainSelectOne explainSelectMany categorizeRow produceResult","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#t:SelectOperation"},{"display_html":"selectOperation :: Ord param => SelectOperation param row result -> Operation param result","name":"selectOperation","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:selectOperation"},{"display_html":"data Plan scope param result","name":"Plan","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Plan"},{"display_html":"data Planned scope param a","name":"Planned","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Planned"},{"display_html":"data Execute","name":"Execute","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Execute"},{"display_html":"data Explain","name":"Explain","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Explain"},{"display_html":"askParam :: Plan scope param param","name":"askParam","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:askParam"},{"display_html":"execute :: MonadOrville conn m => Plan Execute param result -> param -> m result","name":"execute","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:execute"},{"display_html":"explain :: Plan Explain param result -> [String]","name":"explain","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:explain"},{"display_html":"findMaybeOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue (Maybe readEntity)","name":"findMaybeOne","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findMaybeOne"},{"display_html":"findMaybeOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue (Maybe readEntity)","name":"findMaybeOneWhere","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findMaybeOneWhere"},{"display_html":"findOne :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity","name":"findOne","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOne"},{"display_html":"findOneShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity","name":"findOneShowVia","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOneShowVia"},{"display_html":"findOneWhere :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity","name":"findOneWhere","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOneWhere"},{"display_html":"findOneWhereShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity","name":"findOneWhereShowVia","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOneWhereShowVia"},{"display_html":"findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue [readEntity]","name":"findAll","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findAll"},{"display_html":"findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue [readEntity]","name":"findAllWhere","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findAllWhere"},{"display_html":"bind :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result","name":"bind","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:bind"},{"display_html":"use :: Planned scope param a -> Plan scope param a","name":"use","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:use"},{"display_html":"using :: Planned scope param a -> Plan scope a b -> Plan scope param b","name":"using","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:using"},{"display_html":"chain :: Plan scope a b -> Plan scope b c -> Plan scope a c","name":"chain","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:chain"},{"display_html":"apply :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b","name":"apply","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:apply"},{"display_html":"planMany :: (forall manyScope. Plan manyScope param result) -> Plan scope [param] (Many param result)","name":"planMany","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planMany"},{"display_html":"planList :: (forall scope. Plan scope param result) -> Plan listScope [param] [result]","name":"planList","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planList"},{"display_html":"focusParam :: (a -> b) -> Plan scope b result -> Plan scope a result","name":"focusParam","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:focusParam"},{"display_html":"planEither :: Plan scope leftParam leftResult -> Plan scope rightParam rightResult -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult)","name":"planEither","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planEither"},{"display_html":"planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b)","name":"planMaybe","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planMaybe"},{"display_html":"data AssertionFailed","name":"AssertionFailed","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:AssertionFailed"},{"display_html":"assert :: (param -> a -> Either String b) -> Plan scope param a -> Plan scope param b","name":"assert","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:assert"},{"display_html":"planSelect :: Select row -> Plan scope () [row]","name":"planSelect","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planSelect"},{"display_html":"planOperation :: Operation param result -> Plan scope param result","name":"planOperation","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planOperation"},{"display_html":"(>>=) :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result","name":">>=","module":"Database.Orville.PostgreSQL.Plan.Syntax","link":"Database-Orville-PostgreSQL-Plan-Syntax.html#v:-62--62--61-"},{"display_html":"module Database.Orville.PostgreSQL.Core","name":"","module":"Database.Orville.PostgreSQL","link":""},{"display_html":"module Database.Orville.PostgreSQL.Popper","name":"","module":"Database.Orville.PostgreSQL","link":""},{"display_html":"insertTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, InsertTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity","name":"insertTriggered","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:insertTriggered"},{"display_html":"class InsertTrigger trigger readEntity where","name":"InsertTrigger insertTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:InsertTrigger"},{"display_html":"updateTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, UpdateTrigger trigger readEntity writeEntity) => TableDefinition readEntity writeEntity key -> readEntity -> writeEntity -> m ()","name":"updateTriggered","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:updateTriggered"},{"display_html":"class UpdateTrigger trigger readEntity writeEntity where","name":"UpdateTrigger updateTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:UpdateTrigger"},{"display_html":"deleteTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, DeleteTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> readEntity -> m ()","name":"deleteTriggered","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:deleteTriggered"},{"display_html":"class DeleteTrigger trigger readEntity where","name":"DeleteTrigger deleteTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:DeleteTrigger"},{"display_html":"class MonadTrigger trigger m | m -> trigger where","name":"MonadTrigger runTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:MonadTrigger"},{"display_html":"data OrvilleTriggerT trigger conn m a","name":"OrvilleTriggerT","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:OrvilleTriggerT"},{"display_html":"data RecordedTriggers trigger","name":"RecordedTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:RecordedTriggers"},{"display_html":"committedTriggers :: RecordedTriggers trigger -> [trigger]","name":"committedTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:committedTriggers"},{"display_html":"uncommittedTriggers :: RecordedTriggers trigger -> Maybe [trigger]","name":"uncommittedTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:uncommittedTriggers"},{"display_html":"runOrvilleTriggerT :: MonadIO m => OrvilleTriggerT trigger conn m a -> Pool conn -> m (a, [trigger])","name":"runOrvilleTriggerT","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:runOrvilleTriggerT"},{"display_html":"mapOrvilleTriggerT :: Monad n => (m a -> n b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn n b","name":"mapOrvilleTriggerT","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:mapOrvilleTriggerT"},{"display_html":"liftOrville :: Monad m => OrvilleT conn m a -> OrvilleTriggerT trigger conn m a","name":"liftOrville","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:liftOrville"},{"display_html":"askTriggers :: MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger)","name":"askTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:askTriggers"},{"display_html":"clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m ()","name":"clearTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:clearTriggers"},{"display_html":"liftWithConnectionViaUnliftIO :: MonadUnliftIO m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b","name":"liftWithConnectionViaUnliftIO","module":"Database.Orville.PostgreSQL.MonadUnliftIO","link":"Database-Orville-PostgreSQL-MonadUnliftIO.html#v:liftWithConnectionViaUnliftIO"},{"display_html":"liftFinallyViaUnliftIO :: MonadUnliftIO m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c","name":"liftFinallyViaUnliftIO","module":"Database.Orville.PostgreSQL.MonadUnliftIO","link":"Database-Orville-PostgreSQL-MonadUnliftIO.html#v:liftFinallyViaUnliftIO"},{"display_html":"liftWithConnectionViaBaseControl :: MonadBaseControl IO m => (forall b. (conn -> IO b) -> IO b) -> (conn -> m a) -> m a","name":"liftWithConnectionViaBaseControl","module":"Database.Orville.PostgreSQL.MonadBaseControl","link":"Database-Orville-PostgreSQL-MonadBaseControl.html#v:liftWithConnectionViaBaseControl"},{"display_html":"liftFinallyViaBaseControl :: MonadBaseControl IO m => (forall c d. IO c -> IO d -> IO c) -> m a -> m b -> m a","name":"liftFinallyViaBaseControl","module":"Database.Orville.PostgreSQL.MonadBaseControl","link":"Database-Orville-PostgreSQL-MonadBaseControl.html#v:liftFinallyViaBaseControl"}] \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/haddock-bundle.min.js b/docs/orville-postgresql-legacy-docs/haddock-bundle.min.js new file mode 100644 index 0000000..1061714 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/haddock-bundle.min.js @@ -0,0 +1,2 @@ +!function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s element with id '"+e+"'");return t}function r(e){for(var t=e.target,n=t.id,r=o(n),i=r.element.open,s=0,l=r.toggles;s0&&(d[n.id]={element:n,openByDefault:!!n.open,toggles:[]},n.addEventListener("toggle",r))}}function s(e){var t=o(e).element;t.open=!t.open}function a(){var e=Object.keys(p);document.cookie="toggled="+encodeURIComponent(e.join("+"))}function l(){var e=h.getCookie("toggled");if(e)for(var t=0,n=e.split("+");t=0&&e.followActiveLink()),"s"===t.key&&"input"!==t.target.tagName.toLowerCase()&&(t.preventDefault(),e.show())})},t.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},t.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},t.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},t.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t={};this.state.fuse.search(e).forEach(function(e){var n=e.item.module;(t[n]||(t[n]=[])).push(e)});var n=[];for(var o in t)!function(e){var o=t[e],r=0;o.forEach(function(e){r+=1/e.score}),n.push({module:e,totalScore:1/r,items:o})}(o);n.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:n})},t.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.top=0}function s(e,t){var n=o(e.className||"");n.indexOf(" "+t+" ")<0&&(e.className=r(n+" "+t))}function a(e,t){var n=o(e.className||"");n=n.replace(" "+t+" "," "),e.className=r(n)}function l(e,t,n,o){return null==o&&(o=!i(e,t)),o?(a(e,n),s(e,t)):(a(e,t),s(e,n)),o}function c(e){var t=document.getElementById("page-menu");if(t&&t.firstChild){var n=t.firstChild.cloneNode(!1);n.innerHTML=e,t.appendChild(n)}}function u(){return Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(e){return-1!=e.rel.indexOf("style")&&e.title})}function h(){var e=u(),t="";e.forEach(function(e){t+="
  • "+e.title+"
  • "}),e.length>1&&c("")}function d(e){for(var t=u(),n=null,o=0;on)return i(e,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},function(e,t,n){"use strict";var o=n(0),r=function e(t,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i=t&&n.push([o,r]),o=-1)}return e[i-1]&&i-o>=t&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(o,"\\$&").replace(n,"|")),i=e.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=E;P-=1){var R=P-1,U=n[e.charAt(R)];if(U&&(b[R]=1),j[P]=(j[P+1]<<1|1)&U,0!==I&&(j[P]|=(L[P+1]|L[P])<<1|1|L[P+1]),j[P]&N&&(C=o(t,{errors:I,currentLocation:R,expectedLocation:g,distance:c}))<=y){if(y=C,(_=R)<=g)break;E=Math.max(1,2*g-_)}}if(o(t,{errors:I+1,currentLocation:g,expectedLocation:g,distance:c})>y)break;L=j}return{isMatch:_>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(u,p),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,h=t.fullSearcher,d=void 0===h?[]:h,p=t.resultMap,f=void 0===p?{}:p,v=t.results,g=void 0===v?[]:v;if(void 0!==i&&null!==i){var m=!1,y=-1,_=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=d.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],w=0;w-1&&(E=(E+y)/2),this._log("Score average:",E);var T=!this.options.tokenize||!this.options.matchAllTokens||_>=u.length;if(this._log("\nCheck Matches: "+T),(m||k.isMatch)&&T){var j=f[l];j?j.output.push({key:n,arrayIndex:r,value:i,score:E,matchedIndices:k.matchedIndices}):(f[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:E,matchedIndices:k.matchedIndices}]},g.push(f[l]))}}else if(a(i))for(var P=0,R=i.length;P-1&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===O?a=[r]:a.push(r),o=i;var l=new e;return l.nodeName=t,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==j.push(e)&&(I.debounceRendering||E)(i)}function i(){var e,t=j;for(j=[];e=t.pop();)e.__d&&L(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===T.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,p,s):e.removeEventListener(t,p,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)d(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function d(e,t,n){try{e[t]=n}catch(e){}}function p(e){return this.__l[e.type](I.event&&I.event(e)||e)}function f(){for(var e;e=P.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function v(e,t,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=e&&!("__preactattr_"in e));var s=g(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||f()),s}function g(e,t,n,o,r){var i=e,s=U;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0))),i.__preactattr_=!0,i;var l=t.nodeName;if("function"==typeof l)return C(e,t,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!e||!a(e,l))&&(i=c(l,U),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0)}var u=i.firstChild,h=i.__preactattr_,d=t.children;if(null==h){h=i.__preactattr_={};for(var p=i.attributes,f=p.length;f--;)h[p[f].name]=p[f].value}return!D&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&m(i,d,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,t.attributes,h),U=s,i}function m(e,t,n,o,r){var i,a,l,c,h,d=e.childNodes,p=[],f={},v=0,m=0,_=d.length,k=0,b=t?t.length:0;if(0!==_)for(L=0;L<_;L++){var x=d[L],w=x.__preactattr_;null!=(S=b&&w?x._component?x._component.__k:w.key:null)?(v++,f[S]=x):(w||(void 0!==x.splitText?!r||x.nodeValue.trim():r))&&(p[k++]=x)}if(0!==b)for(L=0;L2?[].slice.call(arguments,2):e.children)},Component:N,render:function(e,t,n){return v(n,e,{},!1,t,!1)},rerender:i,options:I};void 0!==t?t.exports=F:self.preact=F}()},{}]},{},[3]); +//# sourceMappingURL=haddock-bundle.min.js.map diff --git a/docs/orville-postgresql-legacy-docs/hslogo-16.png b/docs/orville-postgresql-legacy-docs/hslogo-16.png new file mode 100644 index 0000000000000000000000000000000000000000..0ff8579fbd897417b0d6dad6e920f8882138a7c0 GIT binary patch literal 1684 zcmV;F25b3=P)4Tx0C)j~RL^S@K@|QrZmG~B2wH0nvUrdpNm;9CMbtL^5n^i$+aIn^?(HA4aZWV5ov6ELTdbo0FI&wK{O>*+w4vx20?>!`FrQsdJlnHR>OPy zcd~b_n$otK2Za4V;76L-DzNVtaSB-y0*E}{p()372;bw_^6ZZ}PI-92wGS&j#91PI zKs7DSe@(bk%_Y-7gGe}(^>I=@oY#w#*Bu9GZf3^F5WP>3rn}7Ut74&?PWBFvy`A)a zPP5)V!Xd&78LdA?xQ(9mjMYElVd13a#D+Z_7&Y|xU=_C-srWU*6kiZcC!$nw*)9$7 zn6CX+@=AhmkT}X@VSsa5NKe;HZuq)~1$`#h6R+ZTR#D-3j}vF!)ZOnz+5)dI4jl{{ z44Mr{P!L4~VVJN`K!!XTF*LGrKO?IK8z<8w`3e3jI8lUGNUta*C8 zn(P`s>{pjD=7Kek#B;Fw@hxAK%$F&Q6vg9J^Xf~4by_hu-=A!MJ3Znq&n~srbFGPs zH&&aMXZ>nO`|hf|ljc?VPhR!${AbO?W8x_>CU%PFA&Hm8F7cAsOREdwU~R_;ot1_u z(ruCYB-LPGn!NQdT|ZlRy+(fw^-+`=%+gee_kY4FWHg<*4sZI8+sFJD270UUORdLHO0nA4V) z%{fwsET5CQ>B?eK%uw4yQc~9?*JVo2}ze(;aRcp*ceL#HUJSllrgm5wQKR zQu+C;QrUh^8rFfA`ftFz{YAidi-`aL010qNS#tmY4c7nw4c7reD4Tcy00T@(L_t(I z5sj2vNEA^R$7gqDc6T=2^@fUA2(c`MltuL5<|KW>RWz$&YbU@|M|{$E*8Tu-Ux!w z1Y*Dr&Ubfr&v-nZaaB{3ilRumrjPmk{sZvQEWlW+{o~IH|8)=s6c#X9S5s5d%J z4@)&QH5|xQY-)^L1n0pTRu0Lx9`08YTjTwn^6 z0;b1+aQ@)n;Em$q;=7BBi)v0zj&o^g>0Whp^_^5IbxIUP8C@y9;R?*Ouu}rmfxbU= zwtWVNke-m!=`7bYEhWpcI5#)9qp`8E0lr6IQ)ARL3Ui}Af@grj8aN1=r>Cb+prlzO zNfJs*N_tUm2ZL%5* zPmL2??da$TR904gL(VDAQ-Fv_Dk}Pdw*4T(%*f4MKLRg=4ekMjhe2mW zMFsBwg%ftWT}0kxRaIk1k7qJ8*#cKB;Ft{i`zVIs-Nqge;!!Ld7#O&Qqu7e0sJmP) z$MW*>L$vSB&dxp@iA3U9fo)-7!Czlr{|o7Hv{1oyg3xsu%gn@(b1>$;SM-ZaQ`HV=V0s;lr%d8bd;xY zGwNvm3=Iu=tyXIgtJnf@A(2S@M140N ew{UA~tMxaJq;$xaSSi*30000orville-postgresql-legacy-0.9.0.1: ORM

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/meta.json b/docs/orville-postgresql-legacy-docs/meta.json new file mode 100644 index 0000000..a655a0f --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/meta.json @@ -0,0 +1 @@ +{"haddock_version":"2.22.0","quickjump_version":1} \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/minus.gif b/docs/orville-postgresql-legacy-docs/minus.gif new file mode 100644 index 0000000000000000000000000000000000000000..1deac2fe1a42e35b994f1b855488f392c50f6a89 GIT binary patch literal 56 zcmZ?wbhEHb summary { + list-style-image: url(minus.gif); +} + +pre { + padding: 0.25em; + margin: 0.8em 0; + background: rgb(229,237,244); + overflow: auto; + border-bottom: 0.25em solid white; + /* white border adds some space below the box to compensate + for visual extra space that paragraphs have between baseline + and the bounding box */ +} + +.src { + background: #f0f0f0; + padding: 0.2em 0.5em; +} + +.keyword { font-weight: normal; } +.def { font-weight: bold; } + +@media print { + #footer { display: none; } +} + +/* @end */ + +/* @group Page Structure */ + +#content { + margin: 0 auto; + padding: 0 2em 6em; +} + +#package-header { + background: rgb(41,56,69); + border-top: 5px solid rgb(78,98,114); + color: #ddd; + padding: 0.2em; + position: relative; + text-align: left; +} + +#package-header .caption { + background: url(hslogo-16.png) no-repeat 0em; + color: white; + margin: 0 2em; + font-weight: normal; + font-style: normal; + padding-left: 2em; +} + +#package-header a:link, #package-header a:visited { color: white; } +#package-header a:hover { background: rgb(78,98,114); } + +#module-header .caption { + color: rgb(78,98,114); + font-weight: bold; + border-bottom: 1px solid #ddd; +} + +table.info { + float: right; + padding: 0.5em 1em; + border: 1px solid #ddd; + color: rgb(78,98,114); + background-color: #fff; + max-width: 40%; + border-spacing: 0; + position: relative; + top: -0.5em; + margin: 0 0 0 2em; +} + +.info th { + padding: 0 1em 0 0; +} + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background: #374c5e; + margin: 0; + text-align: center; + right: 0; + padding: 0; + top: 1.25em; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 0; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + +#style-menu a { + width: 6em; + padding: 3px; + display: block; +} + +#footer { + background: #ddd; + border-top: 1px solid #aaa; + padding: 0.5em 0; + color: #666; + text-align: center; + position: absolute; + bottom: 0; + width: 100%; + height: 3em; +} + +/* @end */ + +/* @group Front Matter */ + +#table-of-contents { + float: right; + clear: right; + background: #faf9dc; + border: 1px solid #d8d7ad; + padding: 0.5em 1em; + max-width: 20em; + margin: 0.5em 0 1em 1em; +} + +#table-of-contents .caption { + text-align: center; + margin: 0; +} + +#table-of-contents ul { + list-style: none; + margin: 0; +} + +#table-of-contents ul ul { + margin-left: 2em; +} + +#description .caption { + display: none; +} + +#synopsis { + display: block; + position: fixed; + right: 0; + height: 80%; + top: 10%; + padding: 0; + max-width: 75%; + /* Ensure that synopsis covers everything (including MathJAX markup) */ + z-index: 1; +} + +#synopsis summary { + display: block; + float: left; + width: 29px; + color: rgba(255,255,255,0); + height: 110px; + margin: 0; + font-size: 1px; + padding: 0; + background: url(synopsis.png) no-repeat 0px -8px; +} + +#synopsis details[open] > summary { + background: url(synopsis.png) no-repeat -64px -8px; +} + +#synopsis ul { + height: 100%; + overflow: auto; + padding: 0.5em; + margin: 0; +} + +#synopsis ul ul { + overflow: hidden; +} + +#synopsis ul, +#synopsis ul li.src { + background-color: #faf9dc; + white-space: nowrap; + list-style: none; + margin-left: 0; +} + +/* @end */ + +/* @group Main Content */ + +#interface div.top { margin: 2em 0; } +#interface h1 + div.top, +#interface h2 + div.top, +#interface h3 + div.top, +#interface h4 + div.top, +#interface h5 + div.top { + margin-top: 1em; +} +#interface .src .selflink, +#interface .src .link { + float: right; + color: #919191; + background: #f0f0f0; + padding: 0 0.5em 0.2em; + margin: 0 -0.5em 0 0; + -moz-user-select: none; +} +#interface .src .selflink { + border-left: 1px solid #919191; + margin: 0 -0.5em 0 0.5em; +} + +#interface span.fixity { + color: #919191; + border-left: 1px solid #919191; + padding: 0.2em 0.5em 0.2em 0.5em; + margin: 0 -1em 0 1em; +} + +#interface span.rightedge { + border-left: 1px solid #919191; + padding: 0.2em 0 0.2em 0; + margin: 0 0 0 1em; +} + +#interface table { border-spacing: 2px; } +#interface td { + vertical-align: top; + padding-left: 0.5em; +} + +#interface td.doc p { + margin: 0; +} +#interface td.doc p + p { + margin-top: 0.8em; +} + +.doc table { + border-collapse: collapse; + border-spacing: 0px; +} + +.doc th, +.doc td { + padding: 5px; + border: 1px solid #ddd; +} + +.doc th { + background-color: #f0f0f0; +} + +.clearfix:after { + clear: both; + content: " "; + display: block; + height: 0; + visibility: hidden; +} + +.subs ul { + list-style: none; + display: table; + margin: 0; +} + +.subs ul li { + display: table-row; +} + +.subs ul li dfn { + display: table-cell; + font-style: normal; + font-weight: bold; + margin: 1px 0; + white-space: nowrap; +} + +.subs ul li > .doc { + display: table-cell; + padding-left: 0.5em; + margin-bottom: 0.5em; +} + +.subs ul li > .doc p { + margin: 0; +} + +/* Render short-style data instances */ +.inst ul { + height: 100%; + padding: 0.5em; + margin: 0; +} + +.inst, .inst li { + list-style: none; + margin-left: 1em; +} + +/* Workaround for bug in Firefox (issue #384) */ +.inst-left { + float: left; +} + +.top p.src { + border-top: 1px solid #ccc; +} + +.subs, .doc { + /* use this selector for one level of indent */ + padding-left: 2em; +} + +.warning { + color: red; +} + +.arguments { + margin-top: -0.4em; +} +.arguments .caption { + display: none; +} + +.fields { padding-left: 1em; } + +.fields .caption { display: none; } + +.fields p { margin: 0 0; } + +/* this seems bulky to me +.methods, .constructors { + background: #f8f8f8; + border: 1px solid #eee; +} +*/ + +/* @end */ + +/* @group Auxillary Pages */ + + +.extension-list { + list-style-type: none; + margin-left: 0; +} + +#mini { + margin: 0 auto; + padding: 0 1em 1em; +} + +#mini > * { + font-size: 93%; /* 12pt */ +} + +#mini #module-list .caption, +#mini #module-header .caption { + font-size: 125%; /* 15pt */ +} + +#mini #interface h1, +#mini #interface h2, +#mini #interface h3, +#mini #interface h4 { + font-size: 109%; /* 13pt */ + margin: 1em 0 0; +} + +#mini #interface .top, +#mini #interface .src { + margin: 0; +} + +#mini #module-list ul { + list-style: none; + margin: 0; +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; + text-align: center; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + font-weight: bold; +} + +#index .caption, +#module-list .caption { font-size: 131%; /* 17pt */ } + +#index table { + margin-left: 2em; +} + +#index .src { + font-weight: bold; +} +#index .alt { + font-size: 77%; /* 10pt */ + font-style: italic; + padding-left: 2em; +} + +#index td + td { + padding-left: 1em; +} + +#module-list ul { + list-style: none; + margin: 0 0 0 2em; +} + +#module-list li { + clear: right; +} + +#module-list span.collapser, +#module-list span.expander { + background-position: 0 0.3em; +} + +#module-list .package { + float: right; +} + +:target { + background-color: #ffff00; +} + +/* @end */ diff --git a/docs/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt b/docs/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt new file mode 100644 index 0000000..210ab24 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt @@ -0,0 +1,2005 @@ +-- Hoogle documentation, generated by Haddock +-- See Hoogle, http://www.haskell.org/hoogle/ + + +-- | ORM +-- +-- ORM library for PostgreSQL +@package orville-postgresql-legacy +@version 0.9.0.1 + + +module Database.Orville.PostgreSQL.Connection + +-- | createConnectionPool allocates a pool of connections to a +-- PosgreSQL server. The returned pool can be used as the endpoint to +-- newOrvilleEnv to construct. +createConnectionPool :: Int -> NominalDiffTime -> Int -> String -> IO (Pool Connection) +data Pool a +data Connection + + +module Database.Orville.PostgreSQL.Expr +data RawExpr +rawSql :: String -> RawExpr +class GenerateSql expr +generateSql :: GenerateSql expr => expr -> RawExpr +data Expr a +rawSqlExpr :: String -> Expr a +expr :: a -> Expr a +type NameExpr = Expr NameForm +data NameForm +unescapedName :: NameForm -> String +type SelectExpr = Expr SelectForm +data SelectForm +SelectForm :: NameForm -> Maybe NameForm -> SelectForm +[selectFormColumn] :: SelectForm -> NameForm +[selectFormAlias] :: SelectForm -> Maybe NameForm +selectColumn :: NameForm -> SelectForm +qualified :: QualifySql form => form -> String -> form +aliased :: SelectForm -> NameForm -> SelectForm + +module Database.Orville.PostgreSQL.Plan.Explanation +data Explanation +noExplanation :: Explanation +explainStep :: String -> Explanation +explanationSteps :: Explanation -> [String] +instance GHC.Base.Semigroup Database.Orville.PostgreSQL.Plan.Explanation.Explanation +instance GHC.Base.Monoid Database.Orville.PostgreSQL.Plan.Explanation.Explanation + +module Database.Orville.PostgreSQL.Plan.Many + +-- | A 'Many k a' represents a group of values keyed by list of parameters +-- and is used to return the results of executing an Orville Plan with a +-- list of input parameters. If you need to find the result of the query +-- associated with a particular input parameter, you can use +-- lookup to find it. If you don't care about the association with +-- particular inputs, you can simply use elems to get a list of +-- all the results. +data Many k a + +-- | NotAKey is returned from various Many related functions +-- when presented with an input parameter that was not one of the +-- original inputs that the Many was constructed with. +data NotAKey +NotAKey :: NotAKey + +-- | fromKeys constructs a Many value from a list of keys and +-- a function that maps them to their values. The order and duplication +-- of keys in the list will be preserved by the Many type in the +-- relevant functions. The mapping function provided should be a total +-- function -- i.e. it should not produce a runtime error. If it is not +-- possible to map every k (even those not in the input list +-- provided to fromKeys), the values should be wrapped in an +-- appropriate type such as Maybe so that an empty or default +-- value can be returned. +fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a + +-- | lookup returns the value for the given parameter. If the given +-- k is not one of the original input values that the +-- Many was constructed with, the mapping function given at the +-- contructor will determine what value to return. Often this will be +-- whatever a reasonable empty or default value for the type a +-- is. +lookup :: k -> Many k a -> Either NotAKey a + +-- | keys fetches the list of keys from a Many. Note that is +-- a list and not a set. Many preserves the order and duplication +-- of any key values that were in the key list at the time of +-- construction. +keys :: Many k a -> [k] + +-- | elems returns all the values that correspond the keys of the +-- Many. The values will be returned in the same order that the +-- keys were present at the time of creation, though if you truly care +-- about this it's probably better to use lookup to make that +-- correspondence explicit. +elems :: Many k a -> [a] + +-- | map calls a function on all the values found in a Many +-- collection. +map :: (a -> b) -> Many k a -> Many k b + +-- | toMap converts the Many into a Map value. If +-- all you wanted to do was find the value for a specific key, you should +-- probably use lookup instead. +toMap :: Ord k => Many k a -> Map k a + +-- | apply allows you to apply many functions to many values. The +-- function associated with each parameter is applied to the value +-- associated with the same paremeter. +-- +-- (If you're looking for pure or an Applicative instance +-- for Many, this is as good as it gets. Many cannot be an +-- Applicative because there is no correct implementation of +-- pure that we can reasonably provide). +apply :: Many param (a -> b) -> Many param a -> Many param b + +-- | compose uses the values of a Many value as keys to a +-- second Many to create a Many mapping from the original +-- keys to the final values. +compose :: Many b c -> Many a b -> Many a c +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Plan.Many.Many k) + + +module Database.Orville.PostgreSQL.Select +data Select row +selectQuery :: FromSql row -> FromClause -> SelectOptions -> Select row +selectQueryTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Select readEntity +selectQueryRows :: [SelectExpr] -> FromClause -> SelectOptions -> Select [(String, SqlValue)] +selectQueryRaw :: FromSql row -> String -> [SqlValue] -> Select row +selectQueryRawRows :: String -> [SqlValue] -> Select [(String, SqlValue)] +selectQueryColumns :: [SelectExpr] -> FromSql row -> FromClause -> SelectOptions -> Select row +selectField :: FieldDefinition nulability a -> SelectForm +data FromClause +fromClauseRaw :: String -> FromClause +fromClauseTableName :: String -> FromClause +fromClauseTable :: TableDefinition readEntity writeEntity key -> FromClause +runSelect :: MonadOrville conn m => Select row -> m [row] + + +module Database.Orville.PostgreSQL.Raw +selectSql :: MonadOrville conn m => String -> [SqlValue] -> FromSql result -> m [result] +selectSqlRows :: MonadOrville conn m => String -> [SqlValue] -> m ResultSet +decodeSqlRows :: MonadOrville conn m => FromSql result -> ResultSet -> m [result] +type ResultSet = [[(String, SqlValue)]] +updateSql :: MonadOrville conn m => String -> [SqlValue] -> m Integer +withConnection :: MonadOrville conn m => (conn -> m a) -> m a + +-- | Migration Guide: withTransaction retains the same name. +withTransaction :: MonadOrville conn m => m a -> m a + +-- | Migration Guide: withCachedConnection has been renamed to +-- withConnection_ +-- +-- Runs an action with a cached connection. Without using this, or +-- wrapping calls in a transaction using withTransaction, +-- successive calls to functions like insertRecord and +-- updateRecord are *not* guaranteed to occur on the same +-- connection. +withCachedConnection :: MonadOrville conn m => m a -> m a + + +module Database.Orville.PostgreSQL.Conduit + +-- | selectConduit provides a way to stream the results of a +-- Select query from the database one by one using the conduit +-- library. You can fuse the conduit built by this function with +-- your own conduit pipeline to handle rows individually in whatever +-- fashion you need (e.g. turning them into rows of CSV). This is useful +-- if you want to be able to process many rows one by one. You can +-- aggregate the results however you require as part of the conduit +-- processing and then use runConduit (or runConduitRes) +-- from the conduit library to execute the processing pipeline. +-- Alternatively, your web server (wai, servant, etc) +-- may provide support for converting a conduit into a streaming HTTP +-- response. +-- +-- Beware: this function must load all the results into memory before +-- streaming can begin. For why, see +-- https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html. +-- If memory use is a concern, try streamPages instead. +selectConduit :: (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m) => Select row -> ConduitT () row m () + +-- | Build a conduit source that is fed by querying one page worth of +-- results at a time. When the last row of the last page is consumed, the +-- stream ends. +streamPages :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> ConduitT () readEnt m () + + +-- | Migration Guide: Although not all exports are identical, most of the +-- items in this module can now be imported from +-- Orville.PostgreSQL. +-- +-- Please note that the new LibPQ-based version of orville represents a +-- complete re-write of Orville from the ground up. As such many of the +-- APIs have been re-thought with the goal of providing stability and +-- better experience long term. +-- +-- Major changes: +-- +--
      +--
    • The library no longer allows the connection type to vary. It is +-- intended only to be used with PostgreSQL. Thus MonadOrville and +-- other types that used to have a conn type parameter no longer +-- have that parameter.
    • +--
    • OrvilleT has been removed in favor of simply using +-- ReaderT. For trivial cases (i.e. ReaderT over +-- IO) a pre-packaged Orville monad is provided.
    • +--
    • In TableDefinition, the order of the type parameters has +-- changed from TableDefinition readEnity writeEntity key to +-- TableDefinition key writeEntity readEntity. This make it more +-- consistent with the order of these arguments in other types. +-- TableParams has been removed in favor of building a basic table +-- definition with the require parameters first and adding or setting +-- other optional items after initial construction.
    • +--
    • RelationalMap has been replaced by SqlMarshaller. +-- Many functions have been renamed, but most functions have a direct or +-- nearly direct translation from the old ones. See the docs on the +-- individual functions such as attrField to see what has +-- changed.
    • +--
    • The auto-migration system is significantly improved. Standard +-- indexes no longer need to be given explicit names. Indexes and +-- constraints are now attached to TableDefinition rather than +-- being their own schema items. Indexes and constraints are no longer +-- dropped explicitly -- they are dropped automatically by Orville when +-- they have been removed from the table definiton.
    • +--
    • A number of places that previously accepted [] now +-- require NonEmpty instead. This is done in places where an +-- empty list would not be valid SQL. For examples of this change see +-- insertRecordMany and updateFields.
    • +--
    • whereAnd and whereOr (which took lists) have been +-- replaced with binary boolean logic functions andExpr and +-- orExpr. These functions also have operator aliases +-- ((.&&), (.||)).
    • +--
    +-- +-- The following items exported from this module have migration guide +-- notes available in their documentation: +-- +-- +module Database.Orville.PostgreSQL.Core + +-- | Migration Guide: TableDefinition can now be imported from +-- PostgreSQL. The order of the type parameters has changed from +-- TableDefinition readEnity writeEntity key to +-- TableDefinition key writeEntity readEntity. In the new +-- Orville tables without primary keys are supported, so the key +-- parameter must now be instantiated as either HasKey keyType +-- or NoKey. +-- +-- A TableDefinition is the center of the Orville universe. A +-- TableDefinition defines the structure of a table in the +-- database and associates it with a Haskell datatype, usually a Haskell +-- record type. The TableDefinition must specify how the Haskell +-- type is converted to and from the database schema, as as well as +-- provide same basic utility functions required by Orville for +-- interacting with the Haskell datatype. +-- +-- Usually you will use TableParams to construct a +-- TableDefinition in a more concise way. This type is provided as +-- an escape hatch for any situations where TableParams is too +-- restrictive for the sql mapping required by a type. +data TableDefinition readEntity writeEntity key +TableDefinition :: String -> [SomeField] -> [String] -> PrimaryKey key -> FromSql readEntity -> ToSql writeEntity () -> (readEntity -> key) -> TableComments () -> TableDefinition readEntity writeEntity key + +-- | The name of the table in the database. +[tableName] :: TableDefinition readEntity writeEntity key -> String + +-- | A list of field definitions defining the table structure +[tableFields] :: TableDefinition readEntity writeEntity key -> [SomeField] + +-- | A list of any columns that may be deleted from the table by Orville. +-- (Orville will never delete a column without being told it is safe) +[tableSafeToDelete] :: TableDefinition readEntity writeEntity key -> [String] + +-- | The statically typed field definition that is the primary key. +-- Currently this field must still by listed in tableFields +[tablePrimaryKey] :: TableDefinition readEntity writeEntity key -> PrimaryKey key + +-- | A definition of how to convert the haskell type from a sql row +[tableFromSql] :: TableDefinition readEntity writeEntity key -> FromSql readEntity + +-- | A function to set the key on the entity +[tableToSql] :: TableDefinition readEntity writeEntity key -> ToSql writeEntity () + +-- | A function to get the key on the entity +[tableGetKey] :: TableDefinition readEntity writeEntity key -> readEntity -> key + +-- | Any comments that might be interesting for developers to see. These +-- comments will get printed in the log if there is an erro while +-- attempting to migrate the table. +[tableComments] :: TableDefinition readEntity writeEntity key -> TableComments () +data PrimaryKey key + +-- | primaryKeyIn builds a WhereCondition that will match all +-- rows where the primary key is equal to one of the given values. For +-- single-field primary keys this is equivalent to whereIn, but +-- primaryKeyIn also handles composite primary keys. +primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition + +-- | primaryKeyEquals builds a WhereCondition that will match +-- the row where the primary key is equal to the given value. For +-- single-field primary keys this is equivalent to .==, but +-- 'primaryKeyEquals also handles composite primary keys. +primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition + +-- | primaryKeyDescription builds a user-readable representation of +-- the primary key for use in error messages and such. It is a +-- comma-delimited list of the names of the fields that make up the +-- primary key. +primaryKeyDescription :: PrimaryKey key -> String + +-- | primaryKeyToSql converts a Haskell value for a primary key into +-- the (possibly multiple) sql values that represent the primary key in +-- the database. +primaryKeyToSql :: PrimaryKey key -> key -> [SqlValue] + +-- | primaryKey constructs a single-field primary key from the +-- FieldDefinition that corresponds to the primary key's column. +-- This is generally used while building a TableDefinition. +primaryKey :: FieldDefinition NotNull key -> PrimaryKey key + +-- | compositePrimaryKey constructs a multi-field primary key from +-- the given parts, each of which corresponds to one field in the primary +-- key. You should use this while building a TableDefinition for +-- a table that you want to have a multi-column primary key. See +-- primaryKeyPart for how to build the parts to be passed as +-- parameters. Note: there is no special significance to the first +-- argument other than requiring that there is at least one field in the +-- primary key. +compositePrimaryKey :: PrimaryKeyPart key -> [PrimaryKeyPart key] -> PrimaryKey key + +-- | primaryKeyPart builds on section of a composite primary key +-- based on the field definition that corresponds to that column of the +-- primary key. The function given is used to decompose the Haskell value +-- for the composite key into the individual parts so they can be +-- converted to sql for things like building WhereCondition +primaryKeyPart :: (key -> part) -> FieldDefinition NotNull part -> PrimaryKeyPart key + +-- | Migration Guide: This function has in the new orville to take the +-- table name, primary key definition and a SqlMarshaller +-- (formerly RelationalMap). Other options such as constraints, +-- indexes, and columns to drop can be added to the +-- TableDefinition after the initial instantiation. The +-- TableParams type has been dropped for the new orville. +-- +-- mkTableDefinition converts a TableParams to +-- TableDefinition. Usually this is used directly on a record +-- literal of the TableParams. For example: +-- +--
    +--   data Foo key = Foo key { fooId :: Record }
    +--   myTable :: TableDefinition Foo
    +--   myTable = mkTableDefinition $
    +--     TableParams
    +--       { tblName = "foo"
    +--       , tblMapper = User $ attrField fooId idField
    +--       , tableSafeToDelete = []
    +--       , tblSetKey = key foo -> foo { fooId = key }
    +--       , tblGetKey = fooId
    +--       , tblComments = []
    +--       }
    +--   
    +mkTableDefinition :: TableParams readEntity writeEntity key -> TableDefinition readEntity writeEntity key + +-- | SqlType defines the mapping of a Haskell type (a) to a SQL +-- column type in the database. This includes both how to convert the +-- type to and from the raw values read from the database as well as the +-- schema information required to create and migrate columns using the +-- type. +data SqlType a +SqlType :: String -> Maybe String -> SqlTypeId -> Maybe Int -> (a -> SqlValue) -> (SqlValue -> Either RowDataErrorReason a) -> SqlType a + +-- | The raw SQL DDL to use when creating/migrating columns of this type +-- (not including any NULL or NOT NULL declarations) +[sqlTypeDDL] :: SqlType a -> String + +-- | The raw SQL DDL to use when creating/migrating columns with foreign +-- keys to this type. This is used foreignRefType to build a new SqlType +-- when making foreign key fields +[sqlTypeReferenceDDL] :: SqlType a -> Maybe String + +-- | sqlTypeId will be compared to the colType field found +-- in the SqlColDesc return by describeTable when +-- determining whether a column type change is required when migrating +-- the database. +[sqlTypeId] :: SqlType a -> SqlTypeId + +-- | 'sqlTypeSqlSize will be compared to the colSize field found +-- in the SqlColDesc return by describeTable when +-- determining whether a column type change is required when migrating +-- the database. +[sqlTypeSqlSize] :: SqlType a -> Maybe Int + +-- | A function for converting Haskell values of this type into values to +-- be stored in the database. +[sqlTypeToSql] :: SqlType a -> a -> SqlValue + +-- | A function for converting values of this are stored in the database +-- into Haskell values. This function should return 'Left +-- RowDataErrorReason' to indicate an error if the conversion is +-- impossible. Otherwise it should return Right the corresponding +-- a value. +[sqlTypeFromSql] :: SqlType a -> SqlValue -> Either RowDataErrorReason a + +-- | serial defines a 32-bit auto-incrementing column type. This +-- corresponds to the SERIAL type in PostgreSQL. +serial :: SqlType Int32 + +-- | bigserial defines a 64-bit auto-incrementing column type. This +-- corresponds to the BIGSERIAL type in PostgresSQL. +bigserial :: SqlType Int64 + +-- | text defines a fixed length text field type. This corresponds +-- to a "CHAR(len)" type in SQL. +text :: Int -> SqlType Text + +-- | varText defines a variable text field type with a max length. +-- This corresponds to a "VARCHAR(len)" type in SQL. +varText :: Int -> SqlType Text + +-- | unboundedText defines a fixed length text field type. This +-- corresponds to a TEXT type in PostgreSQL. +unboundedText :: SqlType Text + +-- | integer defines a 32-bit integer type. This corresponds to the +-- INTEGER type in SQL. +integer :: SqlType Int32 + +-- | bigInteger defines a 64-bit integer type. This corresponds to +-- the BIGINT type in SQL. +bigInteger :: SqlType Int64 + +-- | double defines a floating point numeric type. This corresponds +-- to the "DOUBLE PRECISION" type in SQL. +double :: SqlType Double + +-- | boolean defines a True/False boolean type. This corresponds to +-- the BOOLEAN type in SQL. +boolean :: SqlType Bool + +-- | date defines a type representing a calendar date (without time +-- zone). It corresponds to the DATE type in SQL. +date :: SqlType Day + +-- | timestamp defines a type representing a particular point in +-- time (without time zone). It corresponds to the "TIMESTAMP with time +-- zone" type in SQL. +-- +-- Note: This is NOT a typo. The "TIMESTAMP with time zone" type in SQL +-- does not include any actual time zone information. For an excellent +-- explanation of the complexities involving this type, please see Chris +-- Clark's blog post about it: +-- http://blog.untrod.com/2016/08/actually-understanding-timezones-in-postgresql.html +timestamp :: SqlType UTCTime + +-- | textSearchVector defines a type for indexed text searching. It +-- corresponds to the TSVECTOR type in PostgreSQL. +textSearchVector :: SqlType Text + +-- | Migration Guide: convertSqlType retains the same name +-- +-- convertSqlType changes the Haskell type used by a +-- SqlType in the same manner as maybeConvertSqlType in +-- cases where an a can always be converted to a b. +convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b + +-- | Migration Guide: maybeConvertSqlType has been replaced with +-- tryConvertSqlType, which allows an error message to be +-- returned when conversion fails. +-- +-- maybeConvertSqlType changes the Haskell type used by a +-- SqlType without changing the column type that will be used in +-- the database schema. The functions given will be used to convert the +-- now Haskell type to and from the original type when reading and +-- writing values from the database. When reading an a value +-- from the database, the conversion function should produce +-- Nothing if the value cannot be successfully converted to a +-- b. +maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b + +-- | MigrationGuide: TableParams no longer exists. See the +-- migration guide for mkTableDefinition +-- +-- TableParams is the simplest way to make a +-- TableDefinition. You can use mkTableDefinition to make a +-- definition from the simplified params. Where TableDefinition +-- requires the tableFields, tableFromSql, and +-- tableToSql to all be defined separately and kept in sync, +-- TableParams provides a single tblMapper field that +-- specifies all three simultaneously and ensures they are consistent +-- with one another. +data TableParams readEntity writeEntity key +TableParams :: String -> RelationalMap writeEntity readEntity -> [String] -> PrimaryKey key -> (readEntity -> key) -> TableComments () -> TableParams readEntity writeEntity key + +-- | The name of the table in the database +[tblName] :: TableParams readEntity writeEntity key -> String + +-- | The relational mapping that defines how the Haskell entity type is +-- converted both to and from sql. The fields utilized in the mapping are +-- used to automatically build the list of FieldDefinitions that +-- define the structure of the table in the database. +[tblMapper] :: TableParams readEntity writeEntity key -> RelationalMap writeEntity readEntity + +-- | A list of any columns that may be deleted from the table by Orville. +-- (Orville will never delete a column without being told it is safe) +[tblSafeToDelete] :: TableParams readEntity writeEntity key -> [String] + +-- | A function to set the key on the entity +[tblPrimaryKey] :: TableParams readEntity writeEntity key -> PrimaryKey key + +-- | A function to get the key on the entity +[tblGetKey] :: TableParams readEntity writeEntity key -> readEntity -> key + +-- | Any comments that might be interesting for developers to see. These +-- comments will get printed in the log if there is an erro while +-- attempting to migrate the table. +[tblComments] :: TableParams readEntity writeEntity key -> TableComments () + +-- | Migration guide: This type has been replaced with the +-- SqlMarshaller type in the new orville. The interface is +-- similar, though the names of the functions have been updated in many +-- cases. See the migration guides for those functions to find their new +-- names. +data RelationalMap a b + +-- | Migration Guide: The fields in new orville's SqlMarshaller +-- are somewhat more sophisticated than those of a +-- RelationalMap. The fields function is no longer +-- offered with this simple interface as a result, but the +-- foldMarshallerFields function can be used in combination with +-- the collectFromField helper to collect the desired +-- information from each field. +fields :: RelationalMap a b -> [SomeField] + +-- | Migration Guide: mapAttr has been renamed to +-- marshallNested +mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c + +-- | Migration Guide: mapField has been removed, though its +-- functional equivalent is marshallReadOnlyField +mapField :: FieldDefinition nullability a -> RelationalMap a a + +-- | Migration Guide: attrField has been renamed to +-- marshallField +attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b + +-- | Migration Guide: maybeMapper has been renamed to +-- marshallMaybe +maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b) + +-- | Migration Guide: prefixMap has been renamed to +-- prefixMarshaller +prefixMap :: String -> RelationalMap a b -> RelationalMap a b + +-- | Migration Guide: partialMap has been renamed to +-- marshallPartial +partialMap :: RelationalMap a (Either String a) -> RelationalMap a a + +-- | Migration Guide: readOnlyMap has been renamed to +-- marshallReadOnly +readOnlyMap :: RelationalMap a b -> RelationalMap c b + +-- | Migration Guide: readOnlyField has been renamed to +-- marshallReadOnlyField +readOnlyField :: FieldDefinition nullability a -> RelationalMap b a + +-- | Migration Guide: OrvilleEnv has been renamed to +-- OrvilleState. It no longer has any type paremeters. The +-- connection type is fixed and cannot be changed. +-- +-- OrvilleEnv tracks all the environment information required for +-- an 'OrvilleT conn m' Monad to operate. Use newOrvilleEnv to +-- construct one. +data OrvilleEnv conn + +-- | Migration Guide: newOrvilleEnv has been renamed to +-- newOrvilleState. The new function requires a parameter to be +-- passed before the connection pool to specify the level of detail to be +-- used when Orville reports errors. +-- +-- newOrvilleEnv initialized an OrvilleEnv for service. The +-- connection pool provided will be used to obtain connections to the +-- database ase required. You can use the createConnectionPool +-- utility function to create a connection pool to a PosgreSQL server. +newOrvilleEnv :: Pool conn -> OrvilleEnv conn + +-- | Migration Guide: setStartTransactionSQL has been renamed to +-- setBeginTransactionExpr +setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn + +-- | Migration Guide: aroundRunningQuery has been renamed to +-- addSqlExecutionCallback +aroundRunningQuery :: (forall a. QueryType -> String -> IO a -> IO a) -> OrvilleEnv conn -> OrvilleEnv conn + +-- | Migration Guide: addTransactionCallBack retains the same name +addTransactionCallBack :: (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn +ormEnvPool :: OrvilleEnv conn -> Pool conn +data TransactionEvent +TransactionStart :: TransactionEvent +TransactionCommit :: TransactionEvent +TransactionRollback :: TransactionEvent + +-- | Migration Guide: OrvilleT has been removed. In its place you +-- can simply use a ReaderT OrvilleState. If you have another +-- ReaderT layer in your monad stack you can add the +-- OrvilleState to the reader context for that layer instead, +-- which is more efficient than having multiple ReaderT layers. +-- If you have a simple case of OrvilleT conn IO the new Orville +-- offers a simpler Orville monad (not a transformer) to get you +-- started. +data OrvilleT conn m a +unOrvilleT :: OrvilleT conn m a -> ReaderT (OrvilleEnv conn) m a +data SqlValue + +-- | Migration Guide: HasOrvilleContext has been renamed to +-- HasOrvilleState. getOrvilleEnv and +-- localOrvilleEnv have been renamed to askOrvilleState +-- and localOrvilleState. +-- +-- HasOrvilleContext defines the operations that must be available +-- in your own monad for managing the connection pool that Orville +-- functions will use to access the database and manage transaction +-- state. In most cases you can include OrvilleT in your Monad +-- stack and then automatically derive an instance of +-- HasOrvilleContext. +-- +-- You could also provide your own implementations of these functions +-- instead of using OrvilleT, if that is the easiest approach for +-- your Monad. +class IConnection conn => HasOrvilleContext conn m | m -> conn + +-- | getOrvilleEnv fetches the Orville environment from the Monad context. +-- Analogous to ask from the Reader monad. +getOrvilleEnv :: HasOrvilleContext conn m => m (OrvilleEnv conn) +localOrvilleEnv :: HasOrvilleContext conn m => (OrvilleEnv conn -> OrvilleEnv conn) -> m a -> m a + +-- | Migration Guide: MonadOrville retains the same name, but the +-- conn parameter has been removed. MonadFail and +-- MonadThrow have been removed as superclass constraints. +-- +-- MonadOrville does not have any methods of its own. Instead it +-- brings all the typeclass constraints required by Orville functions +-- that need to access the database into a single typeclass. In some +-- cases you can include OrvilleT in your Monad stack and then +-- automatically derive an instance of MonadOrville. However, more +-- likely you are using some third party monad somewhere in your stack +-- that does not han a MonadOrvilleControl instance. In this case +-- you won't be able to derive MonadOrville, but providing a +-- simple empty instance will do: +-- +--
    +--   instance O.MonadOrville Postgres.Connection MyMonad
    +--   
    +--   
    +class (Monad m, MonadIO m, HasOrvilleContext conn m, MonadThrow m, MonadOrvilleControl m, MonadFail m) => MonadOrville conn m + +-- | Migration Guide: runOrville now operates on the concrete +-- Orville monad becase OrvilleT has been removed. +-- Assuming you are replacing usages of OrvilleT with +-- ReaderT you will want to replace usages of +-- runOrville with runReaderT. +runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a + +-- | Migration Guide: mapOrvilleT has been removed because +-- OrvilleT has been removed. If you're replacing +-- OrvilleT with ReaderT then mapOrvilleT +-- should be replaced with mapReaderT. +mapOrvilleT :: Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b + +-- | Migration Guide: MonadOrvilleControl retains the same name. +-- The liftFinally member has been removed. There are new +-- liftCatch and liftMask members that must be +-- implemented, however. Instances of the new +-- MonadOrvilleControl are provided for IO and +-- ReaderT. Helper functions for implmenting the members via +-- UnliftIO can be found in +-- Orville.PostgreSQL.UnliftIO. +-- +-- MonadOrvilleControl provides an interface for the kinds of IO +-- operations that Orville functions need to lift into the Monad +-- providing the MonadOrville instance. This typeclass allows +-- users to provide their own lifting strategies in case the Monad stack +-- in question has special needs. If you are only using ReaderT +-- and OrvilleT layers in your monad stack, you can probably +-- implement this for your own Monad wrapper type using the provided +-- default functions and providing functions to wrap and unwrapper your +-- Monad layer: +-- +--
    +--   instance MonadOrvilleControl MyMonad where
    +--     liftWithConnection = defaultLiftWithConnection wrapMyMonad unWrapMyMonad
    +--     liftFinally = defaultLiftFinally wrapMyMonad unWrapMyMonad
    +--   
    +--   
    +-- +-- If you are using transformers in your monad stack beyond +-- ReaderT, they probably don't provide MonadOrvilleControl +-- instances (e.g. third party libraries). In this case, see +-- MonadUnliftIO for more help. If you're still stuck (because +-- your library doesn't support MonadTransControl), try +-- MonadBaseControl instead. If you're *still* stuck after that, +-- please file an issue on Github at +-- https://github.com/flipstone/orville so we can can help out! +class MonadOrvilleControl m +liftWithConnection :: MonadOrvilleControl m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b +liftFinally :: MonadOrvilleControl m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c + +-- | Migration Guide: defaultLiftWithConnection has been removed. +-- In its place you can use either the ReaderT instance of +-- MonadOrvilleControl or the helpers in +-- Orville.PostgreSQL.UnliftIO. +-- +-- defaultLiftWithConnection provides a simple definition of +-- liftWithConnection for MonadOrvilleControl instances +-- when the Monad in question is a wrapper around a type that already +-- implements MonadOrvilleControl +defaultLiftWithConnection :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a. (conn -> IO a) -> IO a) -> (conn -> n b) -> n b + +-- | Migration Guide: defaultLiftWithConnection has been removed +-- (along with liftFinally) +-- +-- defaultLiftFinally provides a simple definition of +-- liftWithConnection for MonadOrvilleControl instances +-- when the Monad in question is a wrapper around a type that already +-- implements MonadOrvilleControl +defaultLiftFinally :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a b. IO a -> IO b -> IO a) -> n c -> n d -> n c +data QueryType +SelectQuery :: QueryType +InsertQuery :: QueryType +UpdateQuery :: QueryType +DeleteQuery :: QueryType +DDLQuery :: QueryType + +-- | Migration Guide: withCachedConnection has been renamed to +-- withConnection_ +-- +-- Runs an action with a cached connection. Without using this, or +-- wrapping calls in a transaction using withTransaction, +-- successive calls to functions like insertRecord and +-- updateRecord are *not* guaranteed to occur on the same +-- connection. +withCachedConnection :: MonadOrville conn m => m a -> m a + +-- | Migration Guide: withTransaction retains the same name. +withTransaction :: MonadOrville conn m => m a -> m a + +-- | Migration Guide: ColumnFlag has been removed. Depending on +-- flag constructor there may or may not be a replacement. +-- +-- ColumnDefault - replaced by the setDefaultValue +-- function in new orville Unique - replaced by the +-- addUniqueConstraint function in new orville +-- References - replaced by the addForeignKeyConstraint +-- function in new orville ColumnDescription - removed +-- AssignedByDatabase - removed, though many cases are handled +-- by marshallReadOnlyField +data ColumnFlag +Default :: a -> ColumnFlag +Unique :: ColumnFlag +References :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> ColumnFlag +ColumnDescription :: String -> ColumnFlag +AssignedByDatabase :: ColumnFlag +class ColumnDefault a +toColumnDefaultSql :: ColumnDefault a => a -> String +data Now +Now :: Now + +-- | Migration Guide: The signature of the FieldDefinition type +-- has not changed, but many of the constructors and accessors have. See +-- the migration guides on individual functions for more info. +data FieldDefinition nullability a + +-- | Nullable is a values-less type used to track that a +-- FieldDefinition represents a field that is marked nullable in +-- the database schema. See the Nullability type for the +-- value-level representation of field nullability. +data Nullable + +-- | 'NotNull is a values-less type used to track that a +-- FieldDefinition represents a field that is marked not-null in +-- the database schema. See the Nullability type for the +-- value-level representation of field nullability. +data NotNull + +-- | Nullability represents whether a field will be marked as +-- NULL or 'NOT NULL' in the database schema. It is a GADT so +-- that the value constructors can be used to record this knowledge in +-- the type system as well. This allows functions that work only on +-- Nullable or NotNull fields to indicate this in their +-- type signatures as appropriate. +data Nullability nullability +[Nullable] :: Nullability Nullable +[NotNull] :: Nullability NotNull + +-- | Migration Guide: isFieldNullable has been replaced with +-- fieldIsNotNullable, which has the same signture but the +-- Bool returned is the opposite. +isFieldNullable :: FieldDefinition nullability a -> Bool + +-- | Migration Guide: fieldOfType is essentially unchanged in the +-- new orville. +fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a + +-- | Migration Guide: textField has been renamed to +-- boundedTextField. It now takes an Int32 rather than +-- an Int +textField :: String -> Int -> FieldDefinition NotNull Text + +-- | Migration Guide: fixedTextField retains the same name. It now +-- takes an Int32 rather than an Int +fixedTextField :: String -> Int -> FieldDefinition NotNull Text + +-- | Migration Guide: unboundedTextField retains the same name. +unboundedTextField :: String -> FieldDefinition NotNull Text + +-- | Migration Guide: dayField has been renamed to +-- dateField +dayField :: String -> FieldDefinition NotNull Day + +-- | Migration Guide: utcTimeField has been renamed to +-- utcTimestampField +utcTimeField :: String -> FieldDefinition NotNull UTCTime + +-- | Migration guide: int32Field has been renamed to +-- integerField +int32Field :: String -> FieldDefinition NotNull Int32 + +-- | Migration guide: int64Field has been renamed to +-- bigIntegerField +int64Field :: String -> FieldDefinition NotNull Int64 + +-- | Migration guide: doubleField retains the same name. +doubleField :: String -> FieldDefinition NotNull Double + +-- | Migration guide: boolField has been renamed to +-- booleanField +boolField :: String -> FieldDefinition NotNull Bool + +-- | Migration guide: automaticIdField has been renamed to +-- serialField +automaticIdField :: String -> FieldDefinition NotNull Int32 + +-- | Migration guide: searchVectorField has been renamed to +-- textSearchVectorField +searchVectorField :: String -> FieldDefinition NotNull Text + +-- | Migration Guide: nullableField retains the same name +-- +-- Makes a NotNull field Nullable by wrapping the Haskell +-- type of the field in Maybe. The field will be marked as +-- NULL in the database schema and the value Nothing will +-- be used to represent NULL values when converting to and from +-- sql. +nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a) + +-- | Migration Guide: foreignKeyField has been removed. It is +-- replaced by addForeignKeyConstraint which adds a foreign key +-- constraint to an existing FieldDefinition. +foreignKeyField :: String -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> FieldDefinition nullability key + +-- | Migration Guide: withFlag has been removed. See the migration +-- guide on ColumnFlag regarding the new API. +withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a + +-- | Migration Guide: withName has been removed. +withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a + +-- | Migration Guide: withConversion has been replaced with +-- convertField, whose arguments are flipped from those of +-- withConversion. Note there is also now a coerceField +-- function that can be used with newtype wrappers, provided the +-- constructor is available where coerceField is used. +withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b + +-- | Migration Guide: fieldFromSql has been replaced with +-- fieldValueFromSqlValue +fieldFromSql :: FieldDefinition nullability a -> FromSql a + +-- | Migration Guide: fieldToSqlValue has been renamed to +-- fieldValueToSqlValue +fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue +data SomeField +SomeField :: FieldDefinition nullability a -> SomeField + +-- | Migration Guide: withPrefix has been replaced by +-- prefixField whose arguments are flipped relative to +-- withPrefix +withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a +fieldName :: FieldDefinition nullability a -> String +fieldType :: FieldDefinition nullability a -> SqlType a + +-- | fieldFlags has been removed. See the new +-- fieldDefaultValue and fieldTableConstraints +-- functions +fieldFlags :: FieldDefinition nullability a -> [ColumnFlag] +data IndexDefinition +IndexDefinition :: String -> Bool -> String -> String -> IndexDefinition +[indexName] :: IndexDefinition -> String +[indexUnique] :: IndexDefinition -> Bool +[indexTable] :: IndexDefinition -> String +[indexBody] :: IndexDefinition -> String + +-- | Migration Guide: uniqueIndex no longer requires a name to be +-- specified. Migration will be done automatically by inspecting the +-- structure of the indexes that exist in the database. It also no longer +-- accepts a TableDefinition at the time of creating the +-- IndexDefinition. Instead you should use +-- addTableIndexes to add the IndexDefinition to the +-- TableDefinition for the table that you wish to index. +-- +-- If you wish to specify the index name explicitly, you can use +-- uniqueNamedIndex instead. If you do so, index migration will +-- be managed by comparing to the names of existing indexes rather than +-- checking that the index structure matches the Haskell definition. +uniqueIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition + +-- | Migration Guide: simpleIndex has been renamed to +-- nonUniqueIndex. It no longer requires a name to be specified. +-- Migration will be done automatically be inspecting the structure of +-- the indexes that exist in the database. It also no longer accepts a +-- TableDefinition at the time of creating the +-- IndexDefinition. Instead you should use +-- addTableIndexes to add the IndexDefinition to the +-- TableDefinition for the table that you wish to index. +-- +-- If you wish to specify the index name explicitly, you can use +-- nonUniqueNamedIndex instead. If you do so, index migration +-- will be managed by comparing to the names of existing indexes rather +-- than checking that the index structure matches the Haskell definition. +simpleIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition + +-- | Works much the same as simpleIndex but takes a list of strings +-- that are the conditions of a where clause on index creation for +-- partial indexes +simplePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition + +-- | Works much the same as uniqueIndex but takes a list of strings +-- that are the conditions of a where clause on index creation for +-- partial indexes +uniquePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition +data ConstraintDefinition +ConstraintDefinition :: String -> String -> String -> ConstraintDefinition +[constraintName] :: ConstraintDefinition -> String +[constraintTable] :: ConstraintDefinition -> String +[constraintBody] :: ConstraintDefinition -> String +data SequenceDefinition +SequenceDefinition :: String -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Bool -> SequenceDefinition +[sequenceName] :: SequenceDefinition -> String +[sequenceIncrement] :: SequenceDefinition -> Maybe Int +[sequenceMinValue] :: SequenceDefinition -> Maybe Int +[sequenceMaxValue] :: SequenceDefinition -> Maybe Int +[sequenceStart] :: SequenceDefinition -> Maybe Int +[sequenceCache] :: SequenceDefinition -> Maybe Int +[sequenceCycle] :: SequenceDefinition -> Bool + +-- | Migration Guide: uniqueConstraint no longer accepts a name +-- parameter. Instead the constraint is migrated automatically based on +-- the structure of existing constraints found in the database. It also +-- no longer accepts a TableDefinition. Instead you should use +-- addTableConstraints to add the ConstraintDefinition +-- to the table that you wish to apply the constraint to. +uniqueConstraint :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> ConstraintDefinition + +-- | Migration Guide: dropConstraint has been removed. Constraints +-- are now dropped automatically during auto-migration when they are +-- removed from the TableDefinition. +dropConstraint :: TableDefinition readEntity writeEntity key -> String -> SchemaItem +data FromSql a +data FromSqlError + +-- | Captures a failure in the translation of a SQL value from a particular +-- field to it's corresponding Haskell values. +RowDataError :: !RowDataErrorDetails -> FromSqlError + +-- | An expected column was not returned by the database +MissingColumn :: !MissingColumnDetails -> FromSqlError + +-- | A conversion between haskell representations failed at a point where +-- we don't know what column the value came from. This is the case when +-- using the partialMap combinator. +ConversionError :: !ConversionErrorDetails -> FromSqlError +data RowDataErrorDetails +RowDataErrorDetails :: !RowDataErrorReason -> !String -> ![(String, SqlValue)] -> RowDataErrorDetails +[rowErrorReason] :: RowDataErrorDetails -> !RowDataErrorReason + +-- | Column name for the erroneous value +[rowErrorColumnName] :: RowDataErrorDetails -> !String + +-- | Primary keys. Empty if not known +[rowErrorPrimaryKeys] :: RowDataErrorDetails -> ![(String, SqlValue)] +data RowDataErrorReason + +-- | Sql value has a different type than expected +TypeMismatch :: !String -> !String -> RowDataErrorReason + +-- | An integer value was outside the expected bounds. +IntegralOutOfBounds :: !Integer -> !Integer -> !Integer -> RowDataErrorReason + +-- | Generic decoding failure +DecodingFailure :: !String -> RowDataErrorReason +data MissingColumnDetails +MissingColumnDetails :: !String -> ![String] -> MissingColumnDetails +[missingColumn] :: MissingColumnDetails -> !String +[actualColumns] :: MissingColumnDetails -> ![String] +data ConversionErrorDetails +ConversionErrorDetails :: !String -> ![(String, SqlValue)] -> ConversionErrorDetails +[convErrorReason] :: ConversionErrorDetails -> !String + +-- | Primary key value(s). Empty if not known +[convErrorPrimaryKeys] :: ConversionErrorDetails -> ![(String, SqlValue)] + +-- | Shows the error in a way that should not contain any potentially +-- sensitive data. This is used for the Show instance. +showFromSqlErrorMinimal :: FromSqlError -> String + +-- | Shows the error in a way appropriate for logging within an +-- application. The resulting string contains information that is useful +-- for debugging but is potentially undesirable to expose outside of the +-- application (such as primary key values). +showFromSqlErrorForLogging :: FromSqlError -> String + +-- | User friendly identifier labels for SqlValues +showSqlValueType :: SqlValue -> String +class ColumnSpecifier col +selectForm :: ColumnSpecifier col => col -> SelectForm +col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a +data ToSql a b +getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity () +getComponent :: (entity -> a) -> ToSql a () -> ToSql entity () + +-- | Migration Guide: SchemaItem retains the same name. The +-- Index, DropIndex, Constraint and +-- DropConstraint constructors have been removed. These items +-- are now added to the TableDefinition via +-- addTableConstraints and addTableIndexes. The +-- remaining constructors have been prefixed with the word +-- Schema (e.g. Table has been renamed to +-- SchemaTable). There is no explicit replacement for +-- DropIndex and DropConstraint. Orville will +-- automatically drop indexes and constraints that are no longer +-- mentioned on the TableDefinition for any tables that it +-- migrates. +data SchemaItem +Table :: TableDefinition readEntity writeEntity key -> SchemaItem +DropTable :: String -> SchemaItem +Index :: IndexDefinition -> SchemaItem +DropIndex :: String -> SchemaItem +Constraint :: ConstraintDefinition -> SchemaItem +DropConstraint :: String -> String -> SchemaItem +Sequence :: SequenceDefinition -> SchemaItem +DropSequence :: String -> SchemaItem + +-- | Migration Guide: SchemaDefinition has been removed. Use +-- [SchemaItem] instead. +type SchemaDefinition = [SchemaItem] + +-- | Migration Guide: Record has been removed. It's recommended +-- that you create a separate record key type for each of your entities +-- instead. +type Record = Int +type CreatedAt = UTCTime +type UpdatedAt = UTCTime +type OccurredAt = UTCTime +data TableComments a +noComments :: TableComments () +say :: String -> (Int, Int, Int) -> String -> TableComments () +data WhereCondition + +-- | Migration Guide: whereAnd has been removed. Use the binary +-- function andExpr to combine BooleanExpr expressions +-- instead. andExpr is also available as the operator +-- (.&&) +whereAnd :: [WhereCondition] -> WhereCondition + +-- | Migration Guide: whereOr has been removed. Use the binary +-- function orExpr to combine BooleanExpr expressions +-- instead. orExpr is also available as the operator +-- (.||) +whereOr :: [WhereCondition] -> WhereCondition + +-- | Migration Guide: whereIn has been renamed to +-- fieldIn. It now takes a NonEmpty list of values to +-- reflect this is a requirement in SQL. +whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition + +-- | Migration Guide: whereLike has been renamed to +-- fieldLike. It now takes a T.Text value rather than a +-- String. +whereLike :: FieldDefinition nullability a -> String -> WhereCondition + +-- | Migration Guide: whereLikeInsensitive has been renamed to +-- fieldLikeInsensitive. It now takes a T.Text value +-- rather than a String. +whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition + +-- | Migration Guide: whereNotIn has been renamed to +-- fieldNotIn. It now takes a NonEmpty list of values +-- to reflect this is a requirement in SQL. +whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition + +-- | Migration Guide: whereQualified has been removed. If you need +-- qualified column references you can use the SQL building functions +-- found in Orville.PostgreSQL.Expr to build them. The +-- qualifyColumn function can be used to qualify column +-- references in that context. BooleanExpr values built directly +-- this way can be easily used in conjuction with other helpers such as +-- fieldEquals which also build BooleanExpr values +-- themselves. +whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition + +-- | Migration Guide: whereRaw has been removed. In its place you +-- should use the more general functions such as +-- unsafeSqlExpression or unsafeRawSql in the +-- Orville.PostgreSQL.Raw.RawSql module to build a +-- BooleanExpr. +whereRaw :: String -> [SqlValue] -> WhereCondition + +-- | Migration Guide: whereToSql has been removed. It is replaced +-- by the more general toBytesAndParams function in +-- Orville.PostgreSQL.Raw.RawSql. +whereToSql :: [WhereCondition] -> (String, [SqlValue]) + +-- | Migration Guide: isNull has been renamed to +-- fieldIsNull +isNull :: FieldDefinition Nullable a -> WhereCondition + +-- | Migration Guide: isNotNull has been renamed to +-- fieldIsNotNull +isNotNull :: FieldDefinition Nullable a -> WhereCondition +(.==) :: FieldDefinition nullability a -> a -> WhereCondition +(.<>) :: FieldDefinition nullability a -> a -> WhereCondition +(.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition +(%==) :: FieldDefinition nullability a -> a -> WhereCondition +(.>) :: FieldDefinition nullability a -> a -> WhereCondition +(.>=) :: FieldDefinition nullability a -> a -> WhereCondition +(.<) :: FieldDefinition nullability a -> a -> WhereCondition +(.<=) :: FieldDefinition nullability a -> a -> WhereCondition +data SelectOptions +SelectOptions :: First Bool -> [WhereCondition] -> [OrderByClause] -> First Int -> First Int -> [GroupByClause] -> SelectOptions +[selectDistinct] :: SelectOptions -> First Bool +[selectOptWhere] :: SelectOptions -> [WhereCondition] +[selectOptOrder] :: SelectOptions -> [OrderByClause] +[selectOptLimit] :: SelectOptions -> First Int +[selectOptOffset] :: SelectOptions -> First Int +[selectOptGroup] :: SelectOptions -> [GroupByClause] +where_ :: WhereCondition -> SelectOptions +distinct :: SelectOptions +order :: ToOrderBy a => a -> SortDirection -> SelectOptions +limit :: Int -> SelectOptions +offset :: Int -> SelectOptions +groupBy :: ToGroupBy a => a -> SelectOptions +selectOptionsToSql :: SelectOptions -> (String, [SqlValue]) + +-- | An associative operation. +(<>) :: Semigroup a => a -> a -> a +infixr 6 <> +data FieldUpdate +fieldUpdate :: FieldDefinition nullability a -> a -> FieldUpdate +(.:=) :: FieldDefinition nullability a -> a -> FieldUpdate +data OrderByClause +OrderByClause :: String -> [SqlValue] -> SortDirection -> OrderByClause +data SortDirection +Ascending :: SortDirection +Descending :: SortDirection + +-- | Migration Guide: migrateSchema has been renamed to +-- autoMigrateSchema +-- +-- migrateSchema will attempt to make changes to the actual database +-- schema that it it matches the provided SchemaDefinition. Unsafe +-- migrations such as dropping tables or columns are never attempted +-- unless the SchemaDefinition explicitly states that the items are safe +-- to drop. Column types may be changed, but will fail if the database +-- cannot successfully make the request type change. +migrateSchema :: MonadOrville conn m => SchemaDefinition -> m () +data MigrationError +MigrationLockExcessiveRetryError :: String -> MigrationError +MigrationExecutionError :: SchemaItem -> SomeException -> MigrationError + +-- | Migration Guide: generateMigrationPlan retains the same name. +-- It has changed to always return a MigrationPlan. You can use +-- check whether migrationPlanSteps is as empty list if you wish +-- to determine whether any migrations will be performed by the plan. +-- +-- generateMigrationPlan inspects the state of the actual database schema +-- and constructs a plan describing what changes would be made to make it +-- match the provided SchemaDefinition. If the actual schema already +-- matches the definition, Nothing will be returned. +generateMigrationPlan :: MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan) + +-- | Migration Guide: MigrationPlan retains the same name. +data MigrationPlan + +-- | Migration Guide: MigrationItem has been renamed to +-- MigrationStep, which is now a simple RawSql wrapper. +-- You can use RawSql.toExampleBytes if you wish to render it to +-- a bytestring for display purposes. +data MigrationItem +MigrationItem :: SchemaItem -> DDL -> MigrationItem +[migrationItemSchemaItem] :: MigrationItem -> SchemaItem +[migrationItemDDL] :: MigrationItem -> DDL + +-- | Migration Guide: migrationPlanItems has been renamed to +-- migrationPlanSteps +migrationPlanItems :: MigrationPlan -> [MigrationItem] +data Pagination m entity +Pagination :: [entity] -> Maybe (m (Pagination m entity)) -> Pagination m entity +[pageRows] :: Pagination m entity -> [entity] +[pageNext] :: Pagination m entity -> Maybe (m (Pagination m entity)) +buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> m (Pagination m readEnt) + +-- | Migration Guide: selectAll has been renamed to +-- findEntitiesBy +selectAll :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m [readEntity] + +-- | Migration Guide: selectFirst has been renamed to +-- findFirstEntityBy +selectFirst :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m (Maybe readEntity) + +-- | Migration Guide: deleteRecord has been renamed to +-- deleteEntity. Note that there are also new variant functions +-- deleteAndReturnEntity and +-- deleteEntityAndReturnRowCount that return Maybe +-- readEntity and Int respectively. +deleteRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m () + +-- | Migration Guide: deleteWhere has been renamed to +-- deleteEntities. It now takes a Maybe BooleanExpr +-- rather than [WhereCondition] +deleteWhere :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [WhereCondition] -> m Integer + +-- | Migration Guide: findRecord has been renamed to +-- findEntity +findRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m (Maybe readEntity) + +-- | Migration Guide: findRecords has been renamed to +-- findEntities. It now requires a NonEmpty key rather +-- than simply [key] and returns a [readEntity] instead +-- of a Map. +findRecords :: (Ord key, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> [key] -> m (Map key readEntity) + +-- | Migration Guide: findRecordsBy has been renamed to +-- findEntitiesBy. It no longer takes a FieldDefinition +-- to group by. Instead it simply returns a [readEntity] +findRecordsBy :: (Ord fieldValue, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> m (Map fieldValue [readEntity]) + +-- | Migration Guide: insertRecord has been renamed to +-- insertAndReturnEntity. Note there are also new variant +-- functions insertEntity and +-- insertEntityAndReturnRowCount that return () and +-- Int respectively. +insertRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity + +-- | Migration Guide: insertRecordMany has been renamed to +-- insertEntities. It now requires a NonEmpty +-- writeEntity rather than [writeEntity]. Note that there +-- are also new variant functions insertAndReturnEntities and +-- insertEntitiesAndReturnRowCount. +insertRecordMany :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m () + +-- | Migration Guide: insertRecordManyReturning has been renamed +-- to insertAndReturnEntities. +insertRecordManyReturning :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m [readEntity] + +-- | Migration Guide: updateFields has been renamed to +-- updateFieldsAndReturnRowCount, but now takes a NonEmpty +-- SetClause instead of a [Field Update] and a Maybe +-- BooleanExpr instead of a [WhereCondition]. +-- +-- updateFields still exists as a variant of this function, but +-- returns () rather than Int. +-- updateFieldsAndReturnEntities is now available as well. +updateFields :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [FieldUpdate] -> [WhereCondition] -> m Integer + +-- | Migration Guide: updateRecord has been renamed to +-- updateEntity. Note that there are also new variant functions +-- updateAndReturnEntity and +-- updateEntityAndReturnRowCount@. +updateRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> writeEntity -> m () +sequenceNextVal :: MonadOrville conn m => SequenceDefinition -> m Int +sequenceSetVal :: MonadOrville conn m => SequenceDefinition -> Int -> m Int +sequenceCurrVal :: MonadOrville conn m => SequenceDefinition -> m Int + +-- | Migration Plan: createIndexesConcurrently has been removed. +-- You should now use setIndexCreationStrategy Asynchronous +-- instead. +-- +-- createIndexesConcurrently will create the given indexes, if they do +-- not exist using the PostgreSQL concurrently feature. However, this +-- does *not* mean the the function happens concurrently. This will wait +-- for PostgreSQL to return, but other operations to the table will be +-- allowed during index creation. +-- +-- Note: PostgreSQL does not allow CREATE INDEX CONCURRENTLY to appear +-- inside of a transaction. Use this function with care. +createIndexesConcurrently :: MonadOrville conn m => [IndexDefinition] -> m () + +-- | Migration Guide: dropIndexesConcurrently has been removed. +-- +-- dropIndexesConcurrently will drop each of the given indexes with the +-- CONCURRENTLY keyword, allowing for other table operations to continue +-- while the index is dropped. However there are several caveats that +-- come with this as noted at +-- https://www.postgresql.org/docs/9.6/sql-dropindex.html . Much +-- like createIndexesConcurrently this cannot be used in a +-- transaction. But further this cannot drop indexes that support UNIQUE +-- or PRIMARY KEY constraints. +-- +-- Use this with care. +dropIndexesConcurrently :: MonadOrville conn m => [String] -> m () + + +module Database.Orville.PostgreSQL.Popper +data PopError +MissingRecord :: TableDefinition readEntity writeEntity key -> PrimaryKey key -> key -> PopError +MissingRecordBy :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> fieldValue -> PopError +Unpoppable :: String -> PopError +data Popper a b +data Popped a +PoppedValue :: a -> Popped a +PoppedError :: PopError -> Popped a + +-- | Left-to-right composition +(>>>) :: Category cat => cat a b -> cat b c -> cat a c +infixr 1 >>> + +-- | Right-to-left composition +(<<<) :: Category cat => cat b c -> cat a b -> cat a c +infixr 1 <<< +abortPop :: PopError -> Popper a b +certainly :: PopError -> Popper (Maybe b) b +certainly' :: Popper a PopError -> Popper a (Maybe b) -> Popper a b +fromKern :: (a -> b) -> Popper a b +hasMany :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue [readEntity] +hasManyIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue [readEntity]) +hasOneIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue readEntity) +hasManyInWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper [fieldValue] (Map fieldValue [readEntity]) +hasManyWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue [readEntity] +hasOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue (Maybe readEntity) +hasOne' :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue readEntity +hasOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue (Maybe readEntity) +kern :: Popper a a +popMissingRecord :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue PopError +onKern :: (a -> b -> c) -> Popper b a -> Popper b c +pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b) +popThrow :: MonadOrville conn m => Popper a b -> a -> m b +popFirst :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a (Maybe readEntity) +popMany :: Popper a b -> Popper [a] [b] +onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b +popMaybe :: Popper a b -> Popper (Maybe a) (Maybe b) + +-- | popQuery embeds an Orville operation in a popper. It is left up to the +-- programmer to ensure that the Orville operation does not do any +-- updates to the database, but only does queries. +-- +-- The initial string argument is a description of the query to put into +-- the results of explain +popQuery :: String -> (forall conn m. MonadOrville conn m => m b) -> Popper a b +popRecord :: TableDefinition readEntity writeEntity key -> key -> Popper a (Maybe readEntity) +popRecord' :: TableDefinition readEntity writeEntity key -> key -> Popper a readEntity +popTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a [readEntity] +explain :: Popper a b -> String +explainLines :: Popper a b -> [String] +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Popper.Popper a) +instance GHC.Base.Applicative (Database.Orville.PostgreSQL.Popper.Popper a) +instance Control.Category.Category Database.Orville.PostgreSQL.Popper.Popper +instance Control.Arrow.Arrow Database.Orville.PostgreSQL.Popper.Popper +instance Control.Arrow.ArrowChoice Database.Orville.PostgreSQL.Popper.Popper +instance GHC.Base.Functor Database.Orville.PostgreSQL.Popper.Popped +instance GHC.Base.Applicative Database.Orville.PostgreSQL.Popper.Popped +instance GHC.Show.Show Database.Orville.PostgreSQL.Popper.PopError +instance GHC.Exception.Type.Exception Database.Orville.PostgreSQL.Popper.PopError + +module Database.Orville.PostgreSQL.Plan.Operation + +-- | Operation provides a stucture for building primitive operations +-- that can be incorporated into a Plan. An Operation +-- provides base case implementations of the various plan execution +-- functions. You only need to care about this type if you want to create +-- new custom operations to include in a Plan beyond those already +-- provided in the Plan api. +data Operation param result +Operation :: (forall conn m. MonadOrville conn m => param -> m (Either AssertionFailed result)) -> (forall conn m. MonadOrville conn m => [param] -> m (Either AssertionFailed (Many param result))) -> Explanation -> Explanation -> Operation param result + +-- | executeOperationOne will be called when an plan is executed +-- with a single input parameter +[executeOperationOne] :: Operation param result -> forall conn m. MonadOrville conn m => param -> m (Either AssertionFailed result) + +-- | executeOperationMany will be called when an plan is executed +-- with multiple input parameters (via planMany). +[executeOperationMany] :: Operation param result -> forall conn m. MonadOrville conn m => [param] -> m (Either AssertionFailed (Many param result)) + +-- | explainOperationOne will be called when producing an +-- explanation of what the plan will do when given one input parameter. +-- Plans that do not perform any interesting IO interactions should +-- generally return an empty explanation. +[explainOperationOne] :: Operation param result -> Explanation + +-- | explainOperationMany will be called when producing an +-- explanation of what the plan will do when given multiple input +-- parameters (via planMany). Plans that do not perform any +-- interesting IO interactions should generally return an empty +-- explanation. +[explainOperationMany] :: Operation param result -> Explanation + +-- | AssertionFailed may be returned from the execute functions of +-- an Operation to indicate that some expected invariant has +-- failed. For example, following a foreign key that is enforced by the +-- database only to find that no record exists. When an Operation +-- returns an AssertionFailed value during plan execution the +-- error is thrown as an exception using the MonadThrow instance +-- for whatever monad the plan is executing in. +data AssertionFailed + +-- | mkAssertionFailed builds an AssertionFailed error from +-- an error message. +mkAssertionFailed :: String -> AssertionFailed + +-- | findOne builds a planning primitive that finds (at most) one +-- row from the given table where the column value for the provided +-- FieldDefinition matches the plan's input parameter. When +-- executed on multiple parameters it fetches all rows where the field +-- matches the inputs and arbitrarily picks at most one of those rows to +-- use as the result for each input. +findOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue (Maybe readEntity) + +-- | findOneWhere is similar to findOne but allows a +-- WhereCondition to be specified that is added to the database +-- query to restrict which rows are returned. +findOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue (Maybe readEntity) + +-- | findAll builds a planning primitive that finds all the rows +-- from the given table where the column value for the provided field +-- matches the plan's input parameter. Where executed on multiple +-- parameters all rows are fetch in a single query and then associated +-- with their respective inputs after being fetched. +findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue [readEntity] + +-- | findAllWhere is similar to findAll but allows a +-- WhereCondition to be specified that is added to the database +-- query to restrict which rows are returned. +findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue [readEntity] + +-- | findSelect builds a plan Operation where the select that +-- is run does not use the input parameters for the plan in any way. If +-- the executeOperationMany function of the resulting +-- Operation will run the query once and use the entire result set +-- as the result each of the input parameters in turn. +findSelect :: Select row -> Operation param [row] + +-- | askParam simply returns the paremeter given from the plan. +askParam :: Operation param param + +-- | assertRight returns the value on the Right side of an +-- Either. If the Either is a Left, it raises +-- AssertionFailed with the message from the left side of the +-- either. +assertRight :: Operation (Either String a) a + +-- | SelectOperation is a helper type for building Operation +-- primitives that run Select queries. Specifying the fields of +-- SelectOperation and then using the selectOperation +-- function to build an Operation is more convenient that building +-- functions to execute the queries thate are required by the +-- Operation type. +data SelectOperation param row result +SelectOperation :: (param -> Select row) -> ([param] -> Select row) -> Select row -> Select row -> (row -> param) -> ([row] -> result) -> SelectOperation param row result + +-- | selectOne will be called to build the Select query that +-- should be run when there is a single input parameter while executing a +-- plan. Note that the "One-ness" here refers to the single input +-- parameter rather than result. See produceResult below for more +-- information about returning one values vs. many from a +-- SelectOperation. +[selectOne] :: SelectOperation param row result -> param -> Select row + +-- | selectMany will be called to build the Select query that +-- should be run when there are multiple parameters while executing a +-- plan. Note that the "Many-ness" here refers to the multiple input +-- parameters rather than result. See produceResult below for more +-- information about returning one values vs. many from a +-- SelectOperation. +[selectMany] :: SelectOperation param row result -> [param] -> Select row + +-- | explainSelectOne should show a representative query of what +-- will be returned when selectOne is used. No input parameter is +-- available here to build the query, however, because this value is used +-- to explain a plan without actually running it. +[explainSelectOne] :: SelectOperation param row result -> Select row + +-- | explainSelectMany should show a representative query of what +-- will be returned when 'selectMany is used. No input parameters are +-- available here to build the query, however, because this value is used +-- to explain a plan without actually running it. +[explainSelectMany] :: SelectOperation param row result -> Select row + +-- | categorizeRow will be used when a plan is executed with +-- multiple parameters to determine which input parameter the row should +-- be associated with. +[categorizeRow] :: SelectOperation param row result -> row -> param + +-- | produceResult will be used convert the row type +-- returned by the Select queries for the operation input the +-- result type that is present as the output of the operation. +-- The input rows will be all the inputs associated with a single +-- parameter. The result type constructed here need not be a +-- single value. For instance, findAll uses the list type as the +-- result type and findOne uses Maybe. +[produceResult] :: SelectOperation param row result -> [row] -> result + +-- | selectOperation builds a primitive planning Operation +-- using the functions given by a SelectOperation. If you are +-- implementing a custom operation that runs a select statement, it is +-- probably easier to use this function rather than building the +-- Operation functions directly. +selectOperation :: Ord param => SelectOperation param row result -> Operation param result +instance GHC.Show.Show Database.Orville.PostgreSQL.Plan.Operation.AssertionFailed +instance GHC.Exception.Type.Exception Database.Orville.PostgreSQL.Plan.Operation.AssertionFailed + +module Database.Orville.PostgreSQL.Plan + +-- | A Plan is an executable set of queries that can be executed to +-- load data from the database, using the results of prior queries as +-- input parameters to following queries in controlled ways. In +-- particular, the "controlled" aspect of this allows plans that take a +-- single input to be adapted to take multiple input parameters in a list +-- without the resulting plan executing N+1 queries. This restriction +-- means that while query results can be used as input parameters to +-- later queries, they cannot be used to decide to run completely +-- different queries based on other query results. Allowing this would +-- prevent the Plan structure from eliminating N+1 query loops. +-- +-- Note that during execution queries are never combined across tables to +-- form joins or subqueries. Queries are still executed in the same +-- sequence as specified in the plan, just on all the inputs at once +-- rather than in a loop. If you need to do a join with a plan, you can +-- always construction your own custom Operation and use +-- planOperation to incorporate into a plan. +-- +-- The param type variable indicates what type of value is +-- expected as input when the plan is executed. +-- +-- The result type for a plan indicates what Haskell type is +-- produced when the plan is executed. +-- +-- The scope type is used internally by Orville to track the +-- plan is currently executed against a single input or multiple inputs. +-- This type parameter should never specified as a concrete type in user +-- code, but must be exposed as a variable to ensure that execute scope +-- is tracked correctly through usages of bind. +data Plan scope param result + +-- | A Planned value is a wrapper around the results of previous run +-- queries when using the bind function. At the time that you are +-- writing a plan you do not know whether the Plan will be run +-- with a single input or multiple inputs. A Planned value may end +-- up being either an individual item or a list of items. Due to this, +-- your ability to interact with the value is limited to the use of +-- fmap to extract (or build) other values from the results. +-- Planned values can be used together with the use +-- function to make a Plan that produces the extracted value. +-- +-- Note that while Planned could provide an Applicative +-- instance as well, it does not to avoid confusion with +-- Applicative instance for Plan itself. If you need to +-- build a value from several Planned values using +-- Applicative, you should call use on each of the values +-- and use the Applicative instance for Plan. +data Planned scope param a + +-- | Execute is a tag type used by as the scope variable +-- for Plan values when executing them via the execute +-- function. +data Execute + +-- | Explain is an tag type used as the scope variable when +-- explaining a Plan via the explain function. +data Explain + +-- | askParam allows the input parameter for the plan to be +-- retrieved as the result of the plan. Together with bind you can +-- use this to get access to the input parameter as a Planned +-- value. +askParam :: Plan scope param param + +-- | execute accepts the input parameter (or parameters) expected by +-- a Plan and runs the plan to completion, either throwing an +-- AssertionFailed exception in the monad m or producing +-- the expected result. +-- +-- If you have a plan that takes one input and want to provide a list of +-- input, use planMany to adapt it to a multple-input plan before +-- calling execute. +execute :: MonadOrville conn m => Plan Execute param result -> param -> m result + +-- | explain produces a textual description of the steps outlined by +-- a Plan -- in most cases example SQL queries. If you want to see +-- the explanation of how the plan will run with multiple input +-- parameters, you can use planMany to adapt it before calling +-- explain. +explain :: Plan Explain param result -> [String] + +-- | findMaybeOne constructs a Plan that will find at most +-- one row from the given table where the plan's input value matches the +-- given database field. +findMaybeOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue (Maybe readEntity) + +-- | findMaybeOneWhere is similar to findMaybeOne, but allows +-- a WhereCondition to be specified to restrict which rows are +-- matched by the database query. +findMaybeOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue (Maybe readEntity) + +-- | findOne is an alias to findOneShowVia that uses the +-- Show instance of fieldValue when producing a failure +-- message in the result the entity cannot be found. +findOne :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity + +-- | findOneShowVia is similar to 'findMaybeOne, but it expects that +-- there will always be a row found matching the plan's input value. If +-- no row is found an AssertionFailed exception will be thrown. +-- This is a useful convenience when looking up foreign-key associations +-- that are expected to be enforced by the database itself. +findOneShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity + +-- | findOneWhere is an alias to findOneWhereShowVia that +-- uses the Show instance of fieldValue when producing a +-- failure message in the result the entity cannot be found. +findOneWhere :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity + +-- | findOneWhereShowVia is similar to findOneShowVia, but +-- allows a WhereCondition to be specified to restrict which +-- rows are matched by the database query. +findOneWhereShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity + +-- | findAll constructs a Plan that will find all the rows +-- from the given table there the plan's input value matches the given +-- database field. +findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue [readEntity] + +-- | findAllWhere is similar to findAll, but allows a +-- WhereCondition to be specified to restrict which rows are +-- matched by the database query. +findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue [readEntity] + +-- | bind gives access to the results of a plan to use as input +-- values to future plans. The plan result is given the input parameter +-- to the provided function, which must produce the remaining Plan +-- to be executed. The value will be wrapped in the Planned type, +-- which may represent either a result or multiple results, depending on +-- whether one plan is currently be executed with one and multiple input +-- parameters. This ensures that the caller produces only a single +-- remaining Plan to be used for all inputs when there are +-- multiple to eliminate the need to possibly run different queries for +-- different inputs (which would an introduce N+1 query execution). +-- +-- The Planned value (or values) provided by bind have +-- actually been retrieved from the database, so the value can be used +-- multiple times when constructing the remaining Plan without +-- fear of causing the query to run multiple times. +-- +-- Also see use for how to lift a Planned value back into a +-- Plan. +bind :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result + +-- | use constructs a Plan that always produces the +-- Planned value as its result, regardless of the parameter given +-- as input to the plan. +use :: Planned scope param a -> Plan scope param a + +-- | using uses a Planned value in the input to another +-- Plan. The resulting plan will ignore its input and use the +-- Planned value as the input to produce its result instead. +using :: Planned scope param a -> Plan scope a b -> Plan scope param b + +-- | chain connects the output of one plan to the input of another +-- to form a larger plan that will execute the first followed by the +-- second. +chain :: Plan scope a b -> Plan scope b c -> Plan scope a c + +-- | apply applies a function produced by a plan to the value +-- produced by another plan. This is usually used via the +-- <*> operator through the Applicative instance for +-- Plan. +apply :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b + +-- | planMany adapts a plan that takes a single input parameter to +-- work on multiple input parameters. When the new plan is executed each +-- query will execute in the same basic order, but with adjusted +-- conditions to find all the rows for all inputs at once rather than +-- running the planned queries once for each input. +planMany :: (forall manyScope. Plan manyScope param result) -> Plan scope [param] (Many param result) + +-- | planList lifts a plan so both its param and result become +-- lists. This saves you from having to fmap in elems when all you +-- want back from a Many is the list of results inside it. +planList :: (forall scope. Plan scope param result) -> Plan listScope [param] [result] + +-- | focusParam builds a plan from a function and an existing plan +-- taking the result of that function as input. This is especially useful +-- when there is some structure, and a plan that only needs a part of +-- that structure as input. The function argument can access part of the +-- structure for the plan argument to use, so the final returned plan can +-- take the entire structure as input. +focusParam :: (a -> b) -> Plan scope b result -> Plan scope a result + +-- | planEither lets you construct a plan that branches by executing +-- a different plan for the Left and Right sides of an +-- Either value. When used with a single input parameter only one +-- of the two plans will be used, based on the input parameter. When used +-- on multiple input parameters, each of the two plans will be executed +-- only once with all the Left and Right values provided as +-- input parameters respectively. +planEither :: Plan scope leftParam leftResult -> Plan scope rightParam rightResult -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult) + +-- | planMaybe lifts a plan so both its param and result become +-- Maybes. This is useful when modifying an existing plan to deal +-- with optionality. Writing just one plan can then easily produce both +-- the required and optional versions. +planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b) + +-- | AssertionFailed may be returned from the execute functions of +-- an Operation to indicate that some expected invariant has +-- failed. For example, following a foreign key that is enforced by the +-- database only to find that no record exists. When an Operation +-- returns an AssertionFailed value during plan execution the +-- error is thrown as an exception using the MonadThrow instance +-- for whatever monad the plan is executing in. +data AssertionFailed + +-- | assert allows you to make an assertion about a plans result +-- that will throw an AssertionFailed failed exception during +-- execution if it proves to be false. The first parameter is the +-- assertion function, which should return either an error message to be +-- given in the exception or the value to be used as the plan's result. +assert :: (param -> a -> Either String b) -> Plan scope param a -> Plan scope param b + +-- | planSelect allows any Orville Select query to be +-- incorporated into a plan. Note that the Select cannot depend on +-- the plan's input parameters in this case. If the plan is executed with +-- multiple inputs the same set of all the results will be used as the +-- results for each of the input parameters. +planSelect :: Select row -> Plan scope () [row] + +-- | planOperation allows any primitive Operation to be used +-- as an atomic step in a plan. When the plan is executed, the +-- appropriate Operation functions will be used depending on the +-- execution context. +planOperation :: Operation param result -> Plan scope param result +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Plan.Plan scope param) +instance GHC.Base.Applicative (Database.Orville.PostgreSQL.Plan.Plan scope param) +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Plan.Planned scope param) + + +-- | This module exports the bind function as >>= so +-- that it can be used in conjuction with the QualifiedDo +-- language extension to write plans using do syntax like so: +-- +--
    +--   module MyModule where
    +--   
    +--   import qualified Orville.PostgreSQL.Plan.Syntax as PlanSyntax
    +--   
    +--   data FooFamily =
    +--     FooFamily
    +--       { foo :: Foo
    +--       , children :: [FooChildren]
    +--       , pets :: [FooPets]
    +--       }
    +--   
    +--   findFooFamily = PlanSyntax.do $
    +--     fooHeader <- Plan.findOne fooTable fooIdField
    +--     fooChildren <- Plan.findAll fooChildTable fooIdField
    +--     fooPets <- Plan.findAll fooPetTable fooIdField
    +--   
    +--     FooFamily
    +--       $ Plan.use fooHeader
    +--       * Plan.use fooChildren
    +--       * Plan.use fooPets
    +--   
    +module Database.Orville.PostgreSQL.Plan.Syntax + +-- | An operator alias of bind so that it can be used with +-- QualifiedDo. +(>>=) :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result + + +-- | See Database.Orville.PostgreSQL.Core for information about +-- migrating to the new LibPQ-based Orville. +module Database.Orville.PostgreSQL + +module Database.Orville.PostgreSQL.Trigger +insertTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, InsertTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity +class InsertTrigger trigger readEntity +insertTriggers :: InsertTrigger trigger readEntity => readEntity -> [trigger] +updateTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, UpdateTrigger trigger readEntity writeEntity) => TableDefinition readEntity writeEntity key -> readEntity -> writeEntity -> m () +class UpdateTrigger trigger readEntity writeEntity +updateTriggers :: UpdateTrigger trigger readEntity writeEntity => readEntity -> writeEntity -> [trigger] +deleteTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, DeleteTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> readEntity -> m () +class DeleteTrigger trigger readEntity +deleteTriggers :: DeleteTrigger trigger readEntity => readEntity -> [trigger] +class MonadTrigger trigger m | m -> trigger +runTriggers :: MonadTrigger trigger m => [trigger] -> m () +data OrvilleTriggerT trigger conn m a +data RecordedTriggers trigger +committedTriggers :: RecordedTriggers trigger -> [trigger] +uncommittedTriggers :: RecordedTriggers trigger -> Maybe [trigger] +runOrvilleTriggerT :: MonadIO m => OrvilleTriggerT trigger conn m a -> Pool conn -> m (a, [trigger]) +mapOrvilleTriggerT :: Monad n => (m a -> n b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn n b +liftOrville :: Monad m => OrvilleT conn m a -> OrvilleTriggerT trigger conn m a +askTriggers :: MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger) +clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m () + + +-- | MonadUnliftIO provides functions and instances for using +-- MonadOrville and OrvilleT for Monad transformer +-- stacks that are using MonadUnliftIO. The most common way to +-- do this is simply to add the following MonadOrvilleControl +-- instance: +-- +--
    +--   instance MonadOrvilleControl MyMonad where
    +--     liftWithConnection = liftWithConnectionViaUnliftIO
    +--     liftFinally = liftFinallyViaUnliftIO
    +--   
    +-- +-- This module also provides a MonadUnliftIO instance for +-- OrvilleT and OrvilleTrigger. | +module Database.Orville.PostgreSQL.MonadUnliftIO + +-- | liftWithConnectionViaUnliftIO can be use as the implementation of +-- liftWithConnection for MonadOrvilleControl when the +-- Monad implements MonadUnliftIO. | +liftWithConnectionViaUnliftIO :: MonadUnliftIO m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b + +-- | liftFinallyViaUnliftIO can be use as the implementation of +-- liftFinally for MonadOrvilleControl when the +-- Monad implements MonadUnliftIO. | +liftFinallyViaUnliftIO :: MonadUnliftIO m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c +instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Database.Orville.PostgreSQL.Internal.Monad.OrvilleT conn m) +instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Database.Orville.PostgreSQL.Internal.Trigger.OrvilleTriggerT trigger conn m) + + +-- | ResourceT provides ResourceT instance of the Orville +-- typeclasses for situations where you might need it. In particular, if +-- you are using the conduit library, you may want to wrap +-- ResourceT around your normal monad stack, in which case you'll +-- need the MonadOrville instance provided here to use +-- selectConduit. +-- +-- These instances are not included in the default exports for Orville +-- because the required either a MonadUnliftIO or +-- MonadBaseControl instance of the monad underlying +-- ResourceT, depending on the version of ResourceT you are +-- using. For resource-1.1.10 and above you must provide +-- MonadUnliftIO instance. For versions prior to 1.1.10 you must +-- provide a MonadBaseControl instance. +-- +-- This is required by MonadOrville requires an instance to +-- MonadBaseControl to be defined. The instance provided here +-- can only use one lifting strategy, one we choose MonadUnliftIO +-- wherever possible (both by our own opinion and because later versions +-- of ResourceT have removed MonadBaseControl support). +-- MonadBaseControl is used for versions of ResourceT +-- before ResourceT supported MonadUnliftIO. +module Database.Orville.PostgreSQL.ResourceT +instance (GHC.Base.Monad m, Database.Orville.PostgreSQL.Internal.Monad.HasOrvilleContext conn m) => Database.Orville.PostgreSQL.Internal.Monad.HasOrvilleContext conn (Control.Monad.Trans.Resource.Internal.ResourceT m) +instance (Database.Orville.PostgreSQL.Internal.Monad.MonadOrvilleControl m, Control.Monad.IO.Unlift.MonadUnliftIO m) => Database.Orville.PostgreSQL.Internal.Monad.MonadOrvilleControl (Control.Monad.Trans.Resource.Internal.ResourceT m) +instance (Control.Monad.IO.Unlift.MonadUnliftIO m, Database.Orville.PostgreSQL.Internal.Monad.MonadOrville conn m) => Database.Orville.PostgreSQL.Internal.Monad.MonadOrville conn (Control.Monad.Trans.Resource.Internal.ResourceT m) + + +-- | MonadBaseControl provides functions and instances for using +-- MonadOrville and OrvilleT for situations where you +-- need to use MonadBaseControl. If you do not know if you need +-- MonadBaseControl, then you probably don't need to use this +-- module. If you are thinking about using MonadBaseControl +-- instead of MonadUnliftIO, we recommend reading Michael +-- Snoyman's excellent "A Tale of Two Brackets" +-- (https:/www.fpcomplete.comblog201706/tale-of-two-brackets) +-- if you have not already done so. +-- +-- If you're still here after reading above, this module provides the +-- functions you need to implement MonadOrvilleControl for your +-- Monad stack using its MonadBaseControl instance. The most +-- common way to do this is simply to add the following +-- MonadOrvilleControl instance: +-- +--
    +--   instance MonadOrvilleControl MyMonad where
    +--     liftWithConnection = liftWithConnectionViaBaseControl
    +--     liftFinally = liftFinallyViaBaseControl
    +--   
    +-- +-- This module also provides a MonadOrvilleControl for +-- StateT as well as MonadBaseControl and +-- MonadTransControl instances for OrvilleT and +-- OrvilleTriggerT. +module Database.Orville.PostgreSQL.MonadBaseControl + +-- | liftWithConnectionViaBaseControl can be use as the implementation of +-- liftWithConnection for MonadOrvilleControl when the +-- Monad implements MonadBaseControl. +liftWithConnectionViaBaseControl :: MonadBaseControl IO m => (forall b. (conn -> IO b) -> IO b) -> (conn -> m a) -> m a + +-- | liftFinallyViaBaseControl can be use as the implementation of +-- 'liftFinally for MonadOrvilleControl when the Monad +-- implements MonadBaseControl. +liftFinallyViaBaseControl :: MonadBaseControl IO m => (forall c d. IO c -> IO d -> IO c) -> m a -> m b -> m a +instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Database.Orville.PostgreSQL.Internal.Monad.MonadOrvilleControl (Control.Monad.Trans.State.Lazy.StateT a m) +instance Control.Monad.Trans.Control.MonadTransControl (Database.Orville.PostgreSQL.Internal.Monad.OrvilleT conn) +instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Database.Orville.PostgreSQL.Internal.Monad.OrvilleT conn m) +instance Control.Monad.Trans.Control.MonadTransControl (Database.Orville.PostgreSQL.Internal.Trigger.OrvilleTriggerT trigger conn) +instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Database.Orville.PostgreSQL.Internal.Trigger.OrvilleTriggerT trigger conn m) diff --git a/docs/orville-postgresql-legacy-docs/plus.gif b/docs/orville-postgresql-legacy-docs/plus.gif new file mode 100644 index 0000000000000000000000000000000000000000..2d15c14173d23f664b955cd24f51c82f5f09d91d GIT binary patch literal 59 zcmZ?wbhEHbgbBX M^XE!9f*2UA0nx1yDgXcg literal 0 HcmV?d00001 diff --git a/docs/orville-postgresql-legacy-docs/quick-jump.css b/docs/orville-postgresql-legacy-docs/quick-jump.css new file mode 100644 index 0000000..468d803 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/quick-jump.css @@ -0,0 +1,164 @@ +/* @group Search box layout */ + +#search { + position: fixed; + top: 3.2em; + bottom: 0; + left: calc(50% - 22em); + width: 44em; + z-index: 1000; + pointer-events: none; + overflow-y: auto; +} + +#search.hidden { + display: none; +} + +#search-form, #search-results { + box-shadow: 2px 2px 6px rgb(199, 204, 208); + pointer-events: all; +} + +#search-form input { + font-size: 1.25em; line-height: 2.3em; height: 2.4em; + display: block; + box-sizing: border-box; + width: 100%; + margin: 0; + padding: 0 0.75em; + border: 0.05em solid rgb(151, 179, 202); +} + +#search input:focus { + outline: none; +} + +#search p.error { + color: rgb(107, 24, 24); + font-weight: bold; +} + +#search-results { + box-sizing: border-box; + border: 0.05em solid #b2d5fb; + background: #e8f3ff; +} + +#search-form input + #search-results { + border-top: none; + top: 3em; + max-height: calc(100% - 3em); +} + +/* @end */ + +/* @group search results */ + +#search-results > ul { + margin: 0; + list-style: none; +} + +#search-results > ul > li, +#search-results > p, +#search-results > table { + padding: 0.5em 1em; + margin: 0; +} + +#search-results > ul > li { + border-bottom: 1px solid #b2d5fb; +} + +#search-results > ul > li > ul { + list-style: none; +} + +.search-module h4 { + margin: 0; +} + +.search-module > ul { + margin: 0.5em 0 0.5em 2em; +} + +.search-module > ul > li > a[href] { + display: block; + color: inherit; + padding: 0.25em 0.5em; +} + +.search-module > ul > li > a[href].active-link { + background: #faf9dc; +} + +.search-module a[href]:hover { + text-decoration: none; +} + +.search-result a a { + pointer-events: none; +} + +.search-result ul.subs { + display: inline-block; + margin: 0; padding: 0; +} + +.search-result ul.subs li { + display: none; +} + +.search-result ul.subs::after { + display: inline-block; + content: "..."; + color: rgb(78,98,114); + margin: 0 0.25em; +} + +.more-results { + color: rgb(99, 141, 173); + position: relative; +} + +.more-results::before { + content: "+"; + display: inline-block; + color: #b2d5fb; + font-weight: bold; + font-size: 1.25em; line-height: inherit; + position: absolute; + left: -1em; +} + +/* @end */ + +/* @group Keyboard shortcuts table */ + +.keyboard-shortcuts { + line-height: 1.6em; +} + +.keyboard-shortcuts th { + color: rgb(78,98,114); +} + +.keyboard-shortcuts td:first-child, +.keyboard-shortcuts th:first-child { + text-align: right; + padding-right: 0.6em; +} + +.key { + display: inline-block; + font-size: 0.9em; + min-width: 0.8em; line-height: 1.2em; + text-align: center; + background: #b2d5fb; + border: 1px solid #74a3d6; + padding: 0 0.2em; + margin: 0 0.1em; +} + +/* @end */ diff --git a/docs/orville-postgresql-legacy-docs/quick-jump.min.js b/docs/orville-postgresql-legacy-docs/quick-jump.min.js new file mode 100644 index 0000000..c03e083 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/quick-jump.min.js @@ -0,0 +1,2 @@ +!function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s=0&&e.followActiveLink()),"s"===t.key&&"input"!==t.target.tagName.toLowerCase()&&(t.preventDefault(),e.show())})},t.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},t.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},t.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},t.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t={};this.state.fuse.search(e).forEach(function(e){var n=e.item.module;(t[n]||(t[n]=[])).push(e)});var n=[];for(var o in t)!function(e){var o=t[e],r=0;o.forEach(function(e){r+=1/e.score}),n.push({module:e,totalScore:1/r,items:o})}(o);n.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:n})},t.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.topn)return i(e,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},function(e,t,n){"use strict";var o=n(0),r=function e(t,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i=t&&n.push([o,r]),o=-1)}return e[i-1]&&i-o>=t&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(o,"\\$&").replace(n,"|")),i=e.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=O;E-=1){var R=E-1,U=n[e.charAt(R)];if(U&&(b[R]=1),P[E]=(P[E+1]<<1|1)&U,0!==I&&(P[E]|=(L[E+1]|L[E])<<1|1|L[E+1]),P[E]&N&&(C=o(t,{errors:I,currentLocation:R,expectedLocation:_,distance:c}))<=m){if(m=C,(y=R)<=_)break;O=Math.max(1,2*_-y)}}if(o(t,{errors:I+1,currentLocation:_,expectedLocation:_,distance:c})>m)break;L=P}return{isMatch:y>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");d=d.name}else a[d]={weight:1};this._analyze({key:d,value:this.options.getFn(u,d),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,h=t.fullSearcher,p=void 0===h?[]:h,d=t.resultMap,f=void 0===d?{}:d,v=t.results,_=void 0===v?[]:v;if(void 0!==i&&null!==i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=p.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],w=0;w-1&&(O=(O+m)/2),this._log("Score average:",O);var j=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log("\nCheck Matches: "+j),(g||k.isMatch)&&j){var P=f[l];P?P.output.push({key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}):(f[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}]},_.push(f[l]))}}else if(a(i))for(var E=0,R=i.length;E-1&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===T?a=[r]:a.push(r),o=i;var l=new e;return l.nodeName=t,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==P.push(e)&&(I.debounceRendering||O)(i)}function i(){var e,t=P;for(P=[];e=t.pop();)e.__d&&L(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===j.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,d,s):e.removeEventListener(t,d,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)p(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function p(e,t,n){try{e[t]=n}catch(e){}}function d(e){return this.__l[e.type](I.event&&I.event(e)||e)}function f(){for(var e;e=E.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function v(e,t,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=e&&!("__preactattr_"in e));var s=_(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||f()),s}function _(e,t,n,o,r){var i=e,s=U;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0))),i.__preactattr_=!0,i;var l=t.nodeName;if("function"==typeof l)return C(e,t,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!e||!a(e,l))&&(i=c(l,U),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0)}var u=i.firstChild,h=i.__preactattr_,p=t.children;if(null==h){h=i.__preactattr_={};for(var d=i.attributes,f=d.length;f--;)h[d[f].name]=d[f].value}return!D&&p&&1===p.length&&"string"==typeof p[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=p[0]&&(u.nodeValue=p[0]):(p&&p.length||null!=u)&&g(i,p,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,t.attributes,h),U=s,i}function g(e,t,n,o,r){var i,a,l,c,h,p=e.childNodes,d=[],f={},v=0,g=0,y=p.length,k=0,b=t?t.length:0;if(0!==y)for(L=0;L2?[].slice.call(arguments,2):e.children)},Component:N,render:function(e,t,n){return v(n,e,{},!1,t,!1)},rerender:i,options:I};void 0!==t?t.exports=F:self.preact=F}()},{}]},{},[1]); +//# sourceMappingURL=quick-jump.min.js.map diff --git a/docs/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html b/docs/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html new file mode 100644 index 0000000..aad1847 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html @@ -0,0 +1,25 @@ +
    {-|
    +Module    : Data.Map.Helpers
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Data.Map.Helpers
    +  ( groupBy
    +  , groupBy'
    +  ) where
    +
    +import qualified Data.Map.Strict as Map
    +import qualified Data.DList as DList
    +
    +groupBy :: Ord k => (a -> k) -> [a] -> Map.Map k [a]
    +groupBy keyFunc = groupBy' mkEntry
    +  where
    +    mkEntry a = (keyFunc a, a)
    +
    +groupBy' :: Ord k => (a -> (k, v)) -> [a] -> Map.Map k [v]
    +groupBy' mkEntry as = fmap DList.toList $ Map.fromListWith (flip DList.append) (fmap mkListEntry as)
    +  where
    +    mkListEntry a =
    +      let (k, v) = mkEntry a
    +       in (k, DList.singleton v)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html new file mode 100644 index 0000000..ca5298c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html @@ -0,0 +1,198 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Conduit
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Conduit
    +  ( selectConduit
    +#if MIN_VERSION_conduit(1,3,0)
    +  , streamPages
    +#endif
    +  ) where
    +
    +{-
    +  !!! WARNING !!!
    +
    +  Basically this entire file is forked using conditional compilation on the
    +  version of conduit that is being used. Only 'feedRows' is shared below, and
    +  even that needs a different type signature. If you're changing this file,
    +  you should probably take the time to run some earlier LTS versions to double
    +  check that conduit support works correctly with different library versions.
    +-}
    +
    +#if MIN_VERSION_conduit(1,3,0)
    +import Conduit
    +  ( Acquire
    +  , ReleaseType(..)
    +  , allocateAcquire
    +  , mkAcquire
    +  , mkAcquireType
    +  , yieldMany
    +  )
    +
    +import Control.Monad (void)
    +import Control.Monad.Catch
    +import Control.Monad.Trans
    +import Control.Monad.Trans.Resource (MonadResource, release)
    +import Data.Conduit
    +import Data.Pool
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Select
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Internal.Where
    +import Database.Orville.PostgreSQL.Pagination (Pagination(..), buildPagination)
    +
    +{-|
    +   'selectConduit' provides a way to stream the results of a 'Select' query
    +   from the database one by one using the conduit library. You can 'fuse' the
    +   conduit built by this function with your own conduit pipeline to handle rows
    +   individually in whatever fashion you need (e.g. turning them into rows of
    +   CSV). This is useful if you want to be able to process many rows one by one.
    +   You can aggregate the results however you require as part of the conduit
    +   processing and then use 'runConduit' (or 'runConduitRes') from the conduit
    +   library to execute the processing pipeline. Alternatively, your web server
    +   ('wai', 'servant', etc) may provide support for converting a conduit into a
    +   streaming HTTP response.
    +
    +   Beware: this function must load all the results into memory before streaming
    +   can begin. For why, see https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html.
    +   If memory use is a concern, try 'streamPages' instead.
    +  -}
    +selectConduit ::
    +     (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m)
    +  => Select row
    +  -> ConduitT () row m ()
    +selectConduit select = do
    +  pool <- ormEnvPool <$> lift getOrvilleEnv
    +  (releaseKey, query) <-
    +    allocateAcquire (acquireStatement pool (selectSql select))
    +  void $ liftIO $ execute query $ selectValues select
    +  result <- feedRows (selectBuilder select) query
    +  -- Note this doesn't use finally to release this, but it will be released
    +  -- automatically at the end of runResourceT. finally cannot be used here
    +  -- because Conduit doesn't offer MonadMask. Alternatively we could use
    +  -- withAllocate here, but that would require an UNLiftIO instance
    +  release releaseKey
    +  pure result
    +
    +acquireConnection :: Pool conn -> Acquire conn
    +acquireConnection pool =
    +  fst <$> mkAcquireType (takeResource pool) releaseConnection
    +  where
    +    releaseConnection (conn, local) releaseType =
    +      case releaseType of
    +        ReleaseEarly -> putResource local conn
    +        ReleaseNormal -> putResource local conn
    +        ReleaseException -> destroyResource pool local conn
    +
    +acquireStatement ::
    +     IConnection conn => Pool conn -> String -> Acquire Statement
    +acquireStatement pool sql = do
    +  conn <- acquireConnection pool
    +  mkAcquire (prepare conn sql) finish
    +#else
    +import qualified Control.Exception as E
    +import Control.Monad
    +import Control.Monad.Catch
    +import Control.Monad.Trans
    +import Data.Conduit
    +import Data.IORef
    +import Data.Pool
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Select
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +-- All the masking manual cleanup in this function amounts to a
    +-- poor man's ResourceT that I *hope* is correct. The constraints
    +-- hat lead to this are:
    +--
    +--   * The immediate purpose of conduit queries to to provide streaming
    +--     responses in a Happstack App
    +--
    +--   * Happstack does not offer a side-effect controlled streaming
    +--     response solution at the moment. It relies in Lazy Bytestrings
    +--
    +--   * The conduit lazy consume specifically warns that you need to
    +--     ensure you consume the whole list before ResourceT returns,
    +--     which I cannot guarantee in Happstack (in fact, I believe it
    +--     specifically will *not* happen that way)
    +--
    +--   * Data.Pool.withResource depends on MonadBaseControl, which
    +--     Conduit does not offer
    +--
    +--   * Conduit also does not offer MonadMask, so I cannot use
    +--     mask/restore in the normal way
    +--
    +-- So, we instead we mask exceptions while registering cleanup and
    +-- finish actions in vars while masked and then ensure those vars
    +-- are read and executed at the appropriate times.
    +--
    +-- Beware: this function must load all the results into memory before streaming
    +-- can begin. For why, see https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html.
    +-- If memory use is a concern, try 'streamPages' instead.
    +selectConduit ::
    +     (Monad m, MonadOrville conn m, MonadCatch m) => Select row -> Source m row
    +selectConduit select = do
    +  pool <- ormEnvPool <$> lift getOrvilleEnv
    +  cleanupRef <- liftIO $ newIORef (pure ())
    +  finishRef <- liftIO $ newIORef (pure ())
    +  let acquire =
    +        lift $
    +        liftIO $
    +        E.mask_ $ do
    +          (conn, local) <- takeResource pool
    +          writeIORef cleanupRef $ destroyResource pool local conn
    +          writeIORef finishRef $ putResource local conn
    +          pure conn
    +      runCleanup = liftIO $ join (readIORef cleanupRef)
    +      runFinish = liftIO $ join (readIORef finishRef)
    +      go = do
    +        conn <- acquire
    +        query <- liftIO $ prepare conn $ selectSql select
    +        addCleanup (const $ liftIO $ finish $ query) $ do
    +          void $ liftIO $ execute query $ selectValues select
    +          feedRows (selectBuilder select) query
    +  result <- go `onException` runCleanup
    +  runFinish
    +  pure result
    +#endif
    +
    +feedRows ::
    +#if MIN_VERSION_conduit(1,3,0)
    +     (Monad m, MonadIO m) => FromSql row -> Statement -> ConduitT () row m ()
    +#else
    +     (Monad m, MonadIO m) => FromSql row -> Statement -> Source m row
    +#endif
    +feedRows builder query = do
    +  row <- liftIO $ fetchRowAL query
    +  case runFromSql builder <$> row of
    +    Nothing -> pure ()
    +    Just (Left _) -> pure ()
    +    Just (Right r) -> yield r >> feedRows builder query
    +
    +#if MIN_VERSION_conduit(1,3,0)
    +-- | Build a conduit source that is fed by querying one page worth of results
    +-- at a time. When the last row of the last page is consumed, the stream ends.
    +streamPages :: (MonadOrville conn m, Bounded orderField, Enum orderField)
    +            => TableDefinition readEnt write key
    +            -> FieldDefinition NotNull orderField
    +            -> (readEnt -> orderField)
    +            -> Maybe WhereCondition
    +            -> Word -- ^ number of rows fetched per page
    +            -> ConduitT () readEnt m ()
    +streamPages tableDef orderField getOrderField mbWhereCond pageSize =
    +  loop =<< lift (buildPagination tableDef orderField getOrderField mbWhereCond pageSize)
    +    where
    +      loop pagination = do
    +        yieldMany (pageRows pagination)
    +        case pageNext pagination of
    +          Nothing -> pure ()
    +          Just nxtPage -> loop =<< lift nxtPage
    +#endif
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html new file mode 100644 index 0000000..f7adb73 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html @@ -0,0 +1,31 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Connection
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Connection
    +  ( createConnectionPool
    +  , Pool
    +  , Connection
    +  ) where
    +
    +import Data.Pool
    +import Data.Time
    +import Database.HDBC
    +import Database.HDBC.PostgreSQL
    +
    +{-|
    + 'createConnectionPool' allocates a pool of connections to a PosgreSQL
    + server. The returned pool can be used as the endpoint to
    + 'Database.Orville.PostgreSQL.Core.newOrvilleEnv'
    + to construct.
    +-}
    +createConnectionPool ::
    +     Int -- ^ Number of stripes in the connection pool
    +  -> NominalDiffTime -- ^ Linger time before closing an idle connection
    +  -> Int -- ^ Max number of connections to allocate per stripe
    +  -> String -- ^ A PostgreSQL connection string
    +  -> IO (Pool Connection)
    +createConnectionPool stripes linger maxRes connString =
    +  createPool (connectPostgreSQL' connString) disconnect stripes linger maxRes
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html new file mode 100644 index 0000000..6587373 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html @@ -0,0 +1,636 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Core
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +Migration Guide: Although not all exports are identical, most of the items in
    +this module can now be imported from @Orville.PostgreSQL@.
    +
    +Please note that the new LibPQ-based version of orville represents a complete
    +re-write of Orville from the ground up. As such many of the APIs have been
    +re-thought with the goal of providing stability and better experience long
    +term.
    +
    +Major changes:
    +
    +* The library no longer allows the connection type to vary. It is intended only
    +  to be used with PostgreSQL. Thus 'MonadOrville' and other types that used to
    +  have a @conn@ type parameter no longer have that parameter.
    +
    +* 'OrvilleT' has been removed in favor of simply using @ReaderT@. For trivial
    +  cases (i.e. @ReaderT@ over @IO@) a pre-packaged @Orville@ monad is provided.
    +
    +* In 'TableDefinition', the order of the type parameters has changed from
    +  @TableDefinition readEnity writeEntity key@ to @TableDefinition key
    +  writeEntity readEntity@. This make it more consistent with the order of these
    +  arguments in other types. 'TableParams' has been removed in favor of building
    +  a basic table definition with the require parameters first and adding or
    +  setting other optional items after initial construction.
    +
    +* 'RelationalMap' has been replaced by @SqlMarshaller@. Many functions have
    +  been renamed, but most functions have a direct or nearly direct translation
    +  from the old ones. See the docs on the individual functions such as
    +  'attrField' to see what has changed.
    +
    +* The auto-migration system is significantly improved. Standard indexes no
    +  longer need to be given explicit names. Indexes and constraints are now
    +  attached to 'TableDefinition' rather than being their own schema items.
    +  Indexes and constraints are no longer dropped explicitly -- they are dropped
    +  automatically by Orville when they have been removed from the table
    +  definiton.
    +
    +* A number of places that previously accepted @[]@ now require @NonEmpty@
    +  instead. This is done in places where an empty list would not be valid SQL.
    +  For examples of this change see 'insertRecordMany' and 'updateFields'.
    +
    +* 'whereAnd' and 'whereOr' (which took lists) have been replaced
    +  with binary boolean logic functions @andExpr@ and @orExpr@. These functions
    +  also have operator aliases (@(.&&)@, @(.||)@).
    +
    +The following items exported from this module have migration guide notes
    +available in their documentation:
    +
    +* 'TableDefinition'
    +* 'mkTableDefinition'
    +* 'TableParams'
    +* 'RelationalMap'
    +* 'fields'
    +* 'mapAttr'
    +* 'mapField'
    +* 'attrField'
    +* 'maybeMapper'
    +* 'prefixMap'
    +* 'partialMap'
    +* 'readOnlyMap'
    +* 'readOnlyField'
    +* 'OrvilleEnv'
    +* 'newOrvilleEnv'
    +* 'setStartTransactionSQL'
    +* 'aroundRunningQuery'
    +* 'addTransactionCallBack'
    +* 'OrvilleT'
    +* 'HasOrvilleContext'
    +* 'MonadOrville'
    +* 'runOrville'
    +* 'mapOrvilleT'
    +* 'MonadOrvilleControl'
    +* 'defaultLiftWithConnection'
    +* 'defaultLiftFinally'
    +* 'withCachedConnection'
    +* 'withTransaction'
    +* 'ColumnFlag'
    +* 'FieldDefinition'
    +* 'isFieldNullable'
    +* 'fieldOfType'
    +* 'textField'
    +* 'fixedTextField'
    +* 'unboundedTextField'
    +* 'dayField'
    +* 'utcTimeField'
    +* 'int32Field'
    +* 'int64Field'
    +* 'doubleField'
    +* 'boolField'
    +* 'automaticIdField'
    +* 'searchVectorField'
    +* 'nullableField'
    +* 'foreignKeyField'
    +* 'withFlag'
    +* 'withName'
    +* 'withConversion'
    +* 'fieldFromSql'
    +* 'fieldToSqlValue'
    +* 'SomeField'
    +* 'withPrefix'
    +* 'fieldFlags'
    +* 'uniqueIndex'
    +* 'simpleIndex'
    +* 'uniqueConstraint'
    +* 'dropConstraint'
    +* 'SchemaItem'
    +* 'SchemaDefinition'
    +* 'Record'
    +* 'WhereCondition'
    +* 'whereAnd'
    +* 'whereOr'
    +* 'whereIn'
    +* 'whereLike'
    +* 'whereLikeInsensitive'
    +* 'whereNotIn'
    +* 'whereQualified'
    +* 'whereRaw'
    +* 'whereToSql'
    +* 'isNull'
    +* 'isNotNull'
    +* 'migrateSchema'
    +* 'generateMigrationPlan'
    +* 'MigrationPlan'
    +* 'MigrationItem'
    +* 'migrationPlanItems'
    +* 'selectAll'
    +* 'selectFirst'
    +* 'deleteRecord'
    +* 'deleteWhere'
    +* 'findRecord'
    +* 'findRecords'
    +* 'findRecordsBy'
    +* 'insertRecord'
    +* 'insertRecordMany'
    +* 'insertRecordManyReturning'
    +* 'updateFields'
    +* 'updateRecord'
    +* 'createIndexesConcurrently'
    +* 'dropIndexesConcurrently'
    +
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +
    +module Database.Orville.PostgreSQL.Core
    +  ( TableDefinition(..) -- migration guide added
    +  , PrimaryKey
    +  , primaryKeyIn
    +  , primaryKeyEquals
    +  , primaryKeyDescription
    +  , primaryKeyToSql
    +  , primaryKey
    +  , compositePrimaryKey
    +  , primaryKeyPart
    +  , mkTableDefinition -- migration guide added
    +  , SqlType(..)
    +  , serial
    +  , bigserial
    +  , text
    +  , varText
    +  , unboundedText
    +  , integer
    +  , bigInteger
    +  , double
    +  , boolean
    +  , date
    +  , timestamp
    +  , textSearchVector
    +  , convertSqlType -- migration guide added
    +  , maybeConvertSqlType -- migration guide added
    +  , TableParams(..) -- migration guide added
    +  , RelationalMap -- migration guide added
    +  , fields -- migration guide added
    +  , mapAttr -- migration guide added
    +  , mapField -- migration guide added
    +  , attrField -- migration guide added
    +  , maybeMapper -- migration guide added
    +  , prefixMap -- migration guide added
    +  , partialMap -- migration guide added
    +  , readOnlyMap -- migration guide added
    +  , readOnlyField -- migration guide added
    +  , OrvilleEnv -- migration guide added
    +  , newOrvilleEnv -- migration guide added
    +  , setStartTransactionSQL -- migration guide added
    +  , aroundRunningQuery -- migration guide added
    +  , addTransactionCallBack -- migration guide added
    +  , ormEnvPool
    +  , TransactionEvent(..)
    +  , OrvilleT -- migration guide added
    +  , unOrvilleT
    +  , SqlValue
    +  , HasOrvilleContext(..) -- migration guide added
    +  , MonadOrville -- migration guide added
    +  , runOrville -- migration guide added
    +  , mapOrvilleT -- migration guide added
    +  , MonadOrvilleControl(..) -- migration guide added
    +  , defaultLiftWithConnection -- migration guide added
    +  , defaultLiftFinally -- migration guide added
    +  , QueryType(..)
    +  , withCachedConnection -- migration guide added
    +  , withTransaction -- migration guide added
    +  , ColumnFlag(..) -- migration guide added
    +  , ColumnDefault(toColumnDefaultSql)
    +  , Now(..)
    +  , FieldDefinition -- migration guide added
    +  , Nullable
    +  , NotNull
    +  , Nullability(..)
    +  , isFieldNullable -- migration guide added
    +  , fieldOfType -- migration guide added
    +  , textField -- migration guide added
    +  , fixedTextField -- migration guide added
    +  , unboundedTextField -- migration guide added
    +  , dayField -- migration guide added
    +  , utcTimeField -- migration guide added
    +  , int32Field -- migration guide added
    +  , int64Field -- migration guide added
    +  , doubleField -- migration guide added
    +  , boolField -- migration guide added
    +  , automaticIdField -- migration guide added
    +  , searchVectorField -- migration guide added
    +  , nullableField -- migration guide added
    +  , foreignKeyField -- migration guided added
    +  , withFlag -- migration guide added
    +  , withName -- migration guide added
    +  , withConversion -- migration guide added
    +  , fieldFromSql -- migration guide added
    +  , fieldToSqlValue -- migration guide added
    +  , SomeField(..) -- migration guide added
    +  , withPrefix -- migration guide added
    +  , fieldName
    +  , fieldType
    +  , fieldFlags -- migration guide added
    +  , IndexDefinition(..)
    +  , uniqueIndex -- migration guide added
    +  , simpleIndex -- migration guide added
    +  , simplePartialIndex
    +  , uniquePartialIndex
    +  , ConstraintDefinition(..)
    +  , SequenceDefinition(..)
    +  , uniqueConstraint -- migration guide added
    +  , dropConstraint -- migration guide added
    +  , FromSql
    +  , FromSqlError(..)
    +  , RowDataErrorDetails(..)
    +  , RowDataErrorReason(..)
    +  , MissingColumnDetails(..)
    +  , ConversionErrorDetails(..)
    +  , showFromSqlErrorMinimal
    +  , showFromSqlErrorForLogging
    +  , showSqlValueType
    +  , ColumnSpecifier(..)
    +  , col
    +  , ToSql
    +  , getField
    +  , getComponent
    +  , SchemaItem(..) -- migration guide added
    +  , SchemaDefinition -- migration guide added
    +  , Record -- migration guide added
    +  , CreatedAt
    +  , UpdatedAt
    +  , OccurredAt
    +  , TableComments
    +  , noComments
    +  , say
    +  , WhereCondition -- migration guide added
    +  , whereAnd -- migration guide added
    +  , whereOr -- migration guide added
    +  , whereIn -- migration guide added
    +  , whereLike -- migration guide added
    +  , whereLikeInsensitive -- migration guide added
    +  , whereNotIn -- migration guide added
    +  , whereQualified -- migration guide added
    +  , whereRaw -- migration guide added
    +  , whereToSql -- migration guide added
    +  , isNull -- migration guide added
    +  , isNotNull -- migration guide added
    +  , (.==)
    +  , (.<>)
    +  , (.<-)
    +  , (%==)
    +  , (.>)
    +  , (.>=)
    +  , (.<)
    +  , (.<=)
    +  , SelectOptions(..)
    +  , where_
    +  , distinct
    +  , order
    +  , limit
    +  , offset
    +  , groupBy
    +  , selectOptionsToSql
    +  , (<>)
    +  , FieldUpdate
    +  , fieldUpdate
    +  , (.:=)
    +  , OrderByClause(..)
    +  , SortDirection(..)
    +  , migrateSchema -- migration guide added
    +  , MigrationError(..)
    +  , generateMigrationPlan -- migration guide added
    +  , MigrationPlan -- migration guide added
    +  , MigrationItem(..) -- migration guide added
    +  , migrationPlanItems -- migration guide added
    +  , Pagination(..)
    +  , buildPagination
    +  , selectAll -- migration guide added
    +  , selectFirst -- migraiton guide added
    +  , deleteRecord -- migration guide added
    +  , deleteWhere -- migration guide added
    +  , findRecord -- migration guide added
    +  , findRecords -- migration guide added
    +  , findRecordsBy -- migration guide added
    +  , insertRecord -- migration guide added
    +  , insertRecordMany -- migration guide added
    +  , insertRecordManyReturning -- migration guide added
    +  , updateFields -- migration guide added
    +  , updateRecord -- migration guide added
    +  , sequenceNextVal
    +  , sequenceSetVal
    +  , sequenceCurrVal
    +  , createIndexesConcurrently -- migration guide added
    +  , dropIndexesConcurrently -- migration guide added
    +  ) where
    +
    +import Control.Monad (void, when)
    +import Control.Monad.Except
    +import Control.Monad.Reader
    +import Control.Monad.State
    +import Data.Convertible
    +import qualified Data.List as List
    +import qualified Data.Map.Strict as Map
    +import Data.Maybe (listToMaybe)
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import qualified Data.Map.Helpers as Map
    +import Database.Orville.PostgreSQL.Internal.ConstraintDefinition
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.FieldUpdate
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.GroupBy ()
    +import Database.Orville.PostgreSQL.Internal.IndexDefinition
    +import Database.Orville.PostgreSQL.Internal.MigrateSchema
    +import Database.Orville.PostgreSQL.Internal.MigrationError
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.OrderBy
    +import Database.Orville.PostgreSQL.Internal.PrimaryKey
    +import Database.Orville.PostgreSQL.Internal.RelationalMap
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +import Database.Orville.PostgreSQL.Internal.Sql
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +import Database.Orville.PostgreSQL.Internal.TableDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Internal.Where
    +import Database.Orville.PostgreSQL.Pagination
    +import Database.Orville.PostgreSQL.Raw
    +import Database.Orville.PostgreSQL.Select
    +
    +getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity ()
    +getField f = do
    +  value <- asks f
    +  sqlValues <- get
    +  put (convert value : sqlValues)
    +
    +{- |
    +  Migration Guide: @selectAll@ has been renamed to @findEntitiesBy@
    +-}
    +selectAll ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> m [readEntity]
    +selectAll tableDef = runSelect . selectQueryTable tableDef
    +
    +
    +{- |
    +  Migration Guide: @selectFirst@ has been renamed to @findFirstEntityBy@
    +-}
    +selectFirst ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> m (Maybe readEntity)
    +selectFirst tableDef opts =
    +  listToMaybe <$> selectAll tableDef (limit 1 <> opts)
    +
    +deleteWhereBuild ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [WhereCondition]
    +  -> m Integer
    +deleteWhereBuild tableDef conds = do
    +  let deleteSql = mkDeleteClause (tableName tableDef)
    +  let whereSql = whereClause conds
    +  let values = whereValues conds
    +  let querySql = deleteSql ++ " " ++ whereSql
    +  withConnection $ \conn -> do
    +    executingSql DeleteQuery querySql $ do run conn querySql values
    +
    +{- |
    +  Migration Guide: @deleteWhere@ has been renamed to @deleteEntities@. It
    +  now takes a @Maybe BooleanExpr@ rather than @[WhereCondition]@
    +-}
    +deleteWhere ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [WhereCondition]
    +  -> m Integer
    +deleteWhere tableDef = deleteWhereBuild tableDef
    +
    +{- |
    +  Migration Guide: @findRecords@ has been renamed to @findEntities@. It now
    +  requires a @NonEmpty key@ rather than simply @[key]@ and returns a
    +  @[readEntity]@ instead of a @Map@.
    +-}
    +findRecords ::
    +     (Ord key, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> [key]
    +  -> m (Map.Map key readEntity)
    +findRecords _ [] = return Map.empty
    +findRecords tableDef keys = do
    +  let keyDef = tablePrimaryKey tableDef
    +      mkEntry record = (tableGetKey tableDef record, record)
    +  recordList <- selectAll tableDef (where_ $ primaryKeyIn keyDef keys)
    +  pure $ Map.fromList (map mkEntry recordList)
    +
    +{- |
    +  Migration Guide: @findRecordsBy@ has been renamed to @findEntitiesBy@. It
    +  no longer takes a @FieldDefinition@ to group by. Instead it simply returns
    +  a @[readEntity]@
    +-}
    +findRecordsBy ::
    +     (Ord fieldValue, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> m (Map.Map fieldValue [readEntity])
    +findRecordsBy tableDef field opts = do
    +  let builder = (,) <$> fieldFromSql field <*> tableFromSql tableDef
    +      query = selectQuery builder (fromClauseTable tableDef) opts
    +  Map.groupBy' id <$> runSelect query
    +
    +{- |
    +  Migration Guide: @findRecord@ has been renamed to @findEntity@
    +-}
    +findRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> m (Maybe readEntity)
    +findRecord tableDef key =
    +  let keyDef = tablePrimaryKey tableDef
    +   in selectFirst tableDef (where_ $ primaryKeyEquals keyDef key)
    +
    +{- |
    +  Migration Guide: @updateFields@ has been renamed to
    +  @updateFieldsAndReturnRowCount@, but now takes a @NonEmpty SetClause@ instead
    +  of a @[Field Update]@ and a @Maybe BooleanExpr@ instead of a
    +  @[WhereCondition]@.
    +
    +  @updateFields@ still exists as a variant of this function, but returns @()@
    +  rather than @Int@. @updateFieldsAndReturnEntities@ is now available as well.
    +-}
    +updateFields ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [FieldUpdate]
    +  -> [WhereCondition]
    +  -> m Integer
    +updateFields tableDef updates conds =
    +  updateSql (updateClause ++ " " ++ condClause) (updateValues ++ condValues)
    +  where
    +    condClause = whereClause conds
    +    condValues = whereValues conds
    +    updateValues = map fieldUpdateValue updates
    +    updateNames = map fieldUpdateName updates
    +    updateClause = mkUpdateClause (tableName tableDef) updateNames
    +
    +{- |
    +  Migration Guide: @updateRecord@ has been renamed to @updateEntity. Note that
    +  there are also new variant functions @updateAndReturnEntity@ and
    +  @updateEntityAndReturnRowCount@.
    +-}
    +updateRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> writeEntity
    +  -> m ()
    +updateRecord tableDef key record = do
    +  let keyDef = tablePrimaryKey tableDef
    +      conds = [primaryKeyEquals keyDef key]
    +      fields = tableAssignableFields tableDef
    +      builder = tableToSql tableDef
    +      updates = zipWith FieldUpdate fields (runToSql builder record)
    +  void $ updateFields tableDef updates conds
    +
    +{- |
    +  Migration Guide: @insertRecord@ has been renamed to @insertAndReturnEntity@.
    +  Note there are also new variant functions @insertEntity@ and
    +  @insertEntityAndReturnRowCount@ that return @()@ and @Int@ respectively.
    +-}
    +insertRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> writeEntity
    +  -> m readEntity
    +insertRecord tableDef newRecord = do
    +  results <- insertRecordManyReturning tableDef [newRecord]
    +  case results of
    +    [entity] -> pure entity
    +    [] -> error "Didn't get a record back from the database!"
    +    _ -> error "Got more than one record back from the database!"
    +
    +{- |
    +  Migration Guide: @insertRecordManyReturning@ has been renamed to
    +  @insertAndReturnEntities@.
    +-}
    +insertRecordManyReturning ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [writeEntity]
    +  -> m [readEntity]
    +insertRecordManyReturning _ [] = pure []
    +insertRecordManyReturning tableDef newRecords = do
    +  let builder = tableFromSql tableDef
    +      returnSelects = expr <$> fromSqlSelects builder
    +      returnColumns =
    +        List.intercalate ", " $ map (rawExprToSql . generateSql) returnSelects
    +      insertSql =
    +        mkInsertManyClause
    +          (tableName tableDef)
    +          (tableAssignableColumnNames tableDef)
    +          (length newRecords) ++
    +        " RETURNING " ++ returnColumns
    +      vals = concatMap (runToSql $ tableToSql tableDef) newRecords
    +  rows <-
    +    withConnection $ \conn -> do
    +      executingSql InsertQuery insertSql $ do
    +        insert <- prepare conn insertSql
    +        void $ execute insert vals
    +        fetchAllRowsAL' insert
    +  decodeSqlRows builder rows
    +
    +{- |
    +  Migration Guide: @insertRecordMany@ has been renamed to @insertEntities@. It
    +  now requires a @NonEmpty writeEntity@ rather than @[writeEntity]@. Note that
    +  there are also new variant functions @insertAndReturnEntities@ and
    +  @insertEntitiesAndReturnRowCount@.
    +-}
    +insertRecordMany ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [writeEntity]
    +  -> m ()
    +insertRecordMany tableDef newRecords = do
    +  let insertSql =
    +        mkInsertManyClause
    +          (tableName tableDef)
    +          (tableAssignableColumnNames tableDef)
    +          (length newRecords)
    +  let builder = tableToSql tableDef
    +  when (not $ null newRecords) $
    +    withConnection $ \conn -> do
    +      executingSql InsertQuery insertSql $ do
    +        insert <- prepare conn insertSql
    +        void $ execute insert (concatMap (runToSql builder) newRecords)
    +
    +{- |
    +  Migration Guide: @deleteRecord@ has been renamed to @deleteEntity@. Note
    +  that there are also new variant functions @deleteAndReturnEntity@ and
    +  @deleteEntityAndReturnRowCount@ that return @Maybe readEntity@ and @Int@
    +  respectively.
    +-}
    +deleteRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> m ()
    +deleteRecord tableDef key = do
    +  let keyDef = tablePrimaryKey tableDef
    +  n <- deleteWhere tableDef [primaryKeyEquals keyDef key]
    +  if n /= 1
    +    then error $
    +         "Expected to delete exactly 1 row for deleteRecord\
    +               \but actually deleted" ++
    +         show n
    +    else pure ()
    +
    +sequenceNextVal ::
    +     MonadOrville conn m
    +  => SequenceDefinition
    +  -> m Int
    +sequenceNextVal seqDef = do
    +  n <- selectSql "SELECT nextval(?)"
    +                 [SqlString $ sequenceName seqDef]
    +                 (fieldFromSql $ int64Field "nextval")
    +  case n of
    +    [r] -> pure $ fromIntegral r
    +    _ -> error $ "Failed to execute nextval for sequence " ++ sequenceName seqDef ++ "!"
    +
    +sequenceSetVal ::
    +     MonadOrville conn m
    +  => SequenceDefinition
    +  -> Int
    +  -> m Int
    +sequenceSetVal seqDef v = do
    +  n <- selectSql "SELECT setval(?, ?)"
    +                 [SqlString $ sequenceName seqDef, SqlInt64 $ fromIntegral v]
    +                 (fieldFromSql $ int64Field "setval")
    +  case n of
    +    [r] -> pure $ fromIntegral r
    +    _ -> error $ "Failed to execute setval for sequence " ++ sequenceName seqDef ++ "!"
    +
    +sequenceCurrVal ::
    +     MonadOrville conn m
    +  => SequenceDefinition
    +  -> m Int
    +sequenceCurrVal seqDef = do
    +  n <- selectSql "SELECT currval(?)"
    +                 [SqlString $ sequenceName seqDef]
    +                 (fieldFromSql $ int64Field "currval")
    +  case n of
    +    [r] -> pure $ fromIntegral r
    +    _ -> error $ "Failed to get current value for sequence " ++ sequenceName seqDef ++ "!"
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html new file mode 100644 index 0000000..b404bc4 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html @@ -0,0 +1,24 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Expr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Expr
    +  ( RawExpr
    +  , rawSql
    +  , GenerateSql(..)
    +  , Expr
    +  , rawSqlExpr
    +  , expr
    +  , NameExpr
    +  , NameForm
    +  , unescapedName
    +  , SelectExpr
    +  , SelectForm(..)
    +  , selectColumn
    +  , qualified
    +  , aliased
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html new file mode 100644 index 0000000..4e3f80b --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html @@ -0,0 +1,46 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.ContraintDefinition
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.ConstraintDefinition
    +  ( uniqueConstraint
    +  , dropConstraint
    +  ) where
    +
    +import Data.List (intercalate)
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{- |
    +  Migration Guide: @uniqueConstraint@ no longer accepts a name parameter.
    +  Instead the constraint is migrated automatically based on the structure of
    +  existing constraints found in the database. It also no longer accepts a
    +  @TableDefinition@. Instead you should use @addTableConstraints@ to add the
    +  @ConstraintDefinition@ to the table that you wish to apply the constraint to.
    +-}
    +uniqueConstraint ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> [SomeField]
    +  -> ConstraintDefinition
    +uniqueConstraint name tableDef fields =
    +  ConstraintDefinition
    +    { constraintName = name
    +    , constraintTable = tableName tableDef
    +    , constraintBody =
    +        "UNIQUE (" ++ intercalate "," (map someEscapedFieldName fields) ++ ")"
    +    }
    +  where
    +    someEscapedFieldName (SomeField f) = escapedFieldName f
    +
    +{- |
    +  Migration Guide: @dropConstraint@ has been removed. Constraints are now
    +  dropped automatically during auto-migration when they are removed from the
    +  @TableDefinition@.
    +-}
    +dropConstraint ::
    +     TableDefinition readEntity writeEntity key -> String -> SchemaItem
    +dropConstraint tableDef = DropConstraint (tableName tableDef)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html new file mode 100644 index 0000000..b2cfc0d --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html @@ -0,0 +1,31 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Execute
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Execute where
    +
    +import Control.Monad.IO.Class
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Monad
    +
    +executingSql :: MonadOrville conn m => QueryType -> String -> IO a -> m a
    +executingSql queryType sql action = do
    +  runningQuery <-
    +    (\queryType -> ormEnvRunningQuery queryType)
    +      <$> getOrvilleEnv
    +  liftIO $ runningQuery queryType sql (catchSqlErr sql action)
    +
    +catchSqlErr :: String -> IO a -> IO a
    +catchSqlErr sql action =
    +  catchSql
    +    action
    +    (\e ->
    +       let updatedErr =
    +             SqlError
    +               (seState e)
    +               (seNativeError e)
    +               (seErrorMsg e ++ " SQL: " ++ sql)
    +        in throwSqlError updatedErr)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html new file mode 100644 index 0000000..8d4e977 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html @@ -0,0 +1,66 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.Expr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-#LANGUAGE CPP#-}
    +
    +module Database.Orville.PostgreSQL.Internal.Expr.Expr where
    +
    +import Data.String
    +
    +data RawExpr
    +  = RawExprString String
    +  | RawExprAppend RawExpr
    +                  RawExpr
    +  | RawExprConcat [RawExpr]
    +
    +rawSql :: String -> RawExpr
    +rawSql = RawExprString
    +
    +rawExprToSql :: RawExpr -> String
    +rawExprToSql = go ""
    +  where
    +    go rest (RawExprString s) = s ++ rest
    +    go rest (RawExprAppend r1 r2) = go (go rest r2) r1
    +    go rest (RawExprConcat exprs) = foldr (flip go) rest exprs
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup RawExpr where
    +  (<>) = RawExprAppend
    +#endif
    +
    +instance Monoid RawExpr where
    +  mempty = RawExprString ""
    +  mappend = RawExprAppend
    +  mconcat = RawExprConcat
    +
    +instance IsString RawExpr where
    +  fromString = rawSql
    +
    +newtype Expr a =
    +  Expr (Either RawExpr a)
    +
    +class QualifySql form where
    +  qualified :: form -> String -> form
    +
    +instance QualifySql a => QualifySql (Expr a) where
    +  qualified (Expr (Right a)) table = Expr . Right $ qualified a table
    +  qualified (Expr (Left raw)) _ = Expr . Left $ raw
    +
    +class GenerateSql expr where
    +  generateSql :: expr -> RawExpr
    +
    +instance GenerateSql RawExpr where
    +  generateSql = id
    +
    +instance GenerateSql a => GenerateSql (Expr a) where
    +  generateSql (Expr (Right a)) = generateSql a
    +  generateSql (Expr (Left raw)) = raw
    +
    +rawSqlExpr :: String -> Expr a
    +rawSqlExpr = Expr . Left . rawSql
    +
    +expr :: a -> Expr a
    +expr = Expr . Right
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html new file mode 100644 index 0000000..ad60a77 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html @@ -0,0 +1,41 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE OverloadedStrings #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Expr.NameExpr where
    +
    +import Data.String
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +
    +type NameExpr = Expr NameForm
    +
    +data NameForm = NameForm
    +  { nameFormTable :: Maybe String
    +  , nameFormName :: String
    +  } deriving (Eq, Ord)
    +
    +instance IsString NameForm where
    +  fromString str = NameForm {nameFormTable = Nothing, nameFormName = str}
    +
    +instance QualifySql NameForm where
    +  qualified form table = form {nameFormTable = Just table}
    +
    +instance QueryKeyable NameForm where
    +  queryKey = QKField . unescapedName
    +
    +instance GenerateSql NameForm where
    +  generateSql (NameForm Nothing name) = "\"" <> rawSql name <> "\""
    +  generateSql (NameForm (Just table) name) =
    +    "\"" <> rawSql table <> "\".\"" <> rawSql name <> "\""
    +
    +unescapedName :: NameForm -> String
    +unescapedName (NameForm Nothing name) = name
    +unescapedName (NameForm (Just table) name) = table <> "." <> name
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html new file mode 100644 index 0000000..3316264 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html @@ -0,0 +1,45 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.SelectExpr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE OverloadedStrings #-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Expr.SelectExpr where
    +
    +import Data.Maybe
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +
    +type SelectExpr = Expr SelectForm
    +
    +data SelectForm = SelectForm
    +  { selectFormColumn :: NameForm
    +  , selectFormAlias :: Maybe NameForm
    +  }
    +
    +selectColumn :: NameForm -> SelectForm
    +selectColumn name = SelectForm name Nothing
    +
    +selectFormOutput :: SelectForm -> NameForm
    +selectFormOutput = fromMaybe <$> selectFormColumn <*> selectFormAlias
    +
    +aliased :: SelectForm -> NameForm -> SelectForm
    +aliased sf name = sf {selectFormAlias = Just name}
    +
    +instance QualifySql SelectForm where
    +  qualified form table =
    +    form {selectFormColumn = (selectFormColumn form) `qualified` table}
    +
    +instance GenerateSql SelectForm where
    +  generateSql (SelectForm {..}) =
    +    generateSql selectFormColumn <> asOutput selectFormAlias
    +
    +asOutput :: Maybe NameForm -> RawExpr
    +asOutput Nothing = mempty
    +asOutput (Just name) = " AS " <> generateSql name
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html new file mode 100644 index 0000000..2ebfba6 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html @@ -0,0 +1,164 @@ +
    module Database.Orville.PostgreSQL.Internal.Expr.WhereExpr
    +  ( WhereExpr
    +  , WhereForm
    +  , (.==)
    +  , (.<>)
    +  , (.>)
    +  , (.>=)
    +  , (.<)
    +  , (.<=)
    +  , (%==)
    +  , (.<-)
    +  , whereValues
    +  , whereIn
    +  , whereNotIn
    +  , whereLike
    +  , whereLikeInsensitive
    +  , whereNull
    +  , whereNotNull
    +  , whereRaw
    +  ) where
    +
    +import qualified Data.List as List
    +
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +
    +type WhereExpr = Expr WhereForm
    +
    +data WhereForm
    +  = WhereAlwaysFalse
    +  | WhereAlwaysTrue
    +  | WhereBinOp String
    +               NameForm
    +               SqlValue
    +  | WhereIn NameForm
    +            [SqlValue]
    +  | WhereNotIn NameForm
    +               [SqlValue]
    +  | WhereLike NameForm
    +              SqlValue
    +  | WhereLikeInsensitive NameForm
    +                         SqlValue
    +  | WhereNull NameForm
    +  | WhereNotNull NameForm
    +  | WhereRaw String
    +             [SqlValue]
    +
    +instance QualifySql WhereForm where
    +  qualified cond@WhereAlwaysFalse _ = cond
    +  qualified cond@WhereAlwaysTrue _ = cond
    +  qualified (WhereBinOp op field value) table =
    +    WhereBinOp op (field `qualified` table) value
    +  qualified (WhereIn field values) table =
    +    WhereIn (field `qualified` table) values
    +  qualified (WhereNotIn field values) table =
    +    WhereNotIn (field `qualified` table) values
    +  qualified (WhereLike field value) table =
    +    WhereLike (field `qualified` table) value
    +  qualified (WhereLikeInsensitive field value) table =
    +    WhereLikeInsensitive (field `qualified` table) value
    +  qualified (WhereNull field) table = WhereNull (field `qualified` table)
    +  qualified (WhereNotNull field) table = WhereNotNull (field `qualified` table)
    +  qualified raw@(WhereRaw _ _) _ = raw
    +
    +instance QueryKeyable WhereForm where
    +  queryKey WhereAlwaysFalse = qkOp "FALSE" QKEmpty
    +  queryKey WhereAlwaysTrue = qkOp "TRUE" QKEmpty
    +  queryKey (WhereBinOp op field value) = qkOp2 op field value
    +  queryKey (WhereIn field values) = qkOp2 "IN" field values
    +  queryKey (WhereNotIn field values) = qkOp2 "NOT IN" field values
    +  queryKey (WhereLike field value) = qkOp2 "LIKE" field value
    +  queryKey (WhereLikeInsensitive field value) = qkOp2 "ILIKE" field value
    +  queryKey (WhereNull field) = qkOp "IS NULL" field
    +  queryKey (WhereNotNull field) = qkOp "NOT IS NULL" field
    +  queryKey (WhereRaw raw values) = qkOp raw values
    +
    +instance GenerateSql WhereForm where
    +  generateSql WhereAlwaysFalse = rawSql "TRUE = FALSE"
    +  generateSql WhereAlwaysTrue = rawSql "TRUE = TRUE"
    +  generateSql (WhereBinOp op field _) =
    +    (generateSql field) <> rawSql (" " <> op <> " ?")
    +  generateSql (WhereIn field values) =
    +    (generateSql field) <> rawSql (" IN (" <> quesses <> ")")
    +    where
    +      quesses = List.intercalate "," (map (const "?") values)
    +  generateSql (WhereNotIn field values) =
    +    (generateSql field) <> rawSql (" NOT IN (" <> quesses <> ")")
    +    where
    +      quesses = List.intercalate "," (map (const "?") values)
    +  generateSql (WhereLike field _) = (generateSql field) <> rawSql " LIKE ?"
    +  generateSql (WhereLikeInsensitive field _) =
    +    (generateSql field) <> rawSql " ILIKE ?"
    +  generateSql (WhereNull field) = (generateSql field) <> rawSql " IS NULL"
    +  generateSql (WhereNotNull field) =
    +    (generateSql field) <> rawSql " IS NOT NULL"
    +  generateSql (WhereRaw raw _) = rawSql raw
    +
    +(.==) :: NameForm -> SqlValue -> WhereForm
    +name .== value = WhereBinOp "=" name value
    +
    +(.<>) :: NameForm -> SqlValue -> WhereForm
    +name .<> value = WhereBinOp "<>" name value
    +
    +(.>) :: NameForm -> SqlValue -> WhereForm
    +name .> value = WhereBinOp ">" name value
    +
    +(.>=) :: NameForm -> SqlValue -> WhereForm
    +name .>= value = WhereBinOp ">=" name value
    +
    +(.<) :: NameForm -> SqlValue -> WhereForm
    +name .< value = WhereBinOp "<" name value
    +
    +(.<=) :: NameForm -> SqlValue -> WhereForm
    +name .<= value = WhereBinOp "<=" name value
    +
    +(%==) :: NameForm -> SqlValue -> WhereForm
    +name %== value = WhereBinOp "@@" name value
    +
    +(.<-) :: NameForm -> [SqlValue] -> WhereForm
    +name .<- values = whereIn name values
    +
    +whereIn :: NameForm -> [SqlValue] -> WhereForm
    +whereIn _ [] = WhereAlwaysFalse
    +whereIn field values = WhereIn field (List.nub values)
    +
    +whereNotIn :: NameForm -> [SqlValue] -> WhereForm
    +whereNotIn _ [] = WhereAlwaysTrue
    +whereNotIn field values = WhereNotIn field (List.nub values)
    +
    +whereLike :: NameForm -> SqlValue -> WhereForm
    +whereLike = WhereLike
    +
    +whereLikeInsensitive :: NameForm -> SqlValue -> WhereForm
    +whereLikeInsensitive = WhereLikeInsensitive
    +
    +whereNull :: NameForm -> WhereForm
    +whereNull = WhereNull
    +
    +whereNotNull :: NameForm -> WhereForm
    +whereNotNull = WhereNotNull
    +
    +whereRaw :: String -> [SqlValue] -> WhereForm
    +whereRaw = WhereRaw
    +
    +whereValues :: [WhereForm] -> [SqlValue]
    +whereValues = List.concatMap whereValuesInternal
    +
    +whereValuesInternal :: WhereForm -> [SqlValue]
    +whereValuesInternal (WhereAlwaysFalse) = []
    +whereValuesInternal (WhereAlwaysTrue) = []
    +whereValuesInternal (WhereBinOp _ _ value) = [value]
    +whereValuesInternal (WhereIn _ values) = values
    +whereValuesInternal (WhereNotIn _ values) = values
    +whereValuesInternal (WhereLike _ value) = [value]
    +whereValuesInternal (WhereLikeInsensitive _ value) = [value]
    +whereValuesInternal (WhereNull _) = []
    +whereValuesInternal (WhereNotNull _) = []
    +whereValuesInternal (WhereRaw _ values) = values
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html new file mode 100644 index 0000000..b3309ec --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html @@ -0,0 +1,15 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Expr
    +  ( module Database.Orville.PostgreSQL.Internal.Expr.Expr
    +  , module Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +  , module Database.Orville.PostgreSQL.Internal.Expr.SelectExpr
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +import Database.Orville.PostgreSQL.Internal.Expr.SelectExpr
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html new file mode 100644 index 0000000..695d84b --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html @@ -0,0 +1,235 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FieldDefintion
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.FieldDefinition where
    +
    +import Data.Int (Int32, Int64)
    +import Data.Text (Text)
    +import Data.Time (Day, UTCTime)
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr (NameForm(..))
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{- |
    +  Migration Guide: @textField@ has been renamed to @boundedTextField@. It now
    +  takes an @Int32@ rather than an @Int@
    +-}
    +textField :: String -> Int -> FieldDefinition NotNull Text
    +textField name len = fieldOfType (varText len) name
    +
    +{- |
    +  Migration Guide: @fixedTextField@ retains the same name. It now
    +  takes an @Int32@ rather than an @Int@
    +-}
    +fixedTextField :: String -> Int -> FieldDefinition NotNull Text
    +fixedTextField name len = fieldOfType (text len) name
    +
    +{- |
    +  Migration Guide: @unboundedTextField@ retains the same name.
    +-}
    +unboundedTextField :: String -> FieldDefinition NotNull Text
    +unboundedTextField = fieldOfType unboundedText
    +
    +{- |
    +  Migration Guide: @dayField@ has been renamed to @dateField@
    +-}
    +dayField :: String -> FieldDefinition NotNull Day
    +dayField = fieldOfType date
    +
    +{- |
    +  Migration Guide: @utcTimeField@ has been renamed to @utcTimestampField@
    +-}
    +utcTimeField :: String -> FieldDefinition NotNull UTCTime
    +utcTimeField = fieldOfType timestamp
    +
    +{- |
    +  Migration guide: @int32Field@ has been renamed to @integerField@
    +-}
    +int32Field :: String -> FieldDefinition NotNull Int32
    +int32Field = fieldOfType integer
    +
    +{- |
    +  Migration guide: @int64Field@ has been renamed to @bigIntegerField@
    +-}
    +int64Field :: String -> FieldDefinition NotNull Int64
    +int64Field = fieldOfType bigInteger
    +
    +{- |
    +  Migration guide: @doubleField@ retains the same name.
    +-}
    +doubleField :: String -> FieldDefinition NotNull Double
    +doubleField = fieldOfType double
    +
    +{- |
    +  Migration guide: @boolField@ has been renamed to @booleanField@
    +-}
    +boolField :: String -> FieldDefinition NotNull Bool
    +boolField = fieldOfType boolean
    +
    +{- |
    +  Migration guide: @automaticIdField@ has been renamed to @serialField@
    +-}
    +automaticIdField :: String -> FieldDefinition NotNull Int32
    +automaticIdField = fieldOfType serial
    +
    +{- |
    +  Migration guide: @searchVectorField@ has been renamed to @textSearchVectorField@
    +-}
    +searchVectorField :: String -> FieldDefinition NotNull Text
    +searchVectorField = fieldOfType textSearchVector
    +
    +{-|
    +  Migration Guide: @nullableField@ retains the same name
    +
    +  Makes a 'NotNull' field 'Nullable' by wrapping the Haskell type of the field
    +  in 'Maybe'. The field will be marked as 'NULL' in the database schema and
    +  the value 'Nothing' will be used to represent 'NULL' values when converting
    +  to and from sql.
    +-}
    +nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a)
    +nullableField field =
    +  let
    +    nullableType sqlType =
    +      sqlType
    +        { sqlTypeToSql = maybe SqlNull (sqlTypeToSql sqlType)
    +        , sqlTypeFromSql =
    +            \sql ->
    +              case sql of
    +                SqlNull ->
    +                  Right Nothing
    +
    +                _ ->
    +                  Just <$> sqlTypeFromSql sqlType sql
    +        }
    +  in
    +    FieldDefinition
    +      (fieldName field)
    +      (nullableType $ fieldType field)
    +      (fieldFlags field)
    +      Nullable
    +
    +{-|
    +  Adds a `Maybe` wrapper to a field that is already nullable. (If your field is
    +  'NotNull', you wanted 'nullableField' instead of this function). Note that
    +  fields created using this function have asymetric encoding and decoding of
    +  'NULL' values. Because the provided field is 'Nullable', 'NULL' values decode
    +  from the database already have a representation in the 'a' type, so 'NULL'
    +  will be decoded as 'Just <value of type a for NULL>'. This means if you
    +  insert a 'Nothing' value using the field, it will be read back as 'Just'
    +  value. This is useful for building high level combinators that might need to
    +  make fields 'Nullable' but need the value to be decoded in its underlying
    +  type when reading back (e.g. 'maybeMapper' from 'RelationalMap').
    +-}
    +asymmetricNullableField :: FieldDefinition Nullable a -> FieldDefinition Nullable (Maybe a)
    +asymmetricNullableField field =
    +  let
    +    nullableType sqlType =
    +      sqlType
    +        { sqlTypeToSql = maybe SqlNull (sqlTypeToSql sqlType)
    +        , sqlTypeFromSql = \sql -> Just <$> sqlTypeFromSql sqlType sql
    +        }
    +  in
    +    FieldDefinition
    +      (fieldName field)
    +      (nullableType $ fieldType field)
    +      (fieldFlags field)
    +      Nullable
    +
    +{- |
    +  Migration Guide: @isFieldNullable@ has been replaced with
    +  @fieldIsNotNullable@, which has the same signture but the @Bool@ returned is
    +  the opposite.
    +-}
    +isFieldNullable :: FieldDefinition nullability a -> Bool
    +isFieldNullable field =
    +  case checkNullability field of
    +    NullableField _ -> True
    +    NotNullField _ -> False
    +
    +{- |
    +  Migration Guide: @foreignKeyField@ has been removed. It is replaced by
    +  @addForeignKeyConstraint@ which adds a foreign key constraint to an existing
    +  @FieldDefinition@.
    +-}
    +foreignKeyField ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability key
    +  -> FieldDefinition nullability key
    +foreignKeyField name refTable refField =
    +  FieldDefinition
    +    name
    +    (foreignRefType $ fieldType refField)
    +    [References refTable refField]
    +    (fieldNullability refField)
    +
    +{- |
    +  Migration Guide: @fieldOfType@ is essentially unchanged in the new orville.
    +-}
    +fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a
    +fieldOfType sqlType name =
    +  FieldDefinition
    +    name
    +    sqlType
    +    []
    +    NotNull
    +
    +isAssignedByDatabase :: ColumnFlag -> Bool
    +isAssignedByDatabase AssignedByDatabase = True
    +isAssignedByDatabase _ = False
    +
    +escapedFieldName :: FieldDefinition nullability a -> String
    +escapedFieldName field = "\"" ++ fieldName field ++ "\""
    +
    +{- |
    +  Migration Guide: @withFlag@ has been removed. See the migration guide
    +  on 'ColumnFlag' regarding the new API.
    +-}
    +withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a
    +withFlag field newFlag = field {fieldFlags = newFlag : fieldFlags field}
    +
    +{- |
    +  Migration Guide: @withName@ has been removed.
    +-}
    +withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a
    +withName field newName = field {fieldName = newName}
    +
    +{- |
    +  Migration Guide: @withConversion@ has been replaced with @convertField@,
    +  whose arguments are flipped from those of @withConversion@. Note there is
    +  also now a @coerceField@ function that can be used with @newtype@ wrappers,
    +  provided the constructor is available where @coerceField@ is used.
    +-}
    +withConversion ::
    +     FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b
    +withConversion field mapType = field {fieldType = mapType $ fieldType field}
    +
    +isAssignedByDatabaseField :: FieldDefinition nullability a -> Bool
    +isAssignedByDatabaseField field = any isAssignedByDatabase $ fieldFlags field
    +
    +{- |
    +  Migration Guide: @withPrefix@ has been replaced by @prefixField@ whose
    +  arguments are flipped relative to @withPrefix@
    +-}
    +withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a
    +withPrefix field prefix = field `withName` (prefix ++ "_" ++ fieldName field)
    +
    +fieldToNameForm :: FieldDefinition nullability a -> NameForm
    +fieldToNameForm field = NameForm Nothing (fieldName field)
    +
    +{- |
    +  Migration Guide: @fieldToSqlValue@ has been renamed to @fieldValueToSqlValue@
    +-}
    +fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue
    +fieldToSqlValue = sqlTypeToSql . fieldType
    +
    +{- |
    +  Migration Guide: @fieldFromSqlValue@ has been renamed to @fieldValueFromSqlValue@
    +-}
    +fieldFromSqlValue :: FieldDefinition nullability a -> SqlValue -> Either RowDataErrorReason a
    +fieldFromSqlValue = sqlTypeFromSql . fieldType
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html new file mode 100644 index 0000000..5a5121c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html @@ -0,0 +1,24 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FieldUpdate
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +
    +module Database.Orville.PostgreSQL.Internal.FieldUpdate where
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +fieldUpdate :: FieldDefinition nullability a -> a -> FieldUpdate
    +fieldUpdate fieldDef a =
    +  FieldUpdate (SomeField fieldDef) (fieldToSqlValue fieldDef a)
    +
    +(.:=) :: FieldDefinition nullability a -> a -> FieldUpdate
    +(.:=) = fieldUpdate
    +
    +fieldUpdateName :: FieldUpdate -> String
    +fieldUpdateName = someFieldName . fieldUpdateField
    +  where
    +    someFieldName (SomeField f) = fieldName f
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html new file mode 100644 index 0000000..2fcabe0 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html @@ -0,0 +1,25 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FromClause
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.FromClause where
    +
    +import Database.Orville.PostgreSQL.Internal.Sql
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +newtype FromClause =
    +  FromClause String
    +
    +fromClauseRaw :: String -> FromClause
    +fromClauseRaw = FromClause
    +
    +fromClauseTableName :: String -> FromClause
    +fromClauseTableName name = fromClauseRaw ("FROM " ++ escapedName name)
    +
    +fromClauseTable :: TableDefinition readEntity writeEntity key -> FromClause
    +fromClauseTable = fromClauseTableName . tableName
    +
    +fromClauseToSql :: FromClause -> String
    +fromClauseToSql (FromClause sql) = sql
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html new file mode 100644 index 0000000..22d0b81 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html @@ -0,0 +1,90 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FromSql
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.FromSql where
    +
    +import Control.Exception.Lifted (throw)
    +import Control.Monad
    +import qualified Data.ByteString.Char8 as BS
    +import qualified Data.ByteString.Lazy.Char8 as LBS
    +import Data.Convertible
    +import Data.Maybe
    +import Data.String (fromString)
    +import qualified Data.Text as T
    +import qualified Data.Text.Lazy as LT
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +convertFromSql :: Convertible SqlValue a => SqlValue -> Either FromSqlError a
    +convertFromSql =
    +  either (Left . simpleConversionError . prettyConvertError) Right . safeConvert
    +
    +col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a
    +col spec = joinFromSqlError (convertFromSql <$> getColumn (selectForm spec))
    +
    +{- |
    +  Migration Guide: @fieldFromSql@ has been replaced with @fieldValueFromSqlValue@
    +-}
    +fieldFromSql :: FieldDefinition nullability a -> FromSql a
    +fieldFromSql field =
    +  joinFromSqlError (fromSqlValue <$> getColumn (selectForm field))
    +  where
    +    fromSqlValue sql =
    +      case fieldFromSqlValue field sql of
    +        Right a -> Right a
    +        Left err ->
    +          Left $
    +          RowDataError
    +            RowDataErrorDetails
    +              { rowErrorReason = err
    +              , rowErrorColumnName = fieldName field
    +              , rowErrorPrimaryKeys = []
    +              }
    +
    +class ColumnSpecifier col where
    +  selectForm :: col -> SelectForm
    +
    +instance ColumnSpecifier SelectForm where
    +  selectForm = id
    +
    +instance ColumnSpecifier NameForm where
    +  selectForm = selectColumn
    +
    +instance ColumnSpecifier (FieldDefinition nullability a) where
    +  selectForm = selectColumn . fromString . fieldName
    +
    +instance ColumnSpecifier [Char] where
    +  selectForm = selectColumn . fromString
    +
    +instance ColumnSpecifier T.Text where
    +  selectForm = selectColumn . fromString . T.unpack
    +
    +instance ColumnSpecifier LT.Text where
    +  selectForm = selectColumn . fromString . LT.unpack
    +
    +instance ColumnSpecifier BS.ByteString where
    +  selectForm = selectColumn . fromString . BS.unpack
    +
    +instance ColumnSpecifier LBS.ByteString where
    +  selectForm = selectColumn . fromString . LBS.unpack
    +
    +type ResultSet = [[(String, SqlValue)]]
    +
    +decodeSqlRows ::
    +     MonadOrville conn m => FromSql result -> ResultSet -> m [result]
    +decodeSqlRows builder rows =
    +  fmap catMaybes $
    +  forM rows $ \row -> do
    +    case runFromSql builder row of
    +      Right result -> pure $ Just result
    +      Left err -> throw err
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html new file mode 100644 index 0000000..dc850ad --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html @@ -0,0 +1,36 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.GroupBy
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.GroupBy where
    +
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data GroupByClause =
    +  GroupByClause String
    +                [SqlValue]
    +
    +instance QueryKeyable GroupByClause where
    +  queryKey (GroupByClause sql vals) = QKList [QKField sql, queryKey vals]
    +
    +groupingSql :: GroupByClause -> String
    +groupingSql (GroupByClause sql _) = sql ++ " "
    +
    +groupingValues :: GroupByClause -> [SqlValue]
    +groupingValues (GroupByClause _ values) = values
    +
    +class ToGroupBy a where
    +  toGroupBy :: a -> GroupByClause
    +
    +instance ToGroupBy (FieldDefinition nullability a) where
    +  toGroupBy fieldDef = GroupByClause (fieldName fieldDef) []
    +
    +instance ToGroupBy (String, [SqlValue]) where
    +  toGroupBy (sql, values) = GroupByClause sql values
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html new file mode 100644 index 0000000..029cdbc --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html @@ -0,0 +1,103 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.IndexDefinition
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.IndexDefinition
    +  ( uniqueIndex
    +  , simpleIndex
    +  , simplePartialIndex
    +  , uniquePartialIndex
    +  ) where
    +
    +import Data.List (intercalate)
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{- |
    +  Migration Guide: @uniqueIndex@ no longer requires a name to be specified.
    +  Migration will be done automatically by inspecting the structure of the
    +  indexes that exist in the database. It also no longer accepts a
    +  @TableDefinition@ at the time of creating the @IndexDefinition@. Instead you
    +  should use @addTableIndexes@ to add the @IndexDefinition@ to the
    +  @TableDefinition@ for the table that you wish to index.
    +
    +  If you wish to specify the index name explicitly, you can use
    +  @uniqueNamedIndex@ instead. If you do so, index migration will be managed by
    +  comparing to the names of existing indexes rather than checking that the
    +  index structure matches the Haskell definition.
    +-}
    +uniqueIndex ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> [SomeField]
    +  -> IndexDefinition
    +uniqueIndex name tableDef fields =
    +  mkIndexDefinition True name tableDef fields []
    +
    +{- |
    +  Migration Guide: @simpleIndex@ has been renamed to @nonUniqueIndex@. It no
    +  longer requires a name to be specified. Migration will be done automatically
    +  be inspecting the structure of the indexes that exist in the database. It
    +  also no longer accepts a @TableDefinition@ at the time of creating the
    +  @IndexDefinition@. Instead you should use @addTableIndexes@ to add the
    +  @IndexDefinition@ to the @TableDefinition@ for the table that you wish to
    +  index.
    +
    +  If you wish to specify the index name explicitly, you can use
    +  @nonUniqueNamedIndex@ instead. If you do so, index migration will be managed
    +  by comparing to the names of existing indexes rather than checking that the
    +  index structure matches the Haskell definition.
    +-}
    +simpleIndex ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> [SomeField]
    +  -> IndexDefinition
    +simpleIndex name tableDef fields =
    +  mkIndexDefinition False name tableDef fields []
    +
    +indexFieldsBody :: [SomeField] -> String
    +indexFieldsBody fields = "(" ++ intercalate "," (map name fields) ++ ")"
    +  where
    +    name (SomeField field) = escapedFieldName field
    +
    +-- | Works much the same as `uniqueIndex` but takes a list of strings that are the conditions of a
    +-- where clause on index creation for partial indexes
    +uniquePartialIndex :: String
    +                   -> TableDefinition readEntity writeEntity key
    +                   -> [SomeField]
    +                   -> [String]
    +                   -> IndexDefinition
    +uniquePartialIndex =
    +  mkIndexDefinition True
    +
    +-- | Works much the same as `simpleIndex` but takes a list of strings that are the conditions of a
    +-- where clause on index creation for partial indexes
    +simplePartialIndex :: String
    +                   -> TableDefinition readEntity writeEntity key
    +                   -> [SomeField]
    +                   -> [String]
    +                   -> IndexDefinition
    +simplePartialIndex =
    +  mkIndexDefinition False
    +
    +mkIndexDefinition :: Bool
    +                  -> String
    +                  -> TableDefinition readEntity writeEntity key
    +                  -> [SomeField]
    +                  -> [String]
    +                  -> IndexDefinition
    +mkIndexDefinition unique name tableDef fields whereStrs =
    +  let
    +    whereStr [] = ""
    +    whereStr strs = "WHERE " <> intercalate " AND " (fmap (\a -> "(" <> a <> ")") strs)
    +  in
    +    IndexDefinition
    +      { indexName = name
    +      , indexUnique = unique
    +      , indexTable = tableName tableDef
    +      , indexBody = indexFieldsBody fields <> whereStr whereStrs
    +      }
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html new file mode 100644 index 0000000..ede6c98 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html @@ -0,0 +1,15 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MappendCompat
    +  ( (<>)
    +  ) where
    +#if MIN_VERSION_base(4,11,0)
    +#else
    +import Data.Monoid ((<>))
    +#endif
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html new file mode 100644 index 0000000..df92905 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html @@ -0,0 +1,51 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateConstraint
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateConstraint
    +  ( createConstraintPlan
    +  , dropConstraintPlan
    +  ) where
    +
    +import Control.Monad
    +import Data.List
    +
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +createConstraintPlan ::
    +     ConstraintDefinition -> SchemaState -> Maybe MigrationPlan
    +createConstraintPlan constraintDef schemaState = do
    +  guard
    +    (not $
    +     schemaStateConstraintExists (constraintName constraintDef) schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (Constraint constraintDef)
    +      (intercalate
    +         " "
    +         [ "ALTER TABLE"
    +         , "\"" ++ constraintTable constraintDef ++ "\""
    +         , "ADD CONSTRAINT"
    +         , "\"" ++ constraintName constraintDef ++ "\""
    +         , constraintBody constraintDef
    +         ])
    +
    +dropConstraintPlan :: String -> String -> SchemaState -> Maybe MigrationPlan
    +dropConstraintPlan tableName constraintName schemaState = do
    +  guard (schemaStateConstraintExists constraintName schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (DropConstraint tableName constraintName)
    +      (intercalate
    +         " "
    +         [ "ALTER TABLE"
    +         , "\"" ++ tableName ++ "\""
    +         , "DROP CONSTRAINT"
    +         , "\"" ++ constraintName ++ "\""
    +         ])
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html new file mode 100644 index 0000000..8493cac --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html @@ -0,0 +1,45 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateIndex
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateIndex
    +  ( createIndexPlan
    +  , dropIndexPlan
    +  ) where
    +
    +import Control.Monad
    +import Data.List
    +
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +createIndexPlan :: IndexDefinition -> SchemaState -> Maybe MigrationPlan
    +createIndexPlan indexDef schemaState = do
    +  guard (not $ schemaStateIndexExists (indexName indexDef) schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (Index indexDef)
    +      (intercalate
    +         " "
    +         [ "CREATE"
    +         , if indexUnique indexDef
    +             then "UNIQUE"
    +             else ""
    +         , "INDEX"
    +         , "\"" ++ indexName indexDef ++ "\""
    +         , "ON"
    +         , "\"" ++ indexTable indexDef ++ "\""
    +         , indexBody indexDef
    +         ])
    +
    +dropIndexPlan :: String -> SchemaState -> Maybe MigrationPlan
    +dropIndexPlan name schemaState = do
    +  guard (schemaStateIndexExists name schemaState)
    +  -- Here we drop the index only if it exists so that during the migration plan
    +  -- should something else prior cause the index to be dropped we will not cause an error.
    +  pure $ migrationDDLForItem (DropIndex name) ("DROP INDEX IF EXISTS " ++ "\"" ++ name ++ "\"")
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html new file mode 100644 index 0000000..81f6300 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html @@ -0,0 +1,253 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateSchema
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE DeriveDataTypeable #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateSchema
    +  ( migrateSchema
    +  , generateMigrationPlan
    +  , createIndexesConcurrently
    +  , dropIndexesConcurrently
    +  ) where
    +
    +import Control.Concurrent (threadDelay)
    +import qualified Control.Exception as Exc
    +import Control.Monad
    +import Control.Monad.Catch
    +import Control.Monad.IO.Class
    +import Data.Foldable
    +import Data.Int
    +import Data.List
    +import Data.String
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FromClause
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.MigrateConstraint
    +import Database.Orville.PostgreSQL.Internal.MigrateIndex
    +import Database.Orville.PostgreSQL.Internal.MigrateSequence
    +import Database.Orville.PostgreSQL.Internal.MigrateTable
    +import Database.Orville.PostgreSQL.Internal.MigrationError
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Select
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Raw
    +import Database.Orville.PostgreSQL.Select
    +
    +orvilleLockScope :: Int32
    +orvilleLockScope = 17772
    +
    +migrationLockId :: Int32
    +migrationLockId = 7995632
    +
    +tryLockExpr :: SelectExpr
    +tryLockExpr =
    +  rawSqlExpr $
    +  "pg_try_advisory_xact_lock(" <> fromString (show orvilleLockScope) <> "," <>
    +  fromString (show migrationLockId) <>
    +  ") as result"
    +
    +waitForLockExpr :: SelectExpr
    +waitForLockExpr =
    +  rawSqlExpr $
    +  "pg_advisory_xact_lock(" <> fromString (show orvilleLockScope) <> "," <>
    +  fromString (show migrationLockId) <>
    +  ") as result"
    +
    +lockResult :: FromSql Bool
    +lockResult = col ("result" :: String)
    +
    +withLockedTransaction :: (MonadOrville conn m, MonadThrow m) => m a -> m a
    +withLockedTransaction action = do
    +  go (0 :: Int)
    +  where
    +    go attempts = do
    +      result <- runWithTransaction
    +      case result of
    +        Just a -> pure a
    +        Nothing -> do
    +          when (attempts >= 25) $ do
    +            throwM $
    +              MigrationLockExcessiveRetryError
    +                "Giving up after 25 attempts to aquire the migration lock."
    +          liftIO $ threadDelay 10000
    +          go $ attempts + 1
    +    runWithTransaction =
    +      withTransaction $ do
    +        [locked] <-
    +          runSelect $
    +          selectQueryColumns [tryLockExpr] lockResult (fromClauseRaw "") mempty
    +        if locked
    +          then Just <$> action
    +          else do
    +            void $
    +              runSelect $
    +              selectQueryColumns
    +                [waitForLockExpr]
    +                (pure ())
    +                (fromClauseRaw "")
    +                mempty
    +            pure Nothing
    +
    +{-|
    +   Migration Guide: @migrateSchema@ has been renamed to @autoMigrateSchema@
    +
    +   migrateSchema will attempt to make changes to the actual database schema
    +   that it it matches the provided SchemaDefinition. Unsafe migrations such as
    +   dropping tables or columns are never attempted unless the SchemaDefinition
    +   explicitly states that the items are safe to drop. Column types may be changed,
    +   but will fail if the database cannot successfully make the request type change.
    +  -}
    +migrateSchema :: MonadOrville conn m => SchemaDefinition -> m ()
    +migrateSchema schemaDef =
    +  withConnection $ \conn -> do
    +    withLockedTransaction $ do
    +      plan <- nonTransactionallyGenerateMigrationPlan conn schemaDef
    +      case plan of
    +        Nothing -> pure ()
    +        Just somethingToDo ->
    +          nonTransactionallyExecuteMigrationPlan conn somethingToDo
    +
    +{-|
    +   Migration Guide: @generateMigrationPlan@ retains the same name. It has
    +   changed to always return a @MigrationPlan@. You can use check whether
    +   @migrationPlanSteps@ is as empty list if you wish to determine whether any
    +   migrations will be performed by the plan.
    +
    +
    +   generateMigrationPlan inspects the state of the actual database schema and
    +   constructs a plan describing what changes would be made to make it match the
    +   provided SchemaDefinition. If the actual schema already matches the
    +   definition, Nothing will be returned.
    + -}
    +generateMigrationPlan ::
    +     MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan)
    +generateMigrationPlan schemaDef =
    +  withConnection $ \conn -> do
    +    withLockedTransaction $ do
    +      nonTransactionallyGenerateMigrationPlan conn schemaDef
    +
    +nonTransactionallyGenerateMigrationPlan ::
    +     MonadOrville conn m => conn -> SchemaDefinition -> m (Maybe MigrationPlan)
    +nonTransactionallyGenerateMigrationPlan conn schemaDef =
    +  liftIO $ buildMigrationPlan schemaDef <$> loadSchemaState conn
    +
    +nonTransactionallyExecuteMigrationPlan ::
    +     MonadOrville conn m => conn -> MigrationPlan -> m ()
    +nonTransactionallyExecuteMigrationPlan conn plan = do
    +  forM_ (migrationPlanItems plan) $ \(MigrationItem schemaItem ddl) ->
    +    executingSql DDLQuery ddl $ do
    +      stmt <- prepare conn ddl
    +      executeRaw stmt `Exc.catch`
    +        (Exc.throw . MigrationExecutionError schemaItem)
    +
    +buildMigrationPlan :: SchemaDefinition -> SchemaState -> Maybe MigrationPlan
    +buildMigrationPlan schemaDef schemaState = foldMap mkPlan schemaDef
    +  where
    +    mkPlan element =
    +      case element of
    +        Table tableDef -> migrateTablePlan tableDef schemaState
    +        DropTable name -> dropTablePlan name schemaState
    +        Index indexDef -> createIndexPlan indexDef schemaState
    +        DropIndex name -> dropIndexPlan name schemaState
    +        Constraint constraintDef ->
    +          createConstraintPlan constraintDef schemaState
    +        DropConstraint tablName name ->
    +          dropConstraintPlan tablName name schemaState
    +        Sequence seqDef ->
    +          createSequencePlan seqDef schemaState
    +        DropSequence name ->
    +          dropSequencePlan name schemaState
    +
    +{-|
    +   Migration Plan: @createIndexesConcurrently@ has been removed. You should now
    +   use @setIndexCreationStrategy Asynchronous@ instead.
    +
    +   createIndexesConcurrently will create the given indexes, if they do not exist using the
    +    PostgreSQL concurrently feature. However, this does *not* mean the the function happens
    +    concurrently. This will wait for PostgreSQL to return, but other operations to the table will be
    +    allowed during index creation.
    +
    +   Note: PostgreSQL does not allow CREATE INDEX CONCURRENTLY to appear inside of a transaction. Use
    +   this function with care.
    +-}
    +createIndexesConcurrently :: MonadOrville conn m
    +                          => [IndexDefinition]
    +                          -> m ()
    +createIndexesConcurrently indexDefs =
    +  withConnection $ \conn -> do
    +    traverse_ (createIndexConcurrently conn) indexDefs
    +
    +-- internal helper function that takes a connection and performs a single index creation.
    +createIndexConcurrently :: MonadOrville conn m
    +                        => conn
    +                        -> IndexDefinition
    +                        -> m ()
    +createIndexConcurrently conn indexDef =
    +  let ddl =
    +        (intercalate
    +          " "
    +          [ "CREATE"
    +          , if indexUnique indexDef
    +            then "UNIQUE"
    +            else ""
    +          , "INDEX"
    +          , "CONCURRENTLY"
    +          , "IF NOT EXISTS"
    +          , "\"" ++ indexName indexDef ++ "\""
    +          , "ON"
    +          , "\"" ++ indexTable indexDef ++ "\""
    +          , indexBody indexDef
    +          ])
    +  in
    +    executingSql DDLQuery ddl $ do
    +      stmt <- prepare conn ddl
    +      executeRaw stmt
    +
    +
    +{-|
    +   Migration Guide: @dropIndexesConcurrently@ has been removed.
    +
    +   dropIndexesConcurrently will drop each of the given indexes with the CONCURRENTLY keyword,
    +   allowing for other table operations to continue while the index is dropped. However there are
    +   several caveats that come with this as noted at
    +   https://www.postgresql.org/docs/9.6/sql-dropindex.html . Much like 'createIndexesConcurrently'
    +   this cannot be used in a transaction. But further this cannot drop indexes that support UNIQUE or
    +   PRIMARY KEY constraints.
    +
    +   Use this with care.
    +-}
    +dropIndexesConcurrently :: MonadOrville conn m
    +                        => [String]
    +                        -> m ()
    +dropIndexesConcurrently idxNames =
    +  withConnection $ \conn -> do
    +    traverse_ (dropIndexConcurrently conn) idxNames
    +
    +dropIndexConcurrently :: MonadOrville conn m
    +                      => conn
    +                      -> String
    +                      -> m ()
    +dropIndexConcurrently conn idxName =
    +  let ddl =
    +        (intercalate
    +          " "
    +          [ "DROP"
    +          , "INDEX"
    +          , "CONCURRENTLY"
    +          , "IF EXISTS"
    +          , "\"" ++ idxName ++ "\""
    +          ])
    +  in
    +    executingSql DDLQuery ddl $ do
    +      stmt <- prepare conn ddl
    +      executeRaw stmt
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html new file mode 100644 index 0000000..2e1831c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html @@ -0,0 +1,43 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateSequence
    +Copyright : Flipstone Technology Partners 2016-2019
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.MigrateSequence
    +  ( createSequencePlan
    +  , dropSequencePlan
    +  ) where
    +
    +import Control.Monad (guard)
    +import Data.List (intercalate)
    +
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +createSequencePlan :: SequenceDefinition -> SchemaState -> Maybe MigrationPlan
    +createSequencePlan seqDef schemaState = do
    +  guard (not $ schemaStateSequenceExists (sequenceName seqDef) schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (Sequence seqDef)
    +      (intercalate
    +         " "
    +         [ "CREATE SEQUENCE"
    +         , "\"" ++ sequenceName seqDef ++ "\""
    +         , maybe "" ("INCREMENT BY " ++) $ show <$> sequenceIncrement seqDef
    +         , maybe "" ("MINVALUE " ++) $ show <$> sequenceMinValue seqDef
    +         , maybe "" ("MAXVALUE " ++) $ show <$> sequenceMaxValue seqDef
    +         , maybe "" ("START WITH " ++) $ show <$> sequenceStart seqDef
    +         , maybe "" ("CACHE " ++) $ show <$> sequenceCache seqDef
    +         , cycleClause $ sequenceCycle seqDef
    +         ])
    +  where
    +    cycleClause True = "CYCLE"
    +    cycleClause _ = "NO CYCLE"
    +
    +dropSequencePlan :: String -> SchemaState -> Maybe MigrationPlan
    +dropSequencePlan name schemaState = do
    +  guard (schemaStateSequenceExists name schemaState)
    +  pure $ migrationDDLForItem (DropSequence name) ("DROP SEQUENCE " ++ "\"" ++ name ++ "\"" )
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html new file mode 100644 index 0000000..a6c8e28 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html @@ -0,0 +1,171 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateTable
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE ExistentialQuantification #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateTable
    +  ( migrateTablePlan
    +  , dropTablePlan
    +  ) where
    +
    +import Control.Monad
    +import qualified Data.List as List
    +import Data.Maybe
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.PrimaryKey
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +migrateTablePlan ::
    +     TableDefinition readEntity writeEntity key
    +  -> SchemaState
    +  -> Maybe MigrationPlan
    +migrateTablePlan tableDef schemaState =
    +  case schemaStateTableColumns (tableName tableDef) schemaState of
    +    Nothing ->
    +      Just $ migrationDDLForItem (Table tableDef) (mkCreateTableDDL tableDef)
    +    Just columns ->
    +      migrationDDLForItem (Table tableDef) <$>
    +      mkMigrateTableDDL columns tableDef
    +
    +dropTablePlan :: String -> SchemaState -> Maybe MigrationPlan
    +dropTablePlan name schemaState = do
    +  guard (schemaStateTableExists name schemaState)
    +  pure $ migrationDDLForItem (DropTable name) (mkDropTableDDL name)
    +
    +mkMigrateTableDDL ::
    +     [(String, SqlColDesc)]
    +  -> TableDefinition readEntity writeEntity key
    +  -> Maybe String
    +mkMigrateTableDDL columns tableDef =
    +  if null stmts
    +    then Nothing
    +    else Just $ "ALTER TABLE \"" ++ tableName tableDef ++ "\" " ++ cols
    +  where
    +    fields = tableFields tableDef
    +    fieldNamesToDelete = tableSafeToDelete tableDef
    +    fieldColumn fieldDef = lookup (fieldName fieldDef) columns
    +    colStmt (SomeField f) = mkMigrateColumnDDL f (fieldColumn f)
    +    dropStmt name = mkDropColumnDDL name (lookup name columns)
    +    stmts =
    +      List.concatMap colStmt fields ++
    +      List.concatMap dropStmt fieldNamesToDelete
    +    cols = List.intercalate ", " $ stmts
    +
    +mkMigrateColumnTypeDDL :: FieldDefinition nullability a
    +                       -> SqlColDesc
    +                       -> Maybe String
    +mkMigrateColumnTypeDDL fieldDef colDesc =
    +  let fieldDesc = sqlFieldDesc fieldDef
    +      name = rawExprToSql . generateSql . NameForm Nothing $ fieldName fieldDef
    +   in if colType fieldDesc /= colType colDesc ||
    +         colSize fieldDesc /= colSize colDesc
    +        then Just $
    +             "ALTER COLUMN " ++
    +             name ++
    +             " SET DATA TYPE " ++ sqlTypeDDL (fieldType fieldDef)
    +        else Nothing
    +
    +mkMigrateColumnNullDDL :: FieldDefinition nullability a
    +                       -> SqlColDesc
    +                       -> Maybe String
    +mkMigrateColumnNullDDL fieldDef colDesc =
    +  let fieldDesc = sqlFieldDesc fieldDef
    +      fieldNull = fromMaybe True (colNullable fieldDesc)
    +      colNull = fromMaybe True (colNullable colDesc)
    +      name = rawExprToSql . generateSql . NameForm Nothing $ fieldName fieldDef
    +   in if fieldNull && not colNull
    +        then Just $ "ALTER COLUMN " ++ name ++ " DROP NOT NULL"
    +        else if not fieldNull && colNull
    +               then Just $
    +                    "ALTER COLUMN " ++ name ++ " SET NOT NULL"
    +               else Nothing
    +
    +mkMigrateColumnDDL :: FieldDefinition nullability a
    +                   -> Maybe SqlColDesc
    +                   -> [String]
    +mkMigrateColumnDDL fieldDef Nothing = ["ADD COLUMN " ++ mkFieldDDL fieldDef]
    +mkMigrateColumnDDL fieldDef (Just desc) =
    +  catMaybes
    +    [ mkMigrateColumnTypeDDL fieldDef desc
    +    , mkMigrateColumnNullDDL fieldDef desc
    +    ]
    +
    +mkDropColumnDDL :: String -> Maybe SqlColDesc -> [String]
    +mkDropColumnDDL _ Nothing = []
    +mkDropColumnDDL name (Just _) = ["DROP COLUMN " ++ (rawExprToSql . generateSql . NameForm Nothing) name]
    +
    +mkFlagDDL :: ColumnFlag -> Maybe String
    +mkFlagDDL Unique = Just "UNIQUE"
    +mkFlagDDL (Default def) = Just $ "DEFAULT " ++ toColumnDefaultSql def
    +mkFlagDDL (References table field) =
    +  Just $ "REFERENCES \"" ++ tableName table ++ "\" (" ++ (rawExprToSql . generateSql . NameForm Nothing . fieldName) field ++ ")"
    +mkFlagDDL (ColumnDescription _) = Nothing
    +mkFlagDDL AssignedByDatabase = Nothing
    +
    +mkFieldDDL :: FieldDefinition nullability a -> String
    +mkFieldDDL field = name ++ " " ++ sqlType ++ " " ++ flagSql
    +  where
    +    name = rawExprToSql . generateSql . fieldToNameForm $ field
    +    sqlType = sqlTypeDDL (fieldType field)
    +    flagSql =
    +      List.intercalate " " (notNull : mapMaybe mkFlagDDL (fieldFlags field))
    +    notNull =
    +      if isFieldNullable field
    +        then "NULL"
    +        else "NOT NULL"
    +
    +mkPrimaryKeyDDL :: PrimaryKey key -> String
    +mkPrimaryKeyDDL keyDef =
    +  let
    +    names =
    +      mapPrimaryKeyParts (\_ field -> fieldToNameForm field) keyDef
    +  in
    +    concat
    +      [ "PRIMARY KEY ("
    +      , List.intercalate ", " (map (rawExprToSql . generateSql) names)
    +      , ")"
    +      ]
    +
    +mkCreateTableDDL :: TableDefinition readEntity writeEntity key -> String
    +mkCreateTableDDL tableDef =
    +  let
    +    mkSomeFieldDDL (SomeField f) =
    +      mkFieldDDL f
    +
    +    fields =
    +      List.intercalate ", " $ map mkSomeFieldDDL (tableFields tableDef)
    +
    +    primaryKeyDDL =
    +      mkPrimaryKeyDDL (tablePrimaryKey tableDef)
    +  in
    +    concat
    +      [ "CREATE TABLE \""
    +      , tableName tableDef
    +      , "\" ("
    +      , fields
    +      , ", "
    +      , primaryKeyDDL
    +      , ")"
    +      ]
    +
    +mkDropTableDDL :: String -> String
    +mkDropTableDDL name = "DROP TABLE \"" ++ name ++ "\""
    +
    +sqlFieldDesc :: FieldDefinition nullability a -> SqlColDesc
    +sqlFieldDesc field =
    +  SqlColDesc
    +    { colType = sqlTypeId $ fieldType field
    +    , colSize = sqlTypeSqlSize $ fieldType field
    +    , colNullable = Just (isFieldNullable field)
    +    , colOctetLength = Nothing
    +    , colDecDigits = Nothing
    +    }
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html new file mode 100644 index 0000000..f52dfae --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html @@ -0,0 +1,68 @@ +
    module Database.Orville.PostgreSQL.Internal.MigrationError
    +  ( MigrationError(..)
    +  ) where
    +
    +import Control.Exception (Exception, SomeException, displayException)
    +import qualified Data.List as List
    +import Data.Typeable (Typeable)
    +
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data MigrationError
    +  = MigrationLockExcessiveRetryError String
    +  | MigrationExecutionError SchemaItem
    +                            SomeException
    +  deriving (Typeable)
    +
    +instance Exception MigrationError
    +
    +--
    +-- This Show instance is not great, in fact it's horribly inconsistent. I'm leaving it like
    +-- this for now to avoid be derailed.
    +--
    +instance Show MigrationError where
    +  show err =
    +    case err of
    +      MigrationLockExcessiveRetryError msg ->
    +        "MigrationLockExcessiveRetryError " ++ show msg
    +      MigrationExecutionError (Table tableDef) someException ->
    +        formatTableMigrationException tableDef someException
    +      MigrationExecutionError schemaItem someException ->
    +        concat ["MigrationError ", show schemaItem, show someException]
    +
    +formatTableMigrationException ::
    +     TableDefinition readEntity writeEntity key -> SomeException -> String
    +formatTableMigrationException tableDef exception = message
    +  where
    +    message =
    +      "There was an error migrating table " ++
    +      name ++
    +      ".\n\
    +                  \The error is:\n\
    +                  \\n\
    +                  \ " ++
    +      displayException exception ++
    +      "\\n\
    +                  \\n\
    +                  \\n\
    +                  \Here are the developer comments regarding the table:\n\
    +                  \\n\
    +                  \ " ++
    +      comments ++
    +      "\
    +                  \\n"
    +    name = tableName tableDef
    +    comments = formatTableComments " " tableDef
    +
    +formatTableComments ::
    +     String -> TableDefinition readEntity writeEntity key -> String
    +formatTableComments indent tableDef =
    +  List.intercalate ("\n" ++ indent) commentLines
    +  where
    +    commentLines = map formatTableComment comments
    +    comments = runComments (tableComments tableDef)
    +
    +formatTableComment :: TableComment -> String
    +formatTableComment c =
    +  List.intercalate " - " [tcWhat c, show (tcWhen c), tcWho c]
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html new file mode 100644 index 0000000..7d6bfc1 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html @@ -0,0 +1,68 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrationPlan
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrationPlan
    +  ( MigrationPlan
    +  , MigrationItem(..)
    +  , DDL
    +  , migrationDDLForItem
    +  , migrationPlanItems
    +  ) where
    +
    +import qualified Data.DList as DList
    +
    +import Database.Orville.PostgreSQL.Internal.Types (SchemaItem)
    +
    +type DDL = String
    +
    +{- |
    +  Migration Guide: @MigrationItem@ has been renamed to @MigrationStep@, which
    +  is now a simple @RawSql@ wrapper. You can use @RawSql.toExampleBytes@ if you
    +  wish to render it to a bytestring for display purposes.
    +-}
    +data MigrationItem = MigrationItem
    +  { migrationItemSchemaItem :: SchemaItem
    +  , migrationItemDDL :: DDL
    +  }
    +
    +{- |
    +  Migration Guide: @MigrationPlan@ retains the same name.
    +-}
    +data MigrationPlan =
    +  MigrationPlan MigrationItem
    +                (DList.DList MigrationItem)
    +
    +migrationDDLForItem :: SchemaItem -> DDL -> MigrationPlan
    +migrationDDLForItem schemaItem ddl =
    +  MigrationPlan (MigrationItem schemaItem ddl) DList.empty
    +
    +append :: MigrationPlan -> MigrationPlan -> MigrationPlan
    +append (MigrationPlan itemA restA) (MigrationPlan itemB restB) =
    +  MigrationPlan itemA $ DList.append restA $ DList.cons itemB restB
    +
    +{- |
    +  Migration Guide: @migrationPlanItems@ has been renamed to
    +  @migrationPlanSteps@
    +-}
    +migrationPlanItems :: MigrationPlan -> [MigrationItem]
    +migrationPlanItems (MigrationPlan item rest) =
    +  DList.toList $ DList.cons item rest
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup MigrationPlan where
    +  (<>) = append
    +#else
    +instance Monoid MigrationPlan
    +  -- MigrationPlan doesn't support mempty, so don't provide a Monoid instance for
    +  -- base versions that have migrated to Semigroup.
    +  where
    +    mempty =
    +      error
    +        "mempty for MigrationPlan used, but MigrationPlan cannot be empty! MigrationPlan only support Monoid prior to base 4.11.0"
    +    mappend = append
    +#endif
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html new file mode 100644 index 0000000..5135255 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html @@ -0,0 +1,393 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE FunctionalDependencies #-}
    +{-# LANGUAGE RankNTypes #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Monad where
    +
    +import Control.Applicative
    +import Control.Monad (MonadPlus)
    +import Control.Monad.Base
    +import Control.Monad.Catch (MonadCatch, MonadMask(..), MonadThrow)
    +import Control.Monad.Except
    +import Control.Monad.IO.Class (MonadIO)
    +import Control.Monad.Reader (ReaderT(..), ask, local, mapReaderT, runReaderT)
    +import Control.Monad.State (StateT, mapStateT)
    +import Control.Monad.Trans.Class (MonadTrans(lift))
    +import Data.Pool
    +import Database.HDBC hiding (withTransaction)
    +
    +#if MIN_VERSION_base(4,11,0)
    +import Control.Monad.Fail (MonadFail)
    +#endif
    +
    +data ConnectionEnv conn = ConnectionEnv
    +  { ormTransactionOpen :: Bool
    +  , ormConnection :: conn
    +  }
    +
    +data QueryType
    +  = SelectQuery
    +  | InsertQuery
    +  | UpdateQuery
    +  | DeleteQuery
    +  | DDLQuery
    +  deriving (Ord, Eq, Enum, Show, Read)
    +
    +{-|
    +  Migration Guide: @OrvilleEnv@ has been renamed to @OrvilleState@. It no
    +  longer has any type paremeters. The connection type is fixed and cannot be
    +  changed.
    +
    + 'OrvilleEnv' tracks all the environment information required for an
    + 'OrvilleT conn m' Monad to operate. Use 'newOrvilleEnv' to construct
    + one.
    +  -}
    +data OrvilleEnv conn = OrvilleEnv
    +  { ormEnvConnectionEnv :: Maybe (ConnectionEnv conn)
    +  , ormEnvStartTransactionSQL :: String
    +  , ormEnvRunningQuery :: forall a. QueryType -> String -> IO a -> IO a
    +  , ormEnvTransactionCallback :: TransactionEvent -> IO ()
    +  , ormEnvPool :: Pool conn
    +  }
    +
    +data TransactionEvent
    +  = TransactionStart
    +  | TransactionCommit
    +  | TransactionRollback
    +  deriving (Ord, Eq, Enum, Show, Read)
    +
    +defaultStartTransactionSQL :: String
    +defaultStartTransactionSQL = "START TRANSACTION"
    +
    +{- |
    +  Migration Guide: @setStartTransactionSQL@ has been renamed to @setBeginTransactionExpr@
    +-}
    +setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn
    +setStartTransactionSQL sql env = env {ormEnvStartTransactionSQL = sql}
    +
    +defaultRunningQuery :: QueryType -> String -> IO a -> IO a
    +defaultRunningQuery _ _ action = action
    +
    +defaultTransactionCallback :: TransactionEvent -> IO ()
    +defaultTransactionCallback = const (pure ())
    +
    +{- |
    +  Migration Guide: @aroundRunningQuery@ has been renamed to @addSqlExecutionCallback@
    +-}
    +aroundRunningQuery ::
    +     (forall a. QueryType -> String -> IO a -> IO a)
    +  -> OrvilleEnv conn
    +  -> OrvilleEnv conn
    +aroundRunningQuery outside env = env {ormEnvRunningQuery = layeredAround}
    +  where
    +    layeredAround, inside :: QueryType -> String -> IO a -> IO a
    +    layeredAround queryType sql action =
    +      outside queryType sql (inside queryType sql action)
    +    inside = ormEnvRunningQuery env
    +
    +{- |
    +  Migration Guide: @addTransactionCallBack@ retains the same name
    +-}
    +addTransactionCallBack ::
    +     (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn
    +addTransactionCallBack callback env =
    +  env {ormEnvTransactionCallback = wrappedCallback}
    +  where
    +    wrappedCallback event = do
    +      ormEnvTransactionCallback env event
    +      callback event
    +
    +{-|
    +  Migration Guide: @newOrvilleEnv@ has been renamed to @newOrvilleState@. The
    +  new function requires a parameter to be passed before the connection pool to
    +  specify the level of detail to be used when Orville reports errors.
    +
    + 'newOrvilleEnv' initialized an 'OrvilleEnv' for service. The connection
    + pool provided will be used to obtain connections to the database ase
    + required. You can use the 'Database.Orville.PostgreSQL.Connection.createConnectionPool'
    + utility function to create a connection pool to a PosgreSQL server.
    +-}
    +newOrvilleEnv :: Pool conn -> OrvilleEnv conn
    +newOrvilleEnv =
    +  OrvilleEnv
    +    Nothing
    +    defaultStartTransactionSQL
    +    defaultRunningQuery
    +    defaultTransactionCallback
    +
    +setConnectionEnv :: ConnectionEnv conn -> OrvilleEnv conn -> OrvilleEnv conn
    +setConnectionEnv c ormEnv = ormEnv {ormEnvConnectionEnv = Just c}
    +
    +{- |
    +  Migration Guide: @OrvilleT@ has been removed. In its place you can simply use
    +  a @ReaderT OrvilleState@. If you have another @ReaderT@ layer in your monad
    +  stack you can add the @OrvilleState@ to the reader context for that layer
    +  instead, which is more efficient than having multiple @ReaderT@ layers. If
    +  you have a simple case of @OrvilleT conn IO@ the new Orville offers a simpler
    +  @Orville@ monad (not a transformer) to get you started.
    +-}
    +newtype OrvilleT conn m a = OrvilleT
    +  { unOrvilleT :: ReaderT (OrvilleEnv conn) m a
    +  } deriving ( Functor
    +             , Applicative
    +             , Alternative
    +             , Monad
    +             , MonadPlus
    +             , MonadIO
    +             , MonadThrow
    +             , MonadCatch
    +             , MonadMask
    +#if MIN_VERSION_base (4,11,0)
    +             , MonadFail
    +#endif
    +             )
    +
    +{- |
    +  Migration Guide: @mapOrvilleT@ has been removed because @OrvilleT@ has been
    +  removed. If you're replacing @OrvilleT@ with @ReaderT@ then @mapOrvilleT@
    +  should be replaced with @mapReaderT@.
    +-}
    +mapOrvilleT ::
    +     Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b
    +mapOrvilleT f (OrvilleT action) = OrvilleT $ mapReaderT f action
    +
    +{- |
    +  Migration Guide: @runOrville@ now operates on the concrete @Orville@ monad
    +  becase @OrvilleT@ has been removed. Assuming you are replacing usages of
    +  @OrvilleT@ with @ReaderT@ you will want to replace usages of @runOrville@
    +  with @runReaderT@.
    +-}
    +runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a
    +runOrville = runReaderT . unOrvilleT
    +
    +newConnectionEnv :: conn -> ConnectionEnv conn
    +newConnectionEnv = ConnectionEnv False
    +
    +withConnectionEnv :: MonadOrville conn m => (ConnectionEnv conn -> m a) -> m a
    +withConnectionEnv action = do
    +  ormEnv <- getOrvilleEnv
    +  case ormEnvConnectionEnv ormEnv of
    +    Just connected -> action connected
    +    Nothing ->
    +      liftWithConnection (withResource (ormEnvPool ormEnv)) $ \conn -> do
    +        let connected = newConnectionEnv conn
    +        localOrvilleEnv (const $ ormEnv {ormEnvConnectionEnv = Just connected}) $
    +          action connected
    +
    +withConnection :: MonadOrville conn m => (conn -> m a) -> m a
    +withConnection action = withConnectionEnv (action . ormConnection)
    +
    +instance MonadTrans (OrvilleT conn) where
    +  lift = OrvilleT . lift
    +
    +instance (MonadError e m) => MonadError e (OrvilleT conn m) where
    +  throwError = lift . throwError
    +  catchError action handler =
    +    OrvilleT ((unOrvilleT action) `catchError` (unOrvilleT . handler))
    +
    +instance MonadBase b m => MonadBase b (OrvilleT conn m) where
    +  liftBase = lift . liftBase
    +
    +{-|
    +  Migration Guide: @HasOrvilleContext@ has been renamed to @HasOrvilleState@.
    +  @getOrvilleEnv@ and @localOrvilleEnv@ have been renamed to @askOrvilleState@
    +  and @localOrvilleState@.
    +
    +  'HasOrvilleContext' defines the operations that must be available in your own
    +  monad for managing the connection pool that Orville functions will use to
    +  access the database and manage transaction state. In most cases you can
    +  include 'OrvilleT' in your Monad stack and then automatically derive an
    +  instance of 'HasOrvilleContext'.
    +
    +  You could also provide your own implementations of these functions
    +  instead of using 'OrvilleT', if that is the easiest approach for
    +  your Monad.
    + -}
    +class IConnection conn =>
    +      HasOrvilleContext conn m
    +  | m -> conn
    +  where
    +  getOrvilleEnv :: m (OrvilleEnv conn)
    +  -- ^ getOrvilleEnv fetches the Orville environment from the Monad context.
    +  -- Analogous to 'ask' from the 'Reader' monad.
    +  localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> m a -> m a -- ^ localOrvilleEnv locally modifies the Orville environment for the
    +  -- scope of the provided action. This allows Orville to track with
    +  -- a connection is acquired, open transactions, etc. Analogous to 'local'
    +  -- from the 'Reader' monad.
    +
    +{-|
    +   Migration Guide: @MonadOrvilleControl@ retains the same name. The
    +   @liftFinally@ member has been removed. There are new @liftCatch@ and
    +   @liftMask@ members that must be implemented, however. Instances of the new
    +   @MonadOrvilleControl@ are provided for @IO@ and @ReaderT@. Helper functions
    +   for implmenting the members via @UnliftIO@ can be found in
    +   @Orville.PostgreSQL.UnliftIO@.
    +
    +   'MonadOrvilleControl' provides an interface for the kinds of IO operations
    +   that Orville functions need to lift into the Monad providing the
    +   'MonadOrville' instance. This typeclass allows users to provide their
    +   own lifting strategies in case the Monad stack in question has special
    +   needs. If you are only using 'ReaderT' and 'OrvilleT' layers in your
    +   monad stack, you can probably implement this for your own Monad wrapper
    +   type using the provided default functions and providing functions to
    +   wrap and unwrapper your Monad layer:
    +
    +   @
    +    instance MonadOrvilleControl MyMonad where
    +      liftWithConnection = defaultLiftWithConnection wrapMyMonad unWrapMyMonad
    +      liftFinally = defaultLiftFinally wrapMyMonad unWrapMyMonad
    +   @
    +
    +   If you are using transformers in your monad stack beyond 'ReaderT', they
    +   probably don't provide 'MonadOrvilleControl' instances (e.g. third party
    +   libraries). In this case, see 'Database.Orville.PostgreSQL.MonadUnliftIO' for more
    +   help. If you're still stuck (because your library doesn't support
    +   'MonadTransControl'), try 'Database.Orville.PostgreSQL.MonadBaseControl' instead. If
    +   you're *still* stuck after that, please file an issue on Github at
    +   https://github.com/flipstone/orville so we can can help out!
    +  -}
    +class MonadOrvilleControl m where
    +  liftWithConnection ::
    +       (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b
    +  liftFinally :: (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c
    +
    +{-|
    +  Migration Guide: @MonadOrville@ retains the same name, but the @conn@
    +  parameter has been removed. @MonadFail@ and @MonadThrow@ have been removed as
    +  superclass constraints.
    +
    +  'MonadOrville' does not have any methods of its own. Instead it brings all
    +  the typeclass constraints required by Orville functions that need to access
    +  the database into a single typeclass. In some cases you can include
    +  'OrvilleT' in your Monad stack and then automatically derive an instance of
    +  'MonadOrville'. However, more likely you are using some third party monad
    +  somewhere in your stack that does not han a 'MonadOrvilleControl' instance.
    +  In this case you won't be able to derive 'MonadOrville', but providing a
    +  simple empty instance will do:
    +
    +  @
    +    instance O.MonadOrville Postgres.Connection MyMonad
    +  @
    + -}
    +class ( Monad m
    +      , MonadIO m
    +      , HasOrvilleContext conn m
    +      , MonadThrow m
    +      , MonadOrvilleControl m
    +#if MIN_VERSION_base(4,11,0)
    +      , MonadFail m
    +#endif
    +      ) =>
    +      MonadOrville conn m
    +
    +
    +instance MonadOrvilleControl IO where
    +  liftWithConnection ioWithConn = ioWithConn
    +  liftFinally ioFinally = ioFinally
    +
    +{-|
    +   Migration Guide: @defaultLiftWithConnection@ has been removed. In its
    +   place you can use either the @ReaderT@ instance of @MonadOrvilleControl@
    +   or the helpers in @Orville.PostgreSQL.UnliftIO@.
    +
    +   defaultLiftWithConnection provides a simple definition of
    +   'liftWithConnection' for 'MonadOrvilleControl' instances when the Monad in
    +   question is a wrapper around a type that already implements
    +   'MonadOrvilleControl'
    +  -}
    +defaultLiftWithConnection ::
    +     MonadOrvilleControl m
    +  => (forall a. m a -> n a)
    +  -> (forall a. n a -> m a)
    +  -> (forall a. (conn -> IO a) -> IO a)
    +  -> (conn -> n b)
    +  -> n b
    +defaultLiftWithConnection wrapT unWrapT ioWithConn action =
    +  wrapT $ liftWithConnection ioWithConn (unWrapT . action)
    +
    +{-|
    +   Migration Guide: @defaultLiftWithConnection@ has been removed (along with
    +   @liftFinally@)
    +
    +   defaultLiftFinally provides a simple definition of
    +   'liftWithConnection' for 'MonadOrvilleControl' instances when the Monad in
    +   question is a wrapper around a type that already implements
    +   'MonadOrvilleControl'
    +  -}
    +defaultLiftFinally ::
    +     MonadOrvilleControl m
    +  => (forall a. m a -> n a)
    +  -> (forall a. n a -> m a)
    +  -> (forall a b. IO a -> IO b -> IO a)
    +  -> n c
    +  -> n d
    +  -> n c
    +defaultLiftFinally wrapT unWrapT ioFinally action cleanup =
    +  wrapT $ liftFinally ioFinally (unWrapT action) (unWrapT cleanup)
    +
    +startTransactionSQL :: MonadOrville conn m => m String
    +startTransactionSQL = ormEnvStartTransactionSQL <$> getOrvilleEnv
    +
    +instance (Monad m, HasOrvilleContext conn m) =>
    +         HasOrvilleContext conn (ReaderT a m) where
    +  getOrvilleEnv = lift getOrvilleEnv
    +  localOrvilleEnv modEnv = mapReaderT (localOrvilleEnv modEnv)
    +
    +-- ReaderT is trivial enough that we just provide a 'MonadOrvilleControl'
    +-- instance for it here rather than relying on either MonadUnliftIO or
    +-- MonadBaseControl at all. This allows Monad stacks that only use 'ReaderT'
    +-- and 'OrvilleT' over IO to be built without needing to know anything more
    +-- about lifting IO operations beyond the types in this module.
    +instance MonadOrvilleControl m => MonadOrvilleControl (ReaderT a m) where
    +  liftWithConnection ioWithConn action = do
    +    ReaderT $ \env ->
    +      liftWithConnection ioWithConn (flip runReaderT env . action)
    +  liftFinally ioFinally action cleanup = do
    +    ReaderT $ \env ->
    +      liftFinally ioFinally (runReaderT action env) (runReaderT cleanup env)
    +
    +instance ( Monad m
    +         , MonadThrow m
    +         , MonadIO m
    +         , IConnection conn
    +         , MonadOrville conn m
    +         ) =>
    +         MonadOrville conn (ReaderT a m)
    +
    +instance MonadOrvilleControl m => MonadOrvilleControl (OrvilleT conn m) where
    +  liftWithConnection = defaultLiftWithConnection OrvilleT unOrvilleT
    +  liftFinally = defaultLiftFinally OrvilleT unOrvilleT
    +
    +instance (IConnection conn, Monad m) =>
    +         HasOrvilleContext conn (OrvilleT conn m) where
    +  getOrvilleEnv = OrvilleT ask
    +  localOrvilleEnv modEnv (OrvilleT a) = OrvilleT (local modEnv a)
    +
    +instance ( Monad m
    +         , MonadThrow m
    +         , MonadIO m
    +         , IConnection conn
    +         , MonadOrvilleControl m
    +#if MIN_VERSION_base (4,11,0)
    +         , MonadFail m
    +#endif
    +         ) =>
    +         MonadOrville conn (OrvilleT conn m)
    +
    +-- We can provide 'HasOrvilleContext' for 'StateT' here, but not 'MonadOrvilleControl'
    +-- because we do not want to force a decision on the end use about how the 'StateT'
    +-- state should be managed during control functions (e.g. 'liftFinally'). See the
    +-- 'MonadBaseControl' module for an instance of 'MonadOrvilleControl' for 'StateT', if
    +-- you are brave enough to use 'MonadBaseControl'.
    +instance (Monad m, HasOrvilleContext conn m) =>
    +         HasOrvilleContext conn (StateT s m) where
    +  getOrvilleEnv = lift getOrvilleEnv
    +  localOrvilleEnv modEnv = mapStateT (localOrvilleEnv modEnv)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html new file mode 100644 index 0000000..3759aaa --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html @@ -0,0 +1,51 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.OrderBy
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.OrderBy where
    +
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data SortDirection
    +  = Ascending
    +  | Descending
    +  deriving (Show)
    +
    +instance QueryKeyable SortDirection where
    +  queryKey dir = QKOp (sqlDirection dir) QKEmpty
    +
    +sqlDirection :: SortDirection -> String
    +sqlDirection Ascending = "ASC"
    +sqlDirection Descending = "DESC"
    +
    +data OrderByClause =
    +  OrderByClause String
    +                [SqlValue]
    +                SortDirection
    +
    +instance QueryKeyable OrderByClause where
    +  queryKey (OrderByClause sql vals dir) =
    +    QKList [QKField sql, queryKey vals, queryKey dir]
    +
    +sortingSql :: OrderByClause -> String
    +sortingSql (OrderByClause sql _ sortDir) = sql ++ " " ++ sqlDirection sortDir
    +
    +sortingValues :: OrderByClause -> [SqlValue]
    +sortingValues (OrderByClause _ values _) = values
    +
    +class ToOrderBy a where
    +  toOrderBy :: a -> SortDirection -> OrderByClause
    +
    +instance ToOrderBy (FieldDefinition nullability a) where
    +  toOrderBy fieldDef = OrderByClause (rawExprToSql . generateSql . NameForm Nothing $ fieldName fieldDef) []
    +
    +instance ToOrderBy (String, [SqlValue]) where
    +  toOrderBy (sql, values) = OrderByClause sql values
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html new file mode 100644 index 0000000..b0dd83c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html @@ -0,0 +1,136 @@ +
    {-# LANGUAGE RankNTypes #-}
    +module Database.Orville.PostgreSQL.Internal.PrimaryKey
    +  ( primaryKeyIn
    +  , primaryKeyEquals
    +  , primaryKeyDescription
    +  , primaryKeyToSql
    +  , primaryKey
    +  , compositePrimaryKey
    +  , primaryKeyPart
    +  , mapPrimaryKeyParts
    +  ) where
    +
    +import qualified Data.List as List
    +import qualified Database.HDBC as HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition (fieldToSqlValue)
    +import Database.Orville.PostgreSQL.Internal.Types (PrimaryKey(..), PrimaryKeyPart(..), FieldDefinition(fieldName), NotNull)
    +import Database.Orville.PostgreSQL.Internal.Where (WhereCondition, whereIn, (.==), whereAnd, whereOr)
    +
    +{-|
    +  'primaryKeyIn' builds a 'WhereCondition' that will match all rows where the
    +  primary key is equal to one of the given values. For single-field primary
    +  keys this is equivalent to 'whereIn', but 'primaryKeyIn' also handles
    +  composite primary keys.
    +-}
    +primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition
    +primaryKeyIn keyDef@(PrimaryKey first rest) keys =
    +  case rest of
    +    [] ->
    +      -- Special case the single field case to an in clause rather
    +      -- than a large OR
    +      case first of
    +        PrimaryKeyPart getPart field ->
    +          whereIn field (map getPart keys)
    +    _ ->
    +      whereOr (map (primaryKeyEquals keyDef) keys)
    +
    +{-|
    +  'primaryKeyEquals' builds a 'WhereCondition' that will match the row where
    +  the primary key is equal to the given value. For single-field primary keys
    +  this is equivalent to '.==', but 'primaryKeyEquals also handles composite
    +  primary keys.
    +-}
    +primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition
    +primaryKeyEquals keyDef key =
    +  let
    +    partEq getPart partField =
    +      partField .== getPart key
    +  in
    +    whereAnd (mapPrimaryKeyParts partEq keyDef)
    +
    +{-|
    +  'primaryKeyDescription' builds a user-readable representation of the
    +  primary key for use in error messages and such. It is a comma-delimited
    +  list of the names of the fields that make up the primary key.
    +-}
    +primaryKeyDescription :: PrimaryKey key -> String
    +primaryKeyDescription keyDef =
    +  let
    +    partName _ field =
    +      fieldName field
    +  in
    +    List.intercalate ", " (mapPrimaryKeyParts partName keyDef)
    +
    +{-|
    +  'primaryKeyToSql' converts a Haskell value for a primary key into the
    +  (possibly multiple) sql values that represent the primary key in the
    +  database.
    +-}
    +primaryKeyToSql :: PrimaryKey key -> key -> [HDBC.SqlValue]
    +primaryKeyToSql keyDef key =
    +  let
    +    partSqlValue getPart partField =
    +      fieldToSqlValue partField (getPart key)
    +  in
    +    mapPrimaryKeyParts partSqlValue keyDef
    +
    +{-|
    +  'primaryKey' constructs a single-field primary key from the 'FieldDefinition'
    +  that corresponds to the primary key's column. This is generally used while
    +  building a 'TableDefinition'.
    +-}
    +primaryKey :: FieldDefinition NotNull key -> PrimaryKey key
    +primaryKey fieldDef =
    +  PrimaryKey (PrimaryKeyPart id fieldDef) []
    +
    +{-|
    +  'compositePrimaryKey' constructs a multi-field primary key from the given
    +  parts, each of which corresponds to one field in the primary key.  You should
    +  use this while building a 'TableDefinition' for a table that you want to have
    +  a multi-column primary key. See 'primaryKeyPart' for how to build the parts
    +  to be passed as parameters. Note: there is no special significance to the
    +  first argument other than requiring that there is at least one field in the
    +  primary key.
    +-}
    +compositePrimaryKey :: PrimaryKeyPart key
    +                    -> [PrimaryKeyPart key]
    +                    -> PrimaryKey key
    +compositePrimaryKey =
    +  PrimaryKey
    +
    +{-|
    +  'primaryKeyPart' builds on section of a composite primary key based on the
    +  field definition that corresponds to that column of the primary key. The
    +  function given is used to decompose the Haskell value for the composite key
    +  into the individual parts so they can be converted to sql for things like
    +  building 'WhereCondition'
    +-}
    +primaryKeyPart :: (key -> part)
    +               -> FieldDefinition NotNull part
    +               -> PrimaryKeyPart key
    +primaryKeyPart =
    +  PrimaryKeyPart
    +
    +{-|
    +  'mapPrimaryKeyParts' provides a way to access the innards of a 'PrimaryKey'
    +  definition to extract information. The given function will be called on
    +  each part of the primary key in order and the list of results is returned.
    +  Note that single-field and multi-field primary keys are treated the same by
    +  this function, with the single-field case simply behaving as composite key
    +  with just one part.
    +-}
    +mapPrimaryKeyParts :: (forall part.
    +                         (key -> part)
    +                        -> FieldDefinition NotNull part
    +                        -> a
    +                      )
    +                   -> PrimaryKey key
    +                   -> [a]
    +mapPrimaryKeyParts f (PrimaryKey first rest) =
    +  let
    +    doPart (PrimaryKeyPart getPart field) =
    +      f getPart field
    +  in
    +    map doPart (first:rest)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html new file mode 100644 index 0000000..12ceee8 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html @@ -0,0 +1,134 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.QueryCache
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +
    +module Database.Orville.PostgreSQL.Internal.QueryCache
    +  ( QueryCached
    +  , runQueryCached
    +  , selectCached
    +  , selectFirstCached
    +  , findRecordCached
    +  , findRecordsCached
    +  , findRecordsByCached
    +  , unsafeLift
    +  ) where
    +
    +import Control.Monad.Catch (MonadThrow)
    +import Control.Monad.Trans
    +import Control.Monad.Trans.State
    +import qualified Data.Map as Map
    +import qualified Data.Map.Helpers as Map
    +import Data.Maybe
    +
    +import Data.String (fromString)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.PrimaryKey
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +import Database.Orville.PostgreSQL.Internal.TableDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Select
    +
    +type QueryCache = Map.Map QueryKey ResultSet
    +
    +newtype QueryCached m a =
    +  QueryCached (StateT QueryCache m a)
    +  deriving (Functor, Applicative, Monad)
    +
    +runQueryCached :: Monad m => QueryCached m a -> m a
    +runQueryCached (QueryCached statet) = evalStateT statet Map.empty
    +
    +cached ::
    +     Monad m => QueryKey -> QueryCached m ResultSet -> QueryCached m ResultSet
    +cached key action = do
    +  cache <- QueryCached get
    +  case Map.lookup key cache of
    +    Just result -> do
    +      pure result
    +    Nothing -> do
    +      result <- action
    +      QueryCached $ put (Map.insert key result cache)
    +      pure result
    +
    +selectCachedRows ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> QueryCached m ResultSet
    +selectCachedRows tableDef opts =
    +  cached key $
    +  unsafeLift $
    +  runSelect $ selectQueryRows selects (fromClauseTable tableDef) opts
    +  where
    +    selects = expr . selectColumn . fromString <$> tableColumnNames tableDef
    +    key = mconcat [queryKey tableDef, queryKey opts]
    +
    +selectCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> QueryCached m [readEntity]
    +selectCached tableDef opts = do
    +  rows <- selectCachedRows tableDef opts
    +  unsafeLift $ decodeSqlRows (tableFromSql tableDef) rows
    +
    +selectFirstCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> QueryCached m (Maybe readEntity)
    +selectFirstCached tableDef opts =
    +  listToMaybe <$> selectCached tableDef (limit 1 <> opts)
    +
    +findRecordsCached ::
    +     (MonadThrow m, MonadOrville conn m, Ord key)
    +  => TableDefinition readEntity writeEntity key
    +  -> [key]
    +  -> QueryCached m (Map.Map key readEntity)
    +findRecordsCached tableDef keys = do
    +  let
    +    primKey = tablePrimaryKey tableDef
    +    mkEntry record = (tableGetKey tableDef record, record)
    +
    +  recordList <- selectCached tableDef (where_ $ primaryKeyIn primKey keys)
    +  pure $ Map.fromList (map mkEntry recordList)
    +
    +findRecordCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> QueryCached m (Maybe readEntity)
    +findRecordCached tableDef key =
    +  let
    +    primKey = tablePrimaryKey tableDef
    +   in
    +    selectFirstCached tableDef (where_ $ primaryKeyEquals primKey key)
    +
    +findRecordsByCached ::
    +     (Ord fieldValue, MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> QueryCached m (Map.Map fieldValue [readEntity])
    +findRecordsByCached tableDef field opts = do
    +  let builder = (,) <$> fieldFromSql field <*> tableFromSql tableDef
    +  rows <- selectCachedRows tableDef opts
    +  Map.groupBy' id <$> unsafeLift (decodeSqlRows builder rows)
    +
    +-- this is unsafe in the sense that it does not provide
    +-- any guarantees that the action won't chance values in
    +-- the database, rendering the cache incorrect. It is not
    +-- exposed publically, but all usages of it here need to
    +-- be examined for correctness manually.
    +--
    +unsafeLift :: Monad m => m a -> QueryCached m a
    +unsafeLift = QueryCached . lift
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html new file mode 100644 index 0000000..a921233 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html @@ -0,0 +1,133 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.QueryKey
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Internal.QueryKey where
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Data.Time.LocalTime
    +import Database.HDBC
    +
    +data QueryKey
    +  = QKValue OrdSqlValue
    +  | QKField String
    +  | QKTable String
    +  | QKOp String
    +         QueryKey
    +  | QKList [QueryKey]
    +  | QKEmpty
    +  deriving (Eq, Ord)
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup QueryKey where
    +  (<>) = appendQueryKeys
    +#endif
    +instance Monoid QueryKey where
    +  mempty = QKEmpty
    +  mappend = appendQueryKeys
    +  mconcat = QKList
    +
    +appendQueryKeys :: QueryKey -> QueryKey -> QueryKey
    +appendQueryKeys a b = QKList [a, b]
    +
    +class QueryKeyable a where
    +  queryKey :: a -> QueryKey
    +
    +instance QueryKeyable QueryKey where
    +  queryKey = id
    +
    +instance QueryKeyable a => QueryKeyable [a] where
    +  queryKey = foldMap queryKey
    +
    +instance QueryKeyable a => QueryKeyable (Maybe a) where
    +  queryKey = foldMap queryKey
    +
    +instance QueryKeyable SqlValue where
    +  queryKey = QKValue . OrdSqlValue
    +
    +qkOp :: (QueryKeyable a) => String -> a -> QueryKey
    +qkOp op a = QKOp op $ queryKey a
    +
    +qkOp2 :: (QueryKeyable a, QueryKeyable b) => String -> a -> b -> QueryKey
    +qkOp2 op a b = QKOp op $ QKList [queryKey a, queryKey b]
    +
    +newtype OrdSqlValue =
    +  OrdSqlValue SqlValue
    +
    +instance Ord OrdSqlValue where
    +  compare (OrdSqlValue s) (OrdSqlValue s') = compareSqlValue s s'
    +
    +instance Eq OrdSqlValue where
    +  a == b = compare a b == EQ
    +
    +compareSqlValue :: SqlValue -> SqlValue -> Ordering
    +compareSqlValue (SqlString v) (SqlString v') = compare v v'
    +compareSqlValue (SqlString _) _ = LT
    +compareSqlValue _ (SqlString _) = GT
    +compareSqlValue (SqlByteString v) (SqlByteString v') = compare v v'
    +compareSqlValue (SqlByteString _) _ = LT
    +compareSqlValue _ (SqlByteString _) = GT
    +compareSqlValue (SqlWord32 v) (SqlWord32 v') = compare v v'
    +compareSqlValue (SqlWord32 _) _ = LT
    +compareSqlValue _ (SqlWord32 _) = GT
    +compareSqlValue (SqlWord64 v) (SqlWord64 v') = compare v v'
    +compareSqlValue (SqlWord64 _) _ = LT
    +compareSqlValue _ (SqlWord64 _) = GT
    +compareSqlValue (SqlInt32 v) (SqlInt32 v') = compare v v'
    +compareSqlValue (SqlInt32 _) _ = LT
    +compareSqlValue _ (SqlInt32 _) = GT
    +compareSqlValue (SqlInt64 v) (SqlInt64 v') = compare v v'
    +compareSqlValue (SqlInt64 _) _ = LT
    +compareSqlValue _ (SqlInt64 _) = GT
    +compareSqlValue (SqlInteger v) (SqlInteger v') = compare v v'
    +compareSqlValue (SqlInteger _) _ = LT
    +compareSqlValue _ (SqlInteger _) = GT
    +compareSqlValue (SqlChar v) (SqlChar v') = compare v v'
    +compareSqlValue (SqlChar _) _ = LT
    +compareSqlValue _ (SqlChar _) = GT
    +compareSqlValue (SqlBool v) (SqlBool v') = compare v v'
    +compareSqlValue (SqlBool _) _ = LT
    +compareSqlValue _ (SqlBool _) = GT
    +compareSqlValue (SqlDouble v) (SqlDouble v') = compare v v'
    +compareSqlValue (SqlDouble _) _ = LT
    +compareSqlValue _ (SqlDouble _) = GT
    +compareSqlValue (SqlRational v) (SqlRational v') = compare v v'
    +compareSqlValue (SqlRational _) _ = LT
    +compareSqlValue _ (SqlRational _) = GT
    +compareSqlValue (SqlLocalDate v) (SqlLocalDate v') = compare v v'
    +compareSqlValue (SqlLocalDate _) _ = LT
    +compareSqlValue _ (SqlLocalDate _) = GT
    +compareSqlValue (SqlLocalTimeOfDay v) (SqlLocalTimeOfDay v') = compare v v'
    +compareSqlValue (SqlLocalTimeOfDay _) _ = LT
    +compareSqlValue _ (SqlLocalTimeOfDay _) = GT
    +compareSqlValue (SqlZonedLocalTimeOfDay v z) (SqlZonedLocalTimeOfDay v' z') =
    +  compare v v' <> compare z z'
    +compareSqlValue (SqlZonedLocalTimeOfDay _ _) _ = LT
    +compareSqlValue _ (SqlZonedLocalTimeOfDay _ _) = GT
    +compareSqlValue (SqlLocalTime v) (SqlLocalTime v') = compare v v'
    +compareSqlValue (SqlLocalTime _) _ = LT
    +compareSqlValue _ (SqlLocalTime _) = GT
    +compareSqlValue (SqlZonedTime (ZonedTime v z)) (SqlZonedTime (ZonedTime v' z')) =
    +  compare v v' <> compare z z'
    +compareSqlValue (SqlZonedTime _) _ = LT
    +compareSqlValue _ (SqlZonedTime _) = GT
    +compareSqlValue (SqlUTCTime v) (SqlUTCTime v') = compare v v'
    +compareSqlValue (SqlUTCTime _) _ = LT
    +compareSqlValue _ (SqlUTCTime _) = GT
    +compareSqlValue (SqlDiffTime v) (SqlDiffTime v') = compare v v'
    +compareSqlValue (SqlDiffTime _) _ = LT
    +compareSqlValue _ (SqlDiffTime _) = GT
    +compareSqlValue (SqlPOSIXTime v) (SqlPOSIXTime v') = compare v v'
    +compareSqlValue (SqlPOSIXTime _) _ = LT
    +compareSqlValue _ (SqlPOSIXTime _) = GT
    +compareSqlValue (SqlEpochTime v) (SqlEpochTime v') = compare v v'
    +compareSqlValue (SqlEpochTime _) _ = LT
    +compareSqlValue _ (SqlEpochTime _) = GT
    +compareSqlValue (SqlTimeDiff v) (SqlTimeDiff v') = compare v v'
    +compareSqlValue (SqlTimeDiff _) _ = LT
    +compareSqlValue _ (SqlTimeDiff _) = GT
    +compareSqlValue SqlNull SqlNull = EQ
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html new file mode 100644 index 0000000..9bf59fb --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html @@ -0,0 +1,288 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.RelationalMap
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE GADTs #-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.RelationalMap
    +  ( mkTableDefinition
    +  , TableParams(..)
    +  , RelationalMap
    +  , fields
    +  , mapAttr
    +  , mapField
    +  , attrField
    +  , maybeMapper
    +  , prefixMap
    +  , partialMap
    +  , readOnlyMap
    +  , readOnlyField
    +  ) where
    +
    +import Control.Monad (join, when)
    +import Control.Monad.Reader (ask)
    +import Control.Monad.State (modify)
    +import Data.Profunctor (Profunctor(lmap, rmap))
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{-|
    + MigrationGuide: @TableParams@ no longer exists. See the migration guide
    + for 'mkTableDefinition'
    +
    + 'TableParams' is the simplest way to make a 'TableDefinition'. You
    + can use 'mkTableDefinition' to make a definition from the simplified
    + params. Where 'TableDefinition' requires the 'tableFields', 'tableFromSql',
    + and 'tableToSql' to all be defined separately and kept in sync, 'TableParams'
    + provides a single 'tblMapper' field that specifies all three simultaneously
    + and ensures they are consistent with one another.
    + -}
    +data TableParams readEntity writeEntity key = TableParams
    +  { tblName :: String
    +      -- ^ The name of the table in the database
    +  , tblMapper :: RelationalMap writeEntity readEntity
    +      -- ^ The relational mapping that defines how the Haskell entity type
    +      -- is converted both to and from sql. The fields utilized in the mapping
    +      -- are used to automatically build the list of 'FieldDefinitions' that
    +      -- define the structure of the table in the database.
    +  , tblSafeToDelete :: [String]
    +      -- ^ A list of any columns that may be deleted from the table by Orville.
    +      -- (Orville will never delete a column without being told it is safe)
    +  , tblPrimaryKey :: PrimaryKey key
    +      -- ^ A function to set the key on the entity
    +  , tblGetKey :: readEntity -> key
    +      -- ^ A function to get the key on the entity
    +  , tblComments :: TableComments ()
    +      -- ^ Any comments that might be interesting for developers to see. These
    +      -- comments will get printed in the log if there is an erro while attempting
    +      -- to migrate the table.
    +  }
    +
    +{-|
    +  Migration Guide: This function has in the new orville to take the table name,
    +  primary key definition and a @SqlMarshaller@ (formerly @RelationalMap@).
    +  Other options such as constraints, indexes, and columns to drop can be added
    +  to the @TableDefinition@ after the initial instantiation. The @TableParams@
    +  type has been dropped for the new orville.
    +
    +
    + 'mkTableDefinition' converts a 'TableParams' to 'TableDefinition'. Usually
    + this is used directly on a record literal of the 'TableParams'. For
    + example:
    +
    + @
    +  data Foo key = Foo key { fooId :: Record }
    +  myTable :: TableDefinition Foo
    +  myTable = mkTableDefinition $
    +    TableParams
    +      { tblName = "foo"
    +      , tblMapper = User <$> attrField fooId idField
    +      , tableSafeToDelete = []
    +      , tblSetKey = \key foo -> foo { fooId = key }
    +      , tblGetKey = fooId
    +      , tblComments = []
    +      }
    +
    + @
    + -}
    +mkTableDefinition ::
    +     TableParams readEntity writeEntity key
    +  -> TableDefinition readEntity writeEntity key
    +mkTableDefinition (TableParams {..}) =
    +  TableDefinition
    +    { tableFields = fields tblMapper
    +    , tableFromSql = mkFromSql tblPrimaryKey tblMapper
    +    , tableToSql = mkToSql tblMapper
    +    , tablePrimaryKey = tblPrimaryKey
    +    , tableName = tblName
    +    , tableSafeToDelete = tblSafeToDelete
    +    , tableGetKey = tblGetKey
    +    , tableComments = tblComments
    +    }
    +
    +{- |
    +  Migration guide: This type has been replaced with the @SqlMarshaller@ type in
    +  the new orville. The interface is similar, though the names of the functions
    +  have been updated in many cases. See the migration guides for those functions
    +  to find their new names.
    +-}
    +data RelationalMap a b where
    +  RM_Field :: FieldDefinition nullability a -> RelationalMap a a
    +  RM_Nest :: (a -> b) -> RelationalMap b c -> RelationalMap a c
    +  RM_Pure :: b -> RelationalMap a b
    +  RM_Apply
    +    :: RelationalMap a (b -> c) -> RelationalMap a b -> RelationalMap a c
    +  RM_Partial :: RelationalMap a (Either String a) -> RelationalMap a a
    +  RM_ReadOnly :: RelationalMap a b -> RelationalMap c b
    +  RM_MaybeTag
    +    :: RelationalMap (Maybe a) (Maybe b) -> RelationalMap (Maybe a) (Maybe b)
    +
    +instance Functor (RelationalMap a) where
    +  fmap f rm = pure f <*> rm
    +
    +instance Applicative (RelationalMap a) where
    +  pure = RM_Pure
    +  (<*>) = RM_Apply
    +
    +instance Profunctor RelationalMap where
    +  rmap = fmap
    +  lmap = mapAttr
    +
    +{- |
    +  Migration Guide: @mapAttr@ has been renamed to @marshallNested@
    +-}
    +mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c
    +mapAttr = RM_Nest
    +
    +{- |
    +  Migration Guide: @mapField@ has been removed, though its functional
    +  equivalent is @marshallReadOnlyField@
    +-}
    +mapField :: FieldDefinition nullability a -> RelationalMap a a
    +mapField = RM_Field
    +
    +{- |
    +  Migration Guide: @partialMap@ has been renamed to @marshallPartial@
    +-}
    +partialMap :: RelationalMap a (Either String a) -> RelationalMap a a
    +partialMap = RM_Partial
    +
    +{- |
    +  Migration Guide: @readOnlyMap@ has been renamed to @marshallReadOnly@
    +-}
    +readOnlyMap :: RelationalMap a b -> RelationalMap c b
    +readOnlyMap = RM_ReadOnly
    +
    +{- |
    +  Migration Guide: @attrField@ has been renamed to @marshallField@
    +-}
    +attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b
    +attrField get = mapAttr get . mapField
    +
    +{- |
    +  Migration Guide: @readOnlyField@ has been renamed to @marshallReadOnlyField@
    +-}
    +readOnlyField :: FieldDefinition nullability a -> RelationalMap b a
    +readOnlyField = readOnlyMap . mapField
    +
    +{- |
    +  Migration Guide: @prefixMap@ has been renamed to @prefixMarshaller@
    +-}
    +prefixMap :: String -> RelationalMap a b -> RelationalMap a b
    +prefixMap prefix (RM_Nest f rm) = RM_Nest f (prefixMap prefix rm)
    +prefixMap prefix (RM_Field f) = RM_Field (f `withPrefix` prefix)
    +prefixMap prefix (RM_Apply rmF rmA) =
    +  RM_Apply (prefixMap prefix rmF) (prefixMap prefix rmA)
    +prefixMap prefix (RM_Partial rm) = RM_Partial (prefixMap prefix rm)
    +prefixMap prefix (RM_ReadOnly rm) = RM_ReadOnly (prefixMap prefix rm)
    +prefixMap prefix (RM_MaybeTag rm) = RM_MaybeTag (prefixMap prefix rm)
    +prefixMap _ rm@(RM_Pure _) = rm
    +
    +{- |
    +  Migration Guide: @maybeMapper@ has been renamed to @marshallMaybe@
    +-}
    +maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b)
    +maybeMapper
    +    -- rewrite the mapper to handle null fields, then tag
    +    -- it as having been done so we don't double-map it
    +    -- in a future `maybeMapper` call.
    +    --
    + = RM_MaybeTag . go
    +  where
    +    go :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b)
    +    go (RM_Nest f rm) = RM_Nest (fmap f) (go rm)
    +    go (RM_Field f) =
    +      case checkNullability f of
    +        NotNullField notNullField ->
    +          RM_Field (nullableField notNullField)
    +
    +        NullableField nullField ->
    +          -- When the underlying field is already nullable we need to make sure
    +          -- that 'NULL' is decoded to a 'Just'. Otherwise when the field is
    +          -- 'NULL' it causes the entire 'RelationalMap' to resolve to a
    +          -- 'Nothing' as if _all_ fields were 'NULL', even if they were not.
    +          RM_Field (asymmetricNullableField nullField)
    +
    +    go (RM_Pure a) = RM_Pure (pure a)
    +    go (RM_Apply rmF rmA) = RM_Apply (fmap (<*>) $ go rmF) (go rmA)
    +    go (RM_Partial rm) = RM_Partial (flipError <$> go rm)
    +      where
    +        flipError :: Maybe (Either String a) -> Either String (Maybe a)
    +        flipError (Just (Right a)) = Right (Just a)
    +        flipError (Just (Left err)) = Left err
    +        flipError Nothing = Right Nothing
    +    go (RM_ReadOnly rm) = RM_ReadOnly (go rm)
    +    go rm@(RM_MaybeTag _) = fmap Just $ mapAttr join $ rm
    +
    +{- |
    +  Migration Guide: The fields in new orville's @SqlMarshaller@ are somewhat
    +  more sophisticated than those of a @RelationalMap@. The 'fields' function is
    +  no longer offered with this simple interface as a result, but the
    +  @foldMarshallerFields@ function can be used in combination with the
    +  @collectFromField@ helper to collect the desired information from each field.
    +-}
    +fields :: RelationalMap a b -> [SomeField]
    +fields (RM_Field field) = [SomeField field]
    +fields (RM_Apply rm1 rm2) = fields rm1 ++ fields rm2
    +fields (RM_Nest _ rm) = fields rm
    +fields (RM_Partial rm) = fields rm
    +fields (RM_MaybeTag rm) = fields rm
    +fields (RM_Pure _) = []
    +fields (RM_ReadOnly rm) =
    +  map (someFieldWithFlag AssignedByDatabase) (fields rm)
    +  where
    +    someFieldWithFlag flag (SomeField f) = SomeField (f `withFlag` flag)
    +
    +mkFromSql :: PrimaryKey key -> RelationalMap a b -> FromSql b
    +mkFromSql (PrimaryKey pKeyPart pKeyParts) relMap =
    +  fromSql
    +    { runFromSql = \columns ->
    +        -- lookup the primary key columns
    +        let keyNames = map getColName (pKeyPart : pKeyParts)
    +            primKeys = filter ((`elem` keyNames) . fst) columns
    +
    +         in case runFromSql fromSql columns of
    +              -- Add the primary key(s) to relevant error messages
    +              Left (RowDataError details) ->
    +                Left $ RowDataError details
    +                         { rowErrorPrimaryKeys = primKeys }
    +
    +              Left (ConversionError details) ->
    +                Left $ ConversionError details
    +                         { convErrorPrimaryKeys = primKeys }
    +
    +              x -> x
    +    }
    +  where
    +    fromSql = fromRelMap relMap
    +
    +    getColName (PrimaryKeyPart _ fieldDef) = fieldName fieldDef
    +
    +    fromRelMap :: RelationalMap a b -> FromSql b
    +    fromRelMap (RM_Field field) = fieldFromSql field
    +    fromRelMap (RM_Nest _ rm) = fromRelMap rm
    +    fromRelMap (RM_ReadOnly rm) = fromRelMap rm
    +    fromRelMap (RM_MaybeTag rm) = fromRelMap rm
    +    fromRelMap (RM_Pure b) = pure b
    +    fromRelMap (RM_Apply rmF rmC) = fromRelMap rmF <*> fromRelMap rmC
    +    fromRelMap (RM_Partial rm) = do
    +      joinFromSqlError (wrapError <$> fromRelMap rm)
    +    wrapError = either (Left . simpleConversionError) Right
    +
    +mkToSql :: RelationalMap a b -> ToSql a ()
    +mkToSql (RM_Field field) =
    +  when (not $ isAssignedByDatabaseField field) $ do
    +    value <- ask
    +    modify (fieldToSqlValue field value :)
    +mkToSql (RM_Nest f rm) = getComponent f (mkToSql rm)
    +mkToSql (RM_Apply rmF rmC) = mkToSql rmF >> mkToSql rmC
    +mkToSql (RM_Partial rm) = mkToSql rm
    +mkToSql (RM_MaybeTag rm) = mkToSql rm
    +mkToSql (RM_ReadOnly _) = pure ()
    +mkToSql (RM_Pure _) = pure ()
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html new file mode 100644 index 0000000..0e3091c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html @@ -0,0 +1,102 @@ +
    module Database.Orville.PostgreSQL.Internal.SchemaState
    +  ( SchemaState
    +  , schemaStateTableColumns
    +  , schemaStateTableExists
    +  , schemaStateIndexExists
    +  , schemaStateConstraintExists
    +  , schemaStateSequenceExists
    +  , loadSchemaState
    +  ) where
    +
    +import Control.Monad (forM, void)
    +import Data.Convertible (convert)
    +import qualified Database.HDBC as HDBC
    +
    +import qualified Data.Map.Strict as Map
    +import qualified Data.Set as Set
    +
    +type TableName = String
    +
    +type IndexName = String
    +
    +type ConstraintName = String
    +
    +type SequenceName = String
    +
    +type Columns = [(String, HDBC.SqlColDesc)]
    +
    +data SchemaState = SchemaState
    +  { schemaStateTables :: Map.Map TableName Columns
    +  , schemaStateIndexes :: Set.Set IndexName
    +  , schemaStateConstraints :: Set.Set ConstraintName
    +  , schemaStateSequences :: Set.Set SequenceName
    +  }
    +
    +schemaStateTableColumns :: TableName -> SchemaState -> Maybe Columns
    +schemaStateTableColumns name = Map.lookup name . schemaStateTables
    +
    +schemaStateTableExists :: TableName -> SchemaState -> Bool
    +schemaStateTableExists name = Map.member name . schemaStateTables
    +
    +schemaStateIndexExists :: IndexName -> SchemaState -> Bool
    +schemaStateIndexExists name = Set.member name . schemaStateIndexes
    +
    +schemaStateConstraintExists :: ConstraintName -> SchemaState -> Bool
    +schemaStateConstraintExists name = Set.member name . schemaStateConstraints
    +
    +schemaStateSequenceExists :: SequenceName -> SchemaState -> Bool
    +schemaStateSequenceExists name = Set.member name . schemaStateSequences
    +
    +loadSchemaState :: HDBC.IConnection conn => conn -> IO SchemaState
    +loadSchemaState conn = do
    +  SchemaState <$> getTables conn
    +              <*> getIndexes conn
    +              <*> getConstraints conn
    +              <*> getSequences conn
    +
    +getTables :: HDBC.IConnection conn => conn -> IO (Map.Map TableName Columns)
    +getTables conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT table_name from information_schema.tables where table_schema = current_schema();"
    +  void $ HDBC.execute query []
    +  tables <- map (convert . head) <$> HDBC.fetchAllRows' query
    +  fmap Map.fromList $
    +    forM tables $ \table -> do
    +      columns <- HDBC.describeTable conn table
    +      pure (table, columns)
    +
    +getIndexes :: HDBC.IConnection conn => conn -> IO (Set.Set IndexName)
    +getIndexes conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT indexname FROM pg_indexes WHERE schemaname = current_schema();"
    +  void $ HDBC.execute query []
    +  Set.fromList <$> map (convert . head) <$> HDBC.fetchAllRows' query
    +
    +getConstraints :: HDBC.IConnection conn => conn -> IO (Set.Set ConstraintName)
    +getConstraints conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT conname \
    +                        \FROM pg_constraint \
    +                        \JOIN pg_namespace ON pg_namespace.oid = pg_constraint.connamespace \
    +                        \WHERE nspname = current_schema()"
    +  void $ HDBC.execute query []
    +  Set.fromList <$> map (convert . head) <$> HDBC.fetchAllRows' query
    +
    +getSequences :: HDBC.IConnection conn => conn -> IO (Set.Set SequenceName)
    +getSequences conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT c.relname \
    +                          \FROM pg_class AS c \
    +                          \JOIN pg_namespace AS ns ON c.relnamespace = ns.oid \
    +                          \WHERE c.relkind = 'S' AND current_schema() = ns.nspname;"
    +  void $ HDBC.execute query []
    +  Set.fromList <$> map (convert . head) <$> HDBC.fetchAllRows' query
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html new file mode 100644 index 0000000..f84c2aa --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html @@ -0,0 +1,77 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Select
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Select where
    +
    +import Control.Monad.Reader
    +import qualified Data.List as List
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition (fieldToNameForm)
    +import Database.Orville.PostgreSQL.Internal.FromClause
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data Select row = Select
    +  { selectBuilder :: FromSql row
    +  , selectSql :: String
    +  , selectValues :: [SqlValue]
    +  }
    +
    +selectQueryColumns ::
    +     [SelectExpr] -> FromSql row -> FromClause -> SelectOptions -> Select row
    +selectQueryColumns selectExprs builder fromClause opts =
    +  selectQueryRaw builder querySql (selectOptValues opts)
    +  where
    +    columns =
    +      List.intercalate ", " $ map (rawExprToSql . generateSql) selectExprs
    +    querySql =
    +      List.concat
    +        [ selectClause opts
    +        , columns
    +        , " "
    +        , fromClauseToSql fromClause
    +        , " "
    +        , selectOptClause opts
    +        ]
    +
    +selectQuery :: FromSql row -> FromClause -> SelectOptions -> Select row
    +selectQuery builder =
    +  selectQueryColumns (expr <$> fromSqlSelects builder) builder
    +
    +selectQueryTable ::
    +     TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> Select readEntity
    +selectQueryTable tbl = selectQuery (tableFromSql tbl) (fromClauseTable tbl)
    +
    +selectQueryRows ::
    +     [SelectExpr] -> FromClause -> SelectOptions -> Select [(String, SqlValue)]
    +selectQueryRows exprs = selectQueryColumns exprs rowFromSql
    +
    +selectQueryRaw :: FromSql row -> String -> [SqlValue] -> Select row
    +selectQueryRaw = Select
    +
    +selectQueryRawRows :: String -> [SqlValue] -> Select [(String, SqlValue)]
    +selectQueryRawRows = selectQueryRaw rowFromSql
    +
    +-- N.B. This FromSql does *not* contain an accurate list of the columns
    +-- it decodes, because it does not decode any columns at all. It is not
    +-- suitable for uses where the FromSql is used to generate the columns in
    +-- a select clause. It is not exposed publically for this reason.
    +--
    +rowFromSql :: FromSql [(String, SqlValue)]
    +rowFromSql =
    +  FromSql
    +    { fromSqlSelects =
    +        error
    +          "Database.Orville.PostgreSQL.Select.rowFromSql: fromSqlColumnNames was accessed. This is a bug."
    +    , runFromSql = Right <$> ask
    +    }
    +
    +selectField :: FieldDefinition nulability a -> SelectForm
    +selectField field = selectColumn (fieldToNameForm field)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html new file mode 100644 index 0000000..305862a --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html @@ -0,0 +1,147 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.SelectOptions
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP#-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.SelectOptions where
    +
    +import Data.Convertible
    +import qualified Data.List as List
    +import Data.Maybe
    +import Data.Monoid
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition ()
    +import Database.Orville.PostgreSQL.Internal.GroupBy
    +import Database.Orville.PostgreSQL.Internal.OrderBy
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types ()
    +import Database.Orville.PostgreSQL.Internal.Where
    +
    +data SelectOptions = SelectOptions
    +  { selectDistinct :: First Bool
    +  , selectOptWhere :: [WhereCondition]
    +  , selectOptOrder :: [OrderByClause]
    +  , selectOptLimit :: First Int
    +  , selectOptOffset :: First Int
    +  , selectOptGroup :: [GroupByClause]
    +  }
    +
    +selectOptLimitSql :: SelectOptions -> Maybe SqlValue
    +selectOptLimitSql = fmap convert . getFirst . selectOptLimit
    +
    +selectOptOffsetSql :: SelectOptions -> Maybe SqlValue
    +selectOptOffsetSql = fmap convert . getFirst . selectOptOffset
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup SelectOptions where
    +  (<>) = appendSelectOptions
    +#endif
    +
    +instance Monoid SelectOptions where
    +  mempty = SelectOptions mempty mempty mempty mempty mempty mempty
    +  mappend = appendSelectOptions
    +
    +appendSelectOptions :: SelectOptions -> SelectOptions -> SelectOptions
    +appendSelectOptions opt opt' =
    +  SelectOptions
    +    (selectDistinct  opt <> selectDistinct  opt')
    +    (selectOptWhere  opt <> selectOptWhere  opt')
    +    (selectOptOrder  opt <> selectOptOrder  opt')
    +    (selectOptLimit  opt <> selectOptLimit  opt')
    +    (selectOptOffset opt <> selectOptOffset opt')
    +    (selectOptGroup  opt <> selectOptGroup  opt')
    +
    +instance QueryKeyable SelectOptions where
    +  queryKey opt =
    +    mconcat
    +      [ qkOp "WHERE" $ selectOptWhere opt
    +      , qkOp "GROUP" $ selectOptGroup opt
    +      , qkOp "ORDER" $ selectOptOrder opt
    +      , qkOp "LIMIT" $ selectOptLimitSql opt
    +      , qkOp "OFFSET" $ selectOptOffsetSql opt
    +      ]
    +
    +selectClause :: SelectOptions -> String
    +selectClause opts =
    +  case selectDistinct opts of
    +    First (Just True)  -> "SELECT DISTINCT "
    +    _ -> "SELECT "
    +
    +selectOptClause :: SelectOptions -> String
    +selectOptClause opts =
    +  List.intercalate
    +    " "
    +    [ selectWhereClause opts
    +    , selectGroupByClause opts
    +    , selectOrderByClause opts
    +    , selectLimitClause opts
    +    , selectOffsetClause opts
    +    ]
    +
    +selectWhereClause :: SelectOptions -> String
    +selectWhereClause = whereClause . selectOptWhere
    +
    +selectOrderByClause :: SelectOptions -> String
    +selectOrderByClause = clause . selectOptOrder
    +  where
    +    clause [] = ""
    +    clause sortClauses =
    +      "ORDER BY " ++ List.intercalate ", " (map sortingSql sortClauses)
    +
    +selectGroupByClause :: SelectOptions -> String
    +selectGroupByClause = clause . selectOptGroup
    +  where
    +    clause [] = ""
    +    clause groupClauses =
    +      "GROUP BY " ++ List.intercalate ", " (map groupingSql groupClauses)
    +
    +selectOptValues :: SelectOptions -> [SqlValue]
    +selectOptValues opts =
    +  concat
    +    [ whereValues $ selectOptWhere opts
    +    , concatMap groupingValues $ selectOptGroup opts
    +    , concatMap sortingValues $ selectOptOrder opts
    +    , maybeToList $ selectOptLimitSql opts
    +    , maybeToList $ selectOptOffsetSql opts
    +    ]
    +
    +selectLimitClause :: SelectOptions -> String
    +selectLimitClause opts =
    +  case getFirst $ selectOptLimit opts of
    +    Nothing -> ""
    +    Just _ -> "LIMIT ?"
    +
    +selectOffsetClause :: SelectOptions -> String
    +selectOffsetClause opts =
    +  case getFirst $ selectOptOffset opts of
    +    Nothing -> ""
    +    Just _ -> "OFFSET ?"
    +
    +distinct :: SelectOptions
    +distinct = SelectOptions (First $ Just True) mempty mempty mempty mempty mempty
    +
    +where_ :: WhereCondition -> SelectOptions
    +where_ clause = SelectOptions mempty [clause] mempty mempty mempty mempty
    +
    +order :: ToOrderBy a => a -> SortDirection -> SelectOptions
    +order orderable dir =
    +  SelectOptions mempty mempty [toOrderBy orderable dir] mempty mempty mempty
    +
    +limit :: Int -> SelectOptions
    +limit n = SelectOptions mempty mempty mempty (First $ Just n) mempty mempty
    +
    +offset :: Int -> SelectOptions
    +offset n = SelectOptions mempty mempty mempty mempty (First $ Just n) mempty
    +
    +groupBy :: ToGroupBy a => a -> SelectOptions
    +groupBy groupable =
    +  SelectOptions mempty mempty mempty mempty mempty [toGroupBy groupable]
    +
    +selectOptionsToSql :: SelectOptions -> (String, [SqlValue])
    +selectOptionsToSql opts =
    +  (selectOptClause opts, selectOptValues opts)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html new file mode 100644 index 0000000..01395db --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html @@ -0,0 +1,45 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Sql
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Sql where
    +
    +import qualified Data.List as List
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +
    +mkInsertClause :: String -> [String] -> String
    +mkInsertClause tblName columnNames = mkInsertManyClause tblName columnNames 1
    +
    +mkInsertManyClause :: String -> [String] -> Int -> String
    +mkInsertManyClause tblName columnNames recordCount =
    +  mkInsertIntoClause tblName columnNames ++ " VALUES " ++ placeholders
    +  where
    +    placeholder = "(" ++ (List.intercalate "," $ map (const "?") columnNames) ++ ")"
    +    placeholders = List.intercalate "," $ replicate recordCount placeholder
    +
    +mkInsertIntoClause :: String -> [String] -> String
    +mkInsertIntoClause tblName columnNames =
    +  "INSERT INTO " ++
    +  escapedName tblName ++ " (" ++ columns ++ ")"
    +  where
    +    escapedColumnNames = rawExprToSql . generateSql . NameForm Nothing <$> columnNames
    +    columns = List.intercalate "," $ escapedColumnNames
    +
    +mkUpdateClause :: String -> [String] -> String
    +mkUpdateClause tblName columnNames =
    +  "UPDATE " ++ escapedName tblName ++ " SET " ++ placeholders
    +  where
    +    escapedColumnNames = rawExprToSql . generateSql . NameForm Nothing <$> columnNames
    +    placeholders = List.intercalate "," $ map columnUpdateSql escapedColumnNames
    +    columnUpdateSql column = column ++ " = ?"
    +
    +mkDeleteClause :: String -> String
    +mkDeleteClause tblName = "DELETE FROM " ++ escapedName tblName
    +
    +escapedName :: String -> String
    +escapedName name = concat ["\"", name, "\""]
    +-- If you came here looking for mkSelectClause, check out
    +-- Database.Orville.PostgreSQL.Internal.Select
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html new file mode 100644 index 0000000..1743f8b --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html @@ -0,0 +1,427 @@ +
    module Database.Orville.PostgreSQL.Internal.SqlType
    +  ( SqlType(..)
    +  , RowDataErrorReason(..)
    +  , serial
    +  , bigserial
    +  , text
    +  , unboundedText
    +  , varText
    +  , integer
    +  , bigInteger
    +  , double
    +  , boolean
    +  , date
    +  , timestamp
    +  , textSearchVector
    +  , foreignRefType
    +  , convertSqlType
    +  , maybeConvertSqlType
    +  , eitherConvertSqlType
    +  , showSqlValueType
    +  ) where
    +
    +import Control.Monad ((<=<))
    +import qualified Data.Int as Int
    +import qualified Data.Text as T
    +import qualified Data.Text.Encoding as Enc
    +import qualified Data.Time as Time
    +import Data.Typeable
    +import qualified Database.HDBC as HDBC
    +
    +{-|
    +  SqlType defines the mapping of a Haskell type (`a`) to a SQL column type in the
    +  database. This includes both how to convert the type to and from the raw values
    +  read from the database as well as the schema information required to create
    +  and migrate columns using the type.
    +  -}
    +data SqlType a = SqlType
    +  { sqlTypeDDL :: String
    +    -- ^ The raw SQL DDL to use when creating/migrating columns of this type
    +    -- (not including any NULL or NOT NULL declarations)
    +  , sqlTypeReferenceDDL :: Maybe String
    +    -- ^ The raw SQL DDL to use when creating/migrating columns with foreign
    +    -- keys to this type. This is used foreignRefType to build a new SqlType
    +    -- when making foreign key fields
    +  , sqlTypeId :: HDBC.SqlTypeId
    +    -- ^ 'sqlTypeId' will be compared to the 'colType' field found in the
    +    -- 'HDBC.SqlColDesc' return by 'describeTable' when determining whether
    +    -- a column type change is required when migrating the database.
    +  , sqlTypeSqlSize :: Maybe Int
    +    -- ^ 'sqlTypeSqlSize will be compared to the 'colSize' field found in the
    +    -- 'HDBC.SqlColDesc' return by 'describeTable' when determining whether
    +    -- a column type change is required when migrating the database.
    +  , sqlTypeToSql :: a -> HDBC.SqlValue
    +    -- ^ A function for converting Haskell values of this type into values to
    +    -- be stored in the database.
    +  , sqlTypeFromSql :: HDBC.SqlValue -> Either RowDataErrorReason a
    +    -- ^ A function for converting values of this are stored in the database
    +    -- into Haskell values. This function should return 'Left
    +    -- RowDataErrorReason' to indicate an error if the conversion is
    +    -- impossible. Otherwise it should return 'Right' the corresponding @a@
    +    -- value.
    +  }
    +
    +{-|
    +  'serial' defines a 32-bit auto-incrementing column type. This corresponds to
    +  the "SERIAL" type in PostgreSQL.
    +  -}
    +serial :: SqlType Int.Int32
    +serial =
    +  SqlType
    +    { sqlTypeDDL = "SERIAL"
    +    , sqlTypeReferenceDDL = Just "INTEGER"
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 4
    +    , sqlTypeToSql = int32ToSql
    +    , sqlTypeFromSql = int32FromSql
    +    }
    +
    +{-|
    +  'bigserial' defines a 64-bit auto-incrementing column type. This corresponds to
    +  the "BIGSERIAL" type in PostgresSQL.
    +  -}
    +bigserial :: SqlType Int.Int64
    +bigserial =
    +  SqlType
    +    { sqlTypeDDL = "BIGSERIAL"
    +    , sqlTypeReferenceDDL = Just "BIGINT"
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = int64ToSql
    +    , sqlTypeFromSql = int64FromSql
    +    }
    +
    +{-|
    +  'text' defines a fixed length text field type. This corresponds to a
    +  "CHAR(len)" type in SQL.
    +  -}
    +text :: Int -> SqlType T.Text
    +text len =
    +  SqlType
    +    { sqlTypeDDL = concat ["CHAR(", show len, ")"]
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlCharT
    +    , sqlTypeSqlSize = Just len
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +{-|
    +  'varText' defines a variable text field type with a max length. This
    +  corresponds to a "VARCHAR(len)" type in SQL.
    +  -}
    +varText :: Int -> SqlType T.Text
    +varText len =
    +  SqlType
    +    { sqlTypeDDL = concat ["VARCHAR(", show len, ")"]
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlVarCharT
    +    , sqlTypeSqlSize = Just len
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +{-|
    +  'unboundedText' defines a fixed length text field type. This corresponds to a
    +  "TEXT" type in PostgreSQL.
    +  -}
    +unboundedText :: SqlType T.Text
    +unboundedText =
    +  SqlType
    +    { sqlTypeDDL = concat ["TEXT"]
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlVarCharT
    +    , sqlTypeSqlSize = Nothing
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +
    +{-|
    +  'integer' defines a 32-bit integer type. This corresponds to the "INTEGER" type in SQL.
    +  -}
    +integer :: SqlType Int.Int32
    +integer =
    +  SqlType
    +    { sqlTypeDDL = "INTEGER"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 4
    +    , sqlTypeToSql = int32ToSql
    +    , sqlTypeFromSql = int32FromSql
    +    }
    +
    +{-|
    +  'bigInteger' defines a 64-bit integer type. This corresponds to the "BIGINT"
    +  type in SQL.
    +  -}
    +bigInteger :: SqlType Int.Int64
    +bigInteger =
    +  SqlType
    +    { sqlTypeDDL = "BIGINT"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = int64ToSql
    +    , sqlTypeFromSql = int64FromSql
    +    }
    +
    +{-|
    +  'double' defines a floating point numeric type. This corresponds to the "DOUBLE
    +  PRECISION" type in SQL.
    +  -}
    +double :: SqlType Double
    +double =
    +  SqlType
    +    { sqlTypeDDL = "DOUBLE PRECISION"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlFloatT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = doubleToSql
    +    , sqlTypeFromSql = doubleFromSql
    +    }
    +
    +{-|
    +  'boolean' defines a True/False boolean type. This corresponds to the "BOOLEAN"
    +  type in SQL.
    +  -}
    +boolean :: SqlType Bool
    +boolean =
    +  SqlType
    +    { sqlTypeDDL = "BOOLEAN"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlBitT
    +    , sqlTypeSqlSize = Just 1
    +    , sqlTypeToSql = booleanToSql
    +    , sqlTypeFromSql = booleanFromSql
    +    }
    +
    +{-|
    +  'date' defines a type representing a calendar date (without time zone). It corresponds
    +  to the "DATE" type in SQL.
    +  -}
    +date :: SqlType Time.Day
    +date =
    +  SqlType
    +    { sqlTypeDDL = "DATE"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlDateT
    +    , sqlTypeSqlSize = Just 4
    +    , sqlTypeToSql = dayToSql
    +    , sqlTypeFromSql = dayFromSql
    +    }
    +
    +{-|
    +  'timestamp' defines a type representing a particular point in time (without time zone).
    +  It corresponds to the "TIMESTAMP with time zone" type in SQL.
    +
    +  Note: This is NOT a typo. The "TIMESTAMP with time zone" type in SQL does not include
    +  any actual time zone information. For an excellent explanation of the complexities
    +  involving this type, please see Chris Clark's blog post about it:
    +  http://blog.untrod.com/2016/08/actually-understanding-timezones-in-postgresql.html
    +  -}
    +timestamp :: SqlType Time.UTCTime
    +timestamp =
    +  SqlType
    +    { sqlTypeDDL = "TIMESTAMP with time zone"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlTimestampWithZoneT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = utcTimeToSql
    +    , sqlTypeFromSql = utcTimeFromSql
    +    }
    +
    +{-|
    +  'textSearchVector' defines a type for indexed text searching. It corresponds to the
    +  "TSVECTOR" type in PostgreSQL.
    +  -}
    +textSearchVector :: SqlType T.Text
    +textSearchVector =
    +  SqlType
    +    { sqlTypeDDL = "TSVECTOR"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlUnknownT "3614"
    +    , sqlTypeSqlSize = Nothing
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +{-|
    +  'foreignRefType' creates a 'SqlType' suitable for columns will be foreign
    +  keys referencing a column of the given 'SqlType'. For most types the
    +  underlying sql type with be identical, but for special types (such as
    +  autoincrementing primary keys), the type construted by 'foreignRefType' with
    +  have regular underlying sql type. Each 'SqlType' definition must specify any
    +  special handling required when creating foreign reference types by setting
    +  the 'sqlTypeReferenceDDL' field to an appropriate value.
    +  -}
    +foreignRefType :: SqlType a -> SqlType a
    +foreignRefType sqlType =
    +  case sqlTypeReferenceDDL sqlType of
    +    Nothing -> sqlType
    +    Just refDDL -> sqlType {sqlTypeDDL = refDDL, sqlTypeReferenceDDL = Nothing}
    +
    +{-|
    +  Migration Guide: @maybeConvertSqlType@ has been replaced with
    +  @tryConvertSqlType@, which allows an error message to be returned when
    +  conversion fails.
    +
    +  'maybeConvertSqlType' changes the Haskell type used by a 'SqlType' without
    +  changing the column type that will be used in the database schema. The
    +  functions given will be used to convert the now Haskell type to and from the
    +  original type when reading and writing values from the database. When reading
    +  an @a@ value from the database, the conversion function should produce
    +  'Nothing' if the value cannot be successfully converted to a @b@.
    +  -}
    +maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b
    +maybeConvertSqlType bToA aToB =
    +  eitherConvertSqlType bToA
    +    $ maybe (Left $ DecodingFailure "SqlType conversion failed") Right . aToB
    +
    +{-|
    +  'eitherConvertSqlType' changes the Haskell type used by a 'SqlType' without
    +  changing the column type that will be used in the database schema. The
    +  functions given will be used to convert the new Haskell type to and from the
    +  original type when reading and writing values from the database. When reading
    +  an @a@ value from the database, the conversion function should produce
    +  @Left "reason"@ if the value cannot be successfully converted to a @b@.
    +-}
    +eitherConvertSqlType :: (b -> a) -> (a -> Either RowDataErrorReason b) -> SqlType a -> SqlType b
    +eitherConvertSqlType bToA aToB sqlType =
    +  sqlType
    +    { sqlTypeToSql = sqlTypeToSql sqlType . bToA
    +    , sqlTypeFromSql = aToB <=< sqlTypeFromSql sqlType
    +    }
    +
    +{-|
    +  Migration Guide: @convertSqlType@ retains the same name
    +
    +  'convertSqlType' changes the Haskell type used by a 'SqlType' in the same manner
    +  as 'maybeConvertSqlType' in cases where an 'a' can always be converted to a 'b'.
    +  -}
    +convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b
    +convertSqlType bToA aToB = maybeConvertSqlType bToA (Just . aToB)
    +
    +int32ToSql :: Int.Int32 -> HDBC.SqlValue
    +int32ToSql = HDBC.SqlInt32
    +
    +int32FromSql :: HDBC.SqlValue -> Either RowDataErrorReason Int.Int32
    +int32FromSql sql =
    +  case sql of
    +    HDBC.SqlInt32 n -> Right n
    +    HDBC.SqlInteger n -> toBoundedInteger n
    +    sqlValue -> Left $ mismatchError "int32" sqlValue
    +
    +int64ToSql :: Int.Int64 -> HDBC.SqlValue
    +int64ToSql = HDBC.SqlInt64
    +
    +int64FromSql :: HDBC.SqlValue -> Either RowDataErrorReason Int.Int64
    +int64FromSql sql =
    +  case sql of
    +    HDBC.SqlInt64 n -> Right n
    +    HDBC.SqlInteger n -> toBoundedInteger n
    +    sqlValue -> Left $ mismatchError "int64" sqlValue
    +
    +textToSql :: T.Text -> HDBC.SqlValue
    +textToSql = HDBC.SqlByteString . Enc.encodeUtf8
    +
    +textFromSql :: HDBC.SqlValue -> Either RowDataErrorReason T.Text
    +textFromSql sql =
    +  case sql of
    +    HDBC.SqlByteString bytes -> Right $ Enc.decodeUtf8 bytes
    +    HDBC.SqlString string -> Right $ T.pack string
    +    sqlValue -> Left $ mismatchError "text" sqlValue
    +
    +doubleToSql :: Double -> HDBC.SqlValue
    +doubleToSql = HDBC.SqlDouble
    +
    +doubleFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Double
    +doubleFromSql sql =
    +  case sql of
    +    HDBC.SqlDouble d -> Right d
    +    sqlValue -> Left $ mismatchError "double" sqlValue
    +
    +booleanToSql :: Bool -> HDBC.SqlValue
    +booleanToSql = HDBC.SqlBool
    +
    +booleanFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Bool
    +booleanFromSql sql =
    +  case sql of
    +    HDBC.SqlBool b -> Right b
    +    sqlValue -> Left $ mismatchError "boolean" sqlValue
    +
    +dayToSql :: Time.Day -> HDBC.SqlValue
    +dayToSql = HDBC.SqlLocalDate
    +
    +dayFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Time.Day
    +dayFromSql sql =
    +  case sql of
    +    HDBC.SqlLocalDate d -> Right d
    +    sqlValue -> Left $ mismatchError "day" sqlValue
    +
    +utcTimeToSql :: Time.UTCTime -> HDBC.SqlValue
    +utcTimeToSql = HDBC.SqlUTCTime
    +
    +utcTimeFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Time.UTCTime
    +utcTimeFromSql sql =
    +  case sql of
    +    HDBC.SqlUTCTime   t -> Right t
    +    HDBC.SqlZonedTime t -> Right (Time.zonedTimeToUTC t)
    +    sqlValue -> Left $ mismatchError "UTC time" sqlValue
    +
    +toBoundedInteger :: (Bounded num, Integral num) => Integer -> Either RowDataErrorReason num
    +toBoundedInteger source =
    +  let truncated = fromInteger source
    +      upper = toInteger (maxBound `asTypeOf` truncated)
    +      lower = toInteger (minBound `asTypeOf` truncated)
    +   in if lower <= source && source <= upper
    +        then Right truncated
    +        else Left $ IntegralOutOfBounds lower upper source
    +
    +-- | Error text for when the expected type doesn't match the Sql type
    +mismatchError :: String -> HDBC.SqlValue -> RowDataErrorReason
    +mismatchError expected actual =
    +  TypeMismatch expected (showSqlValueType actual)
    +
    +-- | User friendly identifier labels for 'SqlValues'
    +showSqlValueType :: HDBC.SqlValue -> String
    +showSqlValueType v =
    +  case v of
    +    HDBC.SqlString _ -> "string"
    +    HDBC.SqlByteString _ -> "bytestring"
    +    HDBC.SqlWord32 _ -> "word32"
    +    HDBC.SqlWord64 _ -> "word64"
    +    HDBC.SqlInt32 _ -> "int32"
    +    HDBC.SqlInt64 _ -> "int64"
    +    HDBC.SqlInteger _ -> "integer"
    +    HDBC.SqlChar _ -> "char"
    +    HDBC.SqlBool _ -> "bool"
    +    HDBC.SqlDouble _ -> "double"
    +    HDBC.SqlRational _ -> "rational"
    +    HDBC.SqlLocalDate _ -> "local date"
    +    HDBC.SqlLocalTimeOfDay _ -> "time of day"
    +    HDBC.SqlZonedLocalTimeOfDay _ _ -> "zoned local time of day"
    +    HDBC.SqlLocalTime _ -> "local time"
    +    HDBC.SqlZonedTime _ -> "zoned time"
    +    HDBC.SqlUTCTime _ -> "utc time"
    +    HDBC.SqlDiffTime _ -> "diff time"
    +    HDBC.SqlPOSIXTime _ -> "POSIX time"
    +    HDBC.SqlEpochTime _ -> "epoch time"
    +    HDBC.SqlTimeDiff _ -> "time diff"
    +    HDBC.SqlNull -> "null"
    +
    +data RowDataErrorReason
    +  = TypeMismatch
    +  -- ^ Sql value has a different type than expected
    +      !String -- ^ Actual type
    +      !String -- ^ Expected type
    +  | IntegralOutOfBounds
    +  -- ^ An integer value was outside the expected bounds.
    +      !Integer -- ^ Lower bound
    +      !Integer -- ^ Upper bound
    +      !Integer -- ^ Actual value
    +  | DecodingFailure !String
    +  -- ^ Generic decoding failure
    +  deriving Typeable
    +
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html new file mode 100644 index 0000000..9c298ee --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html @@ -0,0 +1,28 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.TableDefinition
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.TableDefinition where
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +tableColumnNames :: TableDefinition readEntity writeEntity key -> [String]
    +tableColumnNames = map someFieldName . tableFields
    +  where
    +    someFieldName (SomeField f) = fieldName f
    +
    +tableAssignableFields ::
    +     TableDefinition readEntity writeEntity key -> [SomeField]
    +tableAssignableFields =
    +  filter (not . isSomeAssignedByDatabaseField) . tableFields
    +  where
    +    isSomeAssignedByDatabaseField (SomeField f) = isAssignedByDatabaseField f
    +
    +tableAssignableColumnNames ::
    +     TableDefinition readEntity writeEntity key -> [String]
    +tableAssignableColumnNames = map someFieldName . tableAssignableFields
    +  where
    +    someFieldName (SomeField f) = fieldName f
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html new file mode 100644 index 0000000..3a74063 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html @@ -0,0 +1,270 @@ +
    {-# LANGUAGE CPP #-}
    +{-# LANGUAGE FunctionalDependencies #-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE TypeFamilies #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Trigger where
    +
    +import Control.Applicative (Alternative)
    +import Control.Monad (MonadPlus)
    +import Control.Monad.Base (MonadBase)
    +import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow)
    +import Control.Monad.Except (MonadError(..))
    +import Control.Monad.IO.Class (MonadIO(liftIO))
    +import Control.Monad.Reader (ReaderT, ask, mapReaderT, runReaderT)
    +import Control.Monad.Trans (MonadTrans(lift))
    +import qualified Data.DList as DList
    +import Data.IORef
    +  ( IORef
    +  , atomicModifyIORef'
    +  , atomicWriteIORef
    +  , newIORef
    +  , readIORef
    +  )
    +import Data.Monoid ((<>))
    +import Data.Pool (Pool)
    +import qualified Database.HDBC as HDBC
    +import qualified Database.Orville.PostgreSQL as O
    +
    +#if MIN_VERSION_base(4,11,0)
    +import Control.Monad.Fail (MonadFail)
    +#endif
    +
    +class MonadTrigger trigger m | m -> trigger where
    +  runTriggers :: [trigger] -> m ()
    +
    +class InsertTrigger trigger readEntity where
    +  insertTriggers :: readEntity -> [trigger]
    +
    +class UpdateTrigger trigger readEntity writeEntity where
    +  updateTriggers :: readEntity -> writeEntity -> [trigger]
    +
    +class DeleteTrigger trigger readEntity where
    +  deleteTriggers :: readEntity -> [trigger]
    +
    +insertTriggered ::
    +     ( MonadThrow m
    +     , O.MonadOrville conn m
    +     , MonadTrigger trigger m
    +     , InsertTrigger trigger readEntity
    +     )
    +  => O.TableDefinition readEntity writeEntity key
    +  -> writeEntity
    +  -> m readEntity
    +insertTriggered tableDef writeEntity = do
    +  readEntity <- O.insertRecord tableDef writeEntity
    +  runTriggers $ insertTriggers readEntity
    +  pure readEntity
    +
    +updateTriggered ::
    +     ( MonadThrow m
    +     , O.MonadOrville conn m
    +     , MonadTrigger trigger m
    +     , UpdateTrigger trigger readEntity writeEntity
    +     )
    +  => O.TableDefinition readEntity writeEntity key
    +  -> readEntity
    +  -> writeEntity
    +  -> m ()
    +updateTriggered tableDef oldEntity newEntity = do
    +  O.updateRecord tableDef (O.tableGetKey tableDef oldEntity) newEntity
    +  runTriggers $ updateTriggers oldEntity newEntity
    +
    +deleteTriggered ::
    +     ( MonadThrow m
    +     , O.MonadOrville conn m
    +     , MonadTrigger trigger m
    +     , DeleteTrigger trigger readEntity
    +     )
    +  => O.TableDefinition readEntity writeEntity key
    +  -> readEntity
    +  -> m ()
    +deleteTriggered tableDef readEntity = do
    +  O.deleteRecord tableDef (O.tableGetKey tableDef readEntity)
    +  runTriggers $ deleteTriggers readEntity
    +
    +type RecordedTriggersRef trigger = IORef (RecordedTriggers trigger)
    +
    +data RecordedTriggers trigger = RecordedTriggers
    +  { committedTriggersDList :: DList.DList trigger
    +  , uncommittedTriggersDList :: Maybe (DList.DList trigger)
    +  }
    +
    +committedTriggers :: RecordedTriggers trigger -> [trigger]
    +committedTriggers = DList.toList . committedTriggersDList
    +
    +uncommittedTriggers :: RecordedTriggers trigger -> Maybe [trigger]
    +uncommittedTriggers = fmap DList.toList . uncommittedTriggersDList
    +
    +emptyTriggerData :: RecordedTriggers trigger
    +emptyTriggerData = RecordedTriggers mempty mempty
    +
    +atomicModifyIORef'_ :: IORef a -> (a -> a) -> IO ()
    +atomicModifyIORef'_ ref f = atomicModifyIORef' ref (\a -> (f a, ()))
    +
    +recordTriggers :: RecordedTriggersRef trigger -> [trigger] -> IO ()
    +recordTriggers ref triggers =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    case uncommittedTriggersDList recorded of
    +      Just uncommitted ->
    +        recorded
    +          { uncommittedTriggersDList =
    +              Just (uncommitted <> DList.fromList triggers)
    +          }
    +      Nothing ->
    +        recorded
    +          { committedTriggersDList =
    +              committedTriggersDList recorded <> DList.fromList triggers
    +          }
    +
    +startTriggerTxn :: RecordedTriggersRef trigger -> IO ()
    +startTriggerTxn ref =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    case uncommittedTriggers recorded of
    +      Just _ -> recorded
    +      Nothing -> recorded {uncommittedTriggersDList = Just DList.empty}
    +
    +commitTriggerTxn :: RecordedTriggersRef trigger -> IO ()
    +commitTriggerTxn ref =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    case uncommittedTriggersDList recorded of
    +      Just uncommitted ->
    +        recorded
    +          { uncommittedTriggersDList = Nothing
    +          , committedTriggersDList =
    +              committedTriggersDList recorded <> uncommitted
    +          }
    +      Nothing -> recorded
    +
    +rollbackTriggerTxn :: RecordedTriggersRef trigger -> IO ()
    +rollbackTriggerTxn ref =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    recorded {uncommittedTriggersDList = Nothing}
    +
    +newtype OrvilleTriggerT trigger conn m a = OrvilleTriggerT
    +  { unTriggerT :: ReaderT (RecordedTriggersRef trigger) (O.OrvilleT conn m) a
    +  } deriving ( Functor
    +             , Alternative
    +             , Applicative
    +             , Monad
    +             , MonadIO
    +             , MonadBase b
    +             , MonadThrow
    +             , MonadCatch
    +             , MonadMask
    +             , MonadPlus
    +#if MIN_VERSION_base (4,11,0)
    +             , MonadFail
    +#endif
    +             )
    +
    +instance MonadTrans (OrvilleTriggerT trigger conn) where
    +  lift = OrvilleTriggerT . lift . lift
    +
    +instance (MonadError e m) =>
    +         MonadError e (OrvilleTriggerT trigger conn m) where
    +  throwError = lift . throwError
    +  catchError action handler =
    +    OrvilleTriggerT ((unTriggerT action) `catchError` (unTriggerT . handler))
    +
    +instance (Monad m, HDBC.IConnection conn) =>
    +         O.HasOrvilleContext conn (OrvilleTriggerT trigger conn m) where
    +  getOrvilleEnv = OrvilleTriggerT $ lift O.getOrvilleEnv
    +  localOrvilleEnv f =
    +    OrvilleTriggerT . mapReaderT (O.localOrvilleEnv f) . unTriggerT
    +
    +instance MonadIO m =>
    +         MonadTrigger trigger (OrvilleTriggerT trigger conn m) where
    +  runTriggers triggers =
    +    OrvilleTriggerT $ do
    +      recordedTriggers <- ask
    +      liftIO $ recordTriggers recordedTriggers triggers
    +
    +instance (Monad m, O.MonadOrvilleControl m) =>
    +         O.MonadOrvilleControl (OrvilleTriggerT trigger conn m) where
    +  liftWithConnection = O.defaultLiftWithConnection OrvilleTriggerT unTriggerT
    +  liftFinally = O.defaultLiftFinally OrvilleTriggerT unTriggerT
    +
    +instance ( Monad m
    +         , MonadThrow m
    +         , MonadIO m
    +         , HDBC.IConnection conn
    +         , O.MonadOrvilleControl m
    +#if MIN_VERSION_base (4,11,0)
    +         , MonadFail m
    +#endif
    +         ) =>
    +         O.MonadOrville conn (OrvilleTriggerT trigger conn m)
    +
    +{-
    +   `askTriggers` retrieves triggers that have been recorded thus far. If you
    +   do not want to see the triggers returned again from future calls, you should
    +   use `clearTriggers` as well.
    + -}
    +askTriggers ::
    +     MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger)
    +askTriggers =
    +  OrvilleTriggerT $ do
    +    recordedTriggers <- ask
    +    liftIO $ readIORef recordedTriggers
    +
    +{-
    +   `clearTriggers` clears out the trigger list. This is useful if you have
    +   processed the trigger list and don't want to see those triggers again.
    + -}
    +clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m ()
    +clearTriggers =
    +  OrvilleTriggerT $ do
    +    recordedTriggers <- ask
    +    liftIO $ atomicWriteIORef recordedTriggers emptyTriggerData
    +
    +{-
    +   `runOrvilleTriggerT` runs an Orville actions that has triggering behavior and
    +   returns the triggers that were committed. Note there there will never be any
    +   *uncommitted* triggers at the end because any `withTransaction` block must
    +   by contained *within* the action passed  to `runOrvilleTriggerT`. If you
    +   layer `OrvilleTriggerT` on top of a Monad `m` that *also* allows for database
    +   connection activity, god rest your soul.
    +
    +   Note that if an exception occurs in `m` and is not caught within the action passed
    +   to `runOrvilleTriggerT`, you will lose any triggers that may have happened up to
    +   the point of the action, including those related to database operations that were
    +   successfully committed. If you wish to respond to those triggers, you need to perform
    +   some Exception handling inside the action given to `runOrvilleTriggerT` and use
    +   `askTriggers` to retrieve the triggers inside the exception handler.
    + -}
    +runOrvilleTriggerT ::
    +     (MonadIO m)
    +  => OrvilleTriggerT trigger conn m a
    +  -> Pool conn
    +  -> m (a, [trigger])
    +runOrvilleTriggerT triggerT pool = do
    +  ref <- liftIO $ newIORef emptyTriggerData
    +  let orvilleT = runReaderT (unTriggerT triggerT) ref
    +      orvilleEnv =
    +        O.addTransactionCallBack (trackTransactions ref) (O.newOrvilleEnv pool)
    +  a <- O.runOrville orvilleT orvilleEnv
    +  triggers <- committedTriggers <$> liftIO (readIORef ref)
    +  pure (a, triggers)
    +
    +mapOrvilleTriggerT :: Monad n
    +                   => (m a -> n b)
    +                   -> OrvilleTriggerT trigger conn m a
    +                   -> OrvilleTriggerT trigger conn n b
    +mapOrvilleTriggerT f triggerT =
    +  OrvilleTriggerT $
    +    mapReaderT (O.mapOrvilleT f) $
    +      unTriggerT triggerT
    +
    +liftOrville :: Monad m => O.OrvilleT conn m a -> OrvilleTriggerT trigger conn m a
    +liftOrville = OrvilleTriggerT . lift
    +
    +trackTransactions :: RecordedTriggersRef trigger -> O.TransactionEvent -> IO ()
    +trackTransactions recorded event =
    +  case event of
    +    O.TransactionStart -> startTriggerTxn recorded
    +    O.TransactionCommit -> commitTriggerTxn recorded
    +    O.TransactionRollback -> rollbackTriggerTxn recorded
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html new file mode 100644 index 0000000..481c923 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html @@ -0,0 +1,430 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Types
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE DeriveDataTypeable #-}
    +{-# LANGUAGE ExistentialQuantification #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE GADTs #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Types where
    +
    +import Control.Exception
    +import Control.Monad (join)
    +import Control.Monad.Except
    +import Control.Monad.Reader
    +import Control.Monad.State
    +import Control.Monad.Writer
    +import qualified Data.Char as Char
    +import qualified Data.List as List
    +import Data.Typeable
    +import Database.HDBC
    +
    +import qualified Data.Time as Time
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +
    +{- |
    +  Migration Guide: @Record@ has been removed. It's recommended that you
    +  create a separate record key type for each of your entities instead.
    +-}
    +type Record = Int
    +
    +type CreatedAt = Time.UTCTime
    +
    +type UpdatedAt = Time.UTCTime
    +
    +type OccurredAt = Time.UTCTime
    +
    +{- |
    +  Migration Guide: @ColumnFlag@ has been removed. Depending on flag constructor
    +  there may or may not be a replacement.
    +
    +  @ColumnDefault@ - replaced by the @setDefaultValue@ function in new orville
    +  @Unique@ - replaced by the @addUniqueConstraint@ function in new orville
    +  @References@ - replaced by the @addForeignKeyConstraint@ function in new orville
    +  @ColumnDescription@ - removed
    +  @AssignedByDatabase@ - removed, though many cases are handled by @marshallReadOnlyField@
    +
    +-}
    +data ColumnFlag
    +  = forall a. ColumnDefault a => Default a
    +  | Unique
    +  | forall readEntity writeEntity key nullability. References (TableDefinition readEntity writeEntity key)
    +                                                              (FieldDefinition nullability key)
    +  | ColumnDescription String
    +  | AssignedByDatabase
    +
    +class ColumnDefault a where
    +  toColumnDefaultSql :: a -> String
    +
    +data Now =
    +  Now
    +
    +instance ColumnDefault [Char] where
    +  toColumnDefaultSql s = "'" ++ s ++ "'"
    +
    +instance ColumnDefault Now where
    +  toColumnDefaultSql _ = "(now() at time zone 'utc')"
    +
    +instance ColumnDefault Integer where
    +  toColumnDefaultSql val = show val
    +
    +instance ColumnDefault Bool where
    +  toColumnDefaultSql True = "true"
    +  toColumnDefaultSql False = "false"
    +
    +-- | 'Nullable' is a values-less type used to track that a 'FieldDefinition'
    +-- represents a field that is marked nullable in the database schema. See the
    +-- 'Nullability' type for the value-level representation of field nullability.
    +data Nullable
    +
    +-- | 'NotNull is a values-less type used to track that a 'FieldDefinition'
    +-- represents a field that is marked not-null in the database schema.  See the
    +-- 'Nullability' type for the value-level representation of field nullability.
    +data NotNull
    +
    +-- | 'Nullability' represents whether a field will be marked as 'NULL' or 'NOT
    +-- NULL' in the database schema. It is a GADT so that the value constructors
    +-- can be used to record this knowledge in the type system as well. This allows
    +-- functions that work only on 'Nullable' or 'NotNull' fields to indicate this
    +-- in their type signatures as appropriate.
    +data Nullability nullability where
    +  Nullable :: Nullability Nullable
    +  NotNull  :: Nullability NotNull
    +
    +-- | A 'NullabilityCheck' is returned by the 'checkNullability' function, which
    +-- can be used when a function works on both 'Nullable' and 'NotNull' functions
    +-- but needs to deal with each type of field separately. It adds wrapper
    +-- constructors around the 'FieldDefinition' that you can pattern match on to
    +-- then work with a concrete 'Nullable' or 'NotNull' field.
    +data NullabilityCheck a
    +  = NullableField (FieldDefinition Nullable a)
    +  | NotNullField (FieldDefinition NotNull a)
    +
    +-- | Resolves the 'nullablity' of a field to a concrete type based on its
    +-- 'fieldNullability'. You can do this directly by pattern matching on the
    +-- value of 'fieldNullability' if you have the GADTs extension turned on, but
    +-- this function will do that for you so you don't need to turn GADTs on.
    +checkNullability :: FieldDefinition nullability a -> NullabilityCheck a
    +checkNullability field =
    +  case fieldNullability field of
    +    Nullable -> NullableField field
    +    NotNull  -> NotNullField field
    +
    +{- |
    +  Migration Guide: The signature of the @FieldDefinition@ type has not changed,
    +  but many of the constructors and accessors have. See the migration guides
    +  on individual functions for more info.
    +-}
    +data FieldDefinition nullability a =
    +  FieldDefinition
    +    { fieldName        :: String
    +    , fieldType        :: SqlType a
    +    , fieldFlags       :: [ColumnFlag] -- ^ @fieldFlags@ has been removed. See the new @fieldDefaultValue@ and @fieldTableConstraints@ functions
    +    , fieldNullability :: Nullability nullability
    +    }
    +
    +data SomeField =
    +  forall nullability a.
    +    SomeField (FieldDefinition nullability a)
    +
    +instance QueryKeyable (FieldDefinition nullability a) where
    +  queryKey field = QKField $ fieldName field
    +
    +data FieldUpdate = FieldUpdate
    +  { fieldUpdateField :: SomeField
    +  , fieldUpdateValue :: SqlValue
    +  }
    +
    +data TableComment = TableComment
    +  { tcWhat :: String
    +  , tcWhen :: (Int, Int, Int)
    +  , tcWho :: String
    +  }
    +
    +newtype TableComments a =
    +  TableComments (Writer [TableComment] a)
    +  deriving (Functor, Applicative, Monad)
    +
    +runComments :: TableComments a -> [TableComment]
    +runComments (TableComments commenter) = snd (runWriter commenter)
    +
    +noComments :: TableComments ()
    +noComments = return ()
    +
    +say :: String -> (Int, Int, Int) -> String -> TableComments ()
    +say msg msgDate commenter =
    +  TableComments $ writer ((), [TableComment msg msgDate commenter])
    +
    +data FromSqlError
    +  = RowDataError !RowDataErrorDetails
    +    -- ^ Captures a failure in the translation of a SQL value from a particular
    +    -- field to it's corresponding Haskell values.
    +  | MissingColumn !MissingColumnDetails
    +    -- ^ An expected column was not returned by the database
    +  | ConversionError !ConversionErrorDetails
    +    -- ^ A conversion between haskell representations failed at a point where
    +    -- we don't know what column the value came from. This is the case when
    +    -- using the 'partialMap' combinator.
    +  deriving Typeable
    +
    +instance Show FromSqlError where
    +  show = showFromSqlErrorMinimal
    +
    +data RowDataErrorDetails =
    +  RowDataErrorDetails
    +    { rowErrorReason :: !RowDataErrorReason
    +    , rowErrorColumnName :: !String
    +    -- ^ Column name for the erroneous value
    +    , rowErrorPrimaryKeys :: ![(String, SqlValue)]
    +    -- ^ Primary keys. Empty if not known
    +    } deriving Typeable
    +
    +data MissingColumnDetails =
    +  MissingColumnDetails
    +    { missingColumn :: !String
    +    , actualColumns :: ![String]
    +    }
    +
    +data ConversionErrorDetails =
    +  ConversionErrorDetails
    +    { convErrorReason :: !String
    +    , convErrorPrimaryKeys :: ![(String, SqlValue)]
    +    -- ^ Primary key value(s). Empty if not known
    +    }
    +
    +simpleConversionError :: String -> FromSqlError
    +simpleConversionError err =
    +  ConversionError ConversionErrorDetails { convErrorReason = err
    +                                         , convErrorPrimaryKeys = []
    +                                         }
    +
    +-- | Shows the error in a way that should not contain any potentially sensitive
    +-- data. This is used for the 'Show' instance.
    +showFromSqlErrorMinimal :: FromSqlError -> String
    +showFromSqlErrorMinimal err =
    +  case err of
    +    RowDataError details ->
    +      "Error decoding data from column '" <> rowErrorColumnName details <> "'"
    +    MissingColumn details -> showMissingColumnDetails details
    +    ConversionError details -> convErrorReason details
    +
    +-- | Shows the error in a way appropriate for logging within an application.
    +-- The resulting string contains information that is useful for debugging but
    +-- is potentially undesirable to expose outside of the application (such as
    +-- primary key values).
    +showFromSqlErrorForLogging :: FromSqlError -> String
    +showFromSqlErrorForLogging err =
    +  case err of
    +    RowDataError details ->
    +      concat
    +        [ "Error decoding data from column "
    +        , "'" <> rowErrorColumnName details <> "': "
    +        , showReason (rowErrorReason details)
    +        , showPrimaryKey (rowErrorPrimaryKeys details)
    +        ]
    +    MissingColumn details -> showMissingColumnDetails details
    +    ConversionError details ->
    +      convErrorReason details
    +        <> showPrimaryKey (convErrorPrimaryKeys details)
    +  where
    +    showReason reason =
    +      case reason of
    +        TypeMismatch expected actual ->
    +          "expected " <> expected <> " but got " <> actual
    +        IntegralOutOfBounds lower upper actual ->
    +          "expected an integral between " <> show lower
    +          <> " and " <> show upper <> " but got " <> show actual
    +        DecodingFailure failure -> failure
    +
    +    showPrimaryKey [] = ""
    +    showPrimaryKey keyValues = " (" <> keysStr <> ")"
    +      where
    +        keysStr = List.intercalate ", " $ map showKeyValue keyValues
    +        showKeyValue (key, sqlValue) = key <> ": " <> showSqlValue sqlValue
    +        -- removes the data constructor prefix
    +        showSqlValue sqlValue = drop 1 . dropWhile (not . Char.isSpace)
    +                              $ show sqlValue
    +
    +showMissingColumnDetails :: MissingColumnDetails -> String
    +showMissingColumnDetails details =
    +  concat
    +    [ "Column "
    +    , "'" <> missingColumn details <> "' "
    +    , "not found in result set. Actual Columns: "
    +    , "'" <> List.intercalate "', '" (actualColumns details) <> "'"
    +    ]
    +
    +instance Exception FromSqlError
    +
    +data FromSql a = FromSql
    +  { fromSqlSelects :: [SelectForm]
    +  , runFromSql :: [(String, SqlValue)] -> Either FromSqlError a
    +  }
    +
    +instance Functor FromSql where
    +  fmap f fA = fA {runFromSql = \values -> f <$> runFromSql fA values}
    +
    +instance Applicative FromSql where
    +  pure a = FromSql [] (\_ -> pure a)
    +  fF <*> fA =
    +    FromSql
    +      { fromSqlSelects = fromSqlSelects fF ++ fromSqlSelects fA
    +      , runFromSql = \values -> runFromSql fF values <*> runFromSql fA values
    +      }
    +
    +getColumn :: SelectForm -> FromSql SqlValue
    +getColumn selectForm =
    +  FromSql
    +    { fromSqlSelects = [selectForm]
    +    , runFromSql =
    +        \values -> do
    +          let colName = unescapedName $ selectFormOutput selectForm
    +          case lookup colName values of
    +            Just sqlValue -> pure sqlValue
    +            Nothing ->
    +              throwError $
    +              MissingColumn
    +                MissingColumnDetails
    +                  { missingColumn = colName
    +                  , actualColumns = map fst values
    +                  }
    +    }
    +
    +joinFromSqlError :: FromSql (Either FromSqlError a) -> FromSql a
    +joinFromSqlError fE =
    +  fE {runFromSql = \columns -> join $ runFromSql fE columns}
    +
    +newtype ToSql a b = ToSql
    +  { unToSql :: ReaderT a (State [SqlValue]) b
    +  } deriving ( Functor
    +             , Applicative
    +             , Monad
    +             , MonadState [SqlValue]
    +             , MonadReader a
    +             )
    +
    +runToSql :: ToSql a b -> a -> [SqlValue]
    +runToSql tosql a = reverse $ execState (runReaderT (unToSql tosql) a) []
    +
    +getComponent :: (entity -> a) -> ToSql a () -> ToSql entity ()
    +getComponent getComp (ToSql serializer) =
    +  ToSql (withReaderT getComp serializer)
    +
    +{-|
    + Migration Guide: 'TableDefinition' can now be imported from
    + 'Orville.PostgreSQL'. The order of the type parameters has changed from
    + @TableDefinition readEnity writeEntity key@ to @TableDefinition key
    + writeEntity readEntity@. In the new Orville tables without primary keys are
    + supported, so the @key@ parameter must now be instantiated as either @HasKey
    + keyType@ or @NoKey@.
    +
    + A 'TableDefinition' is the center of the Orville universe. A 'TableDefinition'
    + defines the structure of a table in the database and associates it with a Haskell
    + datatype, usually a Haskell record type. The 'TableDefinition' must specify how
    + the Haskell type is converted to and from the database schema, as as well as
    + provide same basic utility functions required by Orville for interacting with
    + the Haskell datatype.
    +
    +  Usually you will use 'TableParams' to construct a 'TableDefinition' in a more
    +  concise way. This type is provided as an escape hatch for any situations where
    +  'TableParams' is too restrictive for the sql mapping required by a type.
    + -}
    +data TableDefinition readEntity writeEntity key = TableDefinition
    +  { tableName :: String
    +      -- ^ The name of the table in the database.
    +  , tableFields :: [SomeField]
    +      -- ^ A list of field definitions defining the table structure
    +  , tableSafeToDelete :: [String]
    +      -- ^ A list of any columns that may be deleted from the table by Orville.
    +      -- (Orville will never delete a column without being told it is safe)
    +  , tablePrimaryKey :: PrimaryKey key
    +      -- ^ The statically typed field definition that is the primary key. Currently
    +      -- this field must still by listed in `tableFields`
    +  , tableFromSql :: FromSql readEntity
    +      -- ^ A definition of how to convert the haskell type from a sql row
    +  , tableToSql :: ToSql writeEntity ()
    +      -- ^ A function to set the key on the entity
    +  , tableGetKey :: readEntity -> key
    +      -- ^ A function to get the key on the entity
    +  , tableComments :: TableComments ()
    +      -- ^ Any comments that might be interesting for developers to see. These
    +      -- comments will get printed in the log if there is an erro while attempting
    +      -- to migrate the table.
    +  }
    +
    +data PrimaryKey key
    +  = PrimaryKey (PrimaryKeyPart key) [PrimaryKeyPart key]
    +
    +data PrimaryKeyPart key =
    +  forall part. PrimaryKeyPart (key -> part) (FieldDefinition NotNull part)
    +
    +instance QueryKeyable (TableDefinition readEntity writeEntity key) where
    +  queryKey = QKTable . tableName
    +
    +{- |
    +  Migration Guide: @SchemaItem@ retains the same name. The @Index@,
    +  @DropIndex@, @Constraint@ and @DropConstraint@ constructors have been
    +  removed. These items are now added to the @TableDefinition@ via
    +  @addTableConstraints@ and @addTableIndexes@. The remaining constructors have
    +  been prefixed with the word @Schema@ (e.g. @Table@ has been renamed to
    +  @SchemaTable@). There is no explicit replacement for @DropIndex@ and
    +  @DropConstraint@. Orville will automatically drop indexes and constraints
    +  that are no longer mentioned on the @TableDefinition@ for any tables that it
    +  migrates.
    +-}
    +data SchemaItem
    +  = forall readEntity writeEntity key. Table (TableDefinition readEntity writeEntity key)
    +  | DropTable String
    +  | Index IndexDefinition
    +  | DropIndex String
    +  | Constraint ConstraintDefinition
    +  | DropConstraint String
    +                   String
    +  | Sequence SequenceDefinition
    +  | DropSequence String
    +
    +instance Show SchemaItem where
    +  show (Table tableDef) = "Table <" ++ tableName tableDef ++ " definition>"
    +  show (DropTable name) = "DropTable " ++ show name
    +  show (Index indexDef) = "Index (" ++ show indexDef ++ ")"
    +  show (DropIndex name) = "DropIndex " ++ show name
    +  show (Constraint cons) = "Constraint (" ++ show cons ++ ")"
    +  show (DropConstraint name table) =
    +    "DropConstraint " ++ show name ++ " " ++ show table
    +  show (Sequence name) = "Sequence " ++ show name
    +  show (DropSequence name) = "DropSequence " ++ show name
    +
    +{- |
    +  Migration Guide: @SchemaDefinition@ has been removed. Use @[SchemaItem]@
    +  instead.
    +-}
    +type SchemaDefinition = [SchemaItem]
    +
    +data IndexDefinition = IndexDefinition
    +  { indexName :: String
    +  , indexUnique :: Bool
    +  , indexTable :: String
    +  , indexBody :: String
    +  } deriving (Eq, Show)
    +
    +data ConstraintDefinition = ConstraintDefinition
    +  { constraintName :: String
    +  , constraintTable :: String
    +  , constraintBody :: String
    +  } deriving (Eq, Show)
    +
    +data SequenceDefinition = SequenceDefinition
    +  { sequenceName :: String
    +  , sequenceIncrement :: Maybe Int
    +  , sequenceMinValue :: Maybe Int
    +  , sequenceMaxValue :: Maybe Int
    +  , sequenceStart :: Maybe Int
    +  , sequenceCache :: Maybe Int
    +  , sequenceCycle :: Bool
    +  } deriving (Eq, Show)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html new file mode 100644 index 0000000..ceaab84 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html @@ -0,0 +1,257 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Where
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE ExistentialQuantification #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Where
    +  ( WhereCondition(..)
    +  , (.==)
    +  , (.<>)
    +  , (.>)
    +  , (.>=)
    +  , (.<)
    +  , (.<=)
    +  , (.<-)
    +  , (%==)
    +  , whereConditionValues
    +  , whereAnd
    +  , whereOr
    +  , whereIn
    +  , whereLike
    +  , whereLikeInsensitive
    +  , whereNotIn
    +  , whereQualified
    +  , whereRaw
    +  , isNull
    +  , isNotNull
    +  , whereClause
    +  , whereValues
    +  , whereToSql
    +  ) where
    +
    +import qualified Data.List as List
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import qualified Database.Orville.PostgreSQL.Internal.Expr.WhereExpr as E
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{-
    +  Migration Guide: @WhereCondition@ has been replaced with @BooleanExpr@
    +
    +  It would be nice to match the SqlValues in these with the types from the
    +  corresponding FieldDefinitions. However, this would require adding an
    +  Eq constraint for List.nub on the .<- operation, which I'm not willing
    +  to do at this moment.
    +
    +  Alternately, we could eliminate storing the entire FieldDefinition here,
    +  thereby removing the need for ExistentialQuantification. Currently the
    +  field definition is being used in the QueryKeyable instances for WhereCondition
    +  for calls to qkOp an friends. Replacing FieldDefinition with just the field
    +  name here would be nice. We would probably want a fully-fledged FieldName
    +  type whech could provide the appropriate QueryKeyable instance. That then
    +  raises questions about the ergonomics users creating FieldDefinition values
    +  without requiring OverloadedStrings to be turned on.
    +-}
    +data WhereCondition
    +  = WhereConditionExpr E.WhereExpr
    +  | Or [WhereCondition]
    +  | And [WhereCondition]
    +  | forall a b c. Qualified (TableDefinition a b c)
    +                            WhereCondition
    +
    +instance QueryKeyable WhereCondition where
    +  queryKey (WhereConditionExpr (Expr (Right form))) = queryKey form
    +  queryKey (WhereConditionExpr (Expr (Left raw))) = QKField $ rawExprToSql raw
    +  queryKey (Or conds) = qkOp "OR" conds
    +  queryKey (And conds) = qkOp "And" conds
    +  queryKey (Qualified _ cond) = queryKey cond
    +
    +(.==) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .== a = WhereConditionExpr . expr $ nameForm E..== sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<>) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .<> a = WhereConditionExpr . expr $ nameForm E..<> sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.>) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .> a = WhereConditionExpr . expr $ nameForm E..> sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.>=) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .>= a = WhereConditionExpr . expr $ nameForm E..>= sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .< a = WhereConditionExpr . expr $ nameForm E..< sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<=) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .<= a = WhereConditionExpr . expr $ nameForm E..<= sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition
    +fieldDef .<- as = whereIn fieldDef as
    +
    +(%==) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef %== a = WhereConditionExpr . expr $ nameForm E.%== sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +whereConditionSql :: WhereCondition -> String
    +whereConditionSql cond = internalWhereConditionSql Nothing cond
    +
    +internalWhereConditionSql ::
    +     Maybe (TableDefinition a b c) -> WhereCondition -> String
    +internalWhereConditionSql mbTableDef whereCondition =
    +  case whereCondition of
    +    Or [] -> "FALSE"
    +    Or conds ->
    +      let condsSql = map innerCondSql conds
    +       in List.intercalate " OR " condsSql
    +
    +    And [] -> "TRUE"
    +    And conds ->
    +      let condsSql = map innerCondSql conds
    +       in List.intercalate " AND " condsSql
    +
    +    WhereConditionExpr expression ->
    +      case mbTableDef of
    +        Just tableDef ->
    +          rawExprToSql . generateSql $ expression `qualified` (tableName tableDef)
    +        Nothing ->
    +          rawExprToSql . generateSql $ expression
    +
    +    Qualified tableDef cond ->
    +      internalWhereConditionSql (Just tableDef) cond
    +  where
    +    innerCondSql c =
    +      let sql = internalWhereConditionSql mbTableDef c
    +       in "(" ++ sql ++ ")"
    +
    +whereConditionValues :: WhereCondition -> [SqlValue]
    +whereConditionValues (WhereConditionExpr (Expr (Right form))) =
    +  E.whereValues [form]
    +whereConditionValues (WhereConditionExpr (Expr (Left _))) = []
    +whereConditionValues (Or conds) = concatMap whereConditionValues conds
    +whereConditionValues (And conds) = concatMap whereConditionValues conds
    +whereConditionValues (Qualified _ cond) = whereConditionValues cond
    +
    +{- |
    +  Migration Guide: @whereAnd@ has been removed. Use the binary function
    +  @andExpr@ to combine @BooleanExpr@ expressions instead. @andExpr@ is also
    +  available as the operator @(.&&)@
    +-}
    +whereAnd :: [WhereCondition] -> WhereCondition
    +whereAnd = And
    +
    +{- |
    +  Migration Guide: @whereOr@ has been removed. Use the binary function
    +  @orExpr@ to combine @BooleanExpr@ expressions instead. @orExpr@ is also
    +  available as the operator @(.||)@
    +-}
    +whereOr :: [WhereCondition] -> WhereCondition
    +whereOr = Or
    +
    +{- |
    +  Migration Guide: @whereIn@ has been renamed to @fieldIn@. It now takes a
    +  @NonEmpty@ list of values to reflect this is a requirement in SQL.
    +-}
    +whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition
    +whereIn fieldDef values =
    +  WhereConditionExpr . expr $
    +  E.whereIn (fieldToNameForm fieldDef) (map (fieldToSqlValue fieldDef) values)
    +
    +{- |
    +  Migration Guide: @whereLike@ has been renamed to @fieldLike@. It now takes a
    +  @T.Text@ value rather than a @String@.
    +-}
    +whereLike :: FieldDefinition nullability a -> String -> WhereCondition
    +whereLike fieldDef raw =
    +  WhereConditionExpr . expr $
    +  E.whereLike (fieldToNameForm fieldDef) (toSql raw)
    +
    +{- |
    +  Migration Guide: @whereLikeInsensitive@ has been renamed to
    +  @fieldLikeInsensitive@. It now takes a @T.Text@ value rather than a @String@.
    +-}
    +whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition
    +whereLikeInsensitive fieldDef raw =
    +  WhereConditionExpr . expr $
    +  E.whereLikeInsensitive (fieldToNameForm fieldDef) (toSql raw)
    +
    +{- |
    +  Migration Guide: @whereNotIn@ has been renamed to @fieldNotIn@. It now takes a
    +  @NonEmpty@ list of values to reflect this is a requirement in SQL.
    +-}
    +whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition
    +whereNotIn fieldDef values =
    +  WhereConditionExpr . expr $
    +  E.whereNotIn
    +    (fieldToNameForm fieldDef)
    +    (map (fieldToSqlValue fieldDef) values)
    +
    +{- |
    +  Migration Guide: @whereQualified@ has been removed. If you need qualified
    +  column references you can use the SQL building functions found in
    +  @Orville.PostgreSQL.Expr@ to build them. The @qualifyColumn@ function can be
    +  used to qualify column references in that context. @BooleanExpr@ values built
    +  directly this way can be easily used in conjuction with other helpers such as
    +  @fieldEquals@ which also build @BooleanExpr@ values themselves.
    +-}
    +whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition
    +whereQualified tableDef cond = Qualified tableDef cond
    +
    +{- |
    +  Migration Guide: @whereRaw@ has been removed. In its place you should use the
    +  more general functions such as @unsafeSqlExpression@ or @unsafeRawSql@ in the
    +  @Orville.PostgreSQL.Raw.RawSql@ module to build a @BooleanExpr@.
    +-}
    +whereRaw :: String -> [SqlValue] -> WhereCondition
    +whereRaw str values = WhereConditionExpr . expr $ E.whereRaw str values
    +
    +{- |
    +  Migration Guide: @isNull@ has been renamed to @fieldIsNull@
    +-}
    +isNull :: FieldDefinition Nullable a -> WhereCondition
    +isNull = WhereConditionExpr . expr . E.whereNull . fieldToNameForm
    +
    +{- |
    +  Migration Guide: @isNotNull@ has been renamed to @fieldIsNotNull@
    +-}
    +isNotNull :: FieldDefinition Nullable a -> WhereCondition
    +isNotNull = WhereConditionExpr . expr . E.whereNotNull . fieldToNameForm
    +
    +whereClause :: [WhereCondition] -> String
    +whereClause [] = ""
    +whereClause conds = "WHERE " ++ whereConditionSql (whereAnd conds)
    +
    +whereValues :: [WhereCondition] -> [SqlValue]
    +whereValues = List.concatMap whereConditionValues
    +
    +{- |
    +  Migration Guide: @whereToSql@ has been removed. It is replaced by the more
    +  general @toBytesAndParams@ function in @Orville.PostgreSQL.Raw.RawSql@.
    +-}
    +whereToSql :: [WhereCondition] -> (String, [SqlValue])
    +whereToSql conds = (whereClause conds, whereValues conds)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html new file mode 100644 index 0000000..68b2452 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html @@ -0,0 +1,127 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +'Database.Orville.PostgreSQL.MonadBaseControl' provides functions and instances for
    +using 'MonadOrville' and 'OrvilleT' for situations where you need to use
    +'MonadBaseControl'. If you do not know if you need 'MonadBaseControl', then
    +you probably don't need to use this module. If you are thinking about
    +using 'MonadBaseControl' instead of 'MonadUnliftIO', we recommend
    +reading Michael Snoyman's excellent "A Tale of Two Brackets"
    +(https://www.fpcomplete.com/blog/2017/06/tale-of-two-brackets) if you
    +have not already done so.
    +
    +If you're still here after reading above, this module provides
    +the functions you need to implement 'MonadOrvilleControl' for your
    +Monad stack using its 'MonadBaseControl' instance. The most common way
    +to do this is simply to add the following 'MonadOrvilleControl' instance:
    +
    +@
    + instance MonadOrvilleControl MyMonad where
    +   liftWithConnection = liftWithConnectionViaBaseControl
    +   liftFinally = liftFinallyViaBaseControl
    +@
    +
    +This module also provides a 'MonadOrvilleControl' for 'StateT' as well as
    +'MonadBaseControl' and 'MonadTransControl' instances for 'OrvilleT' and
    +'OrvilleTriggerT'.
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE RankNTypes #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +{-# LANGUAGE TypeFamilies #-}
    +
    +module Database.Orville.PostgreSQL.MonadBaseControl
    +  ( liftWithConnectionViaBaseControl
    +  , liftFinallyViaBaseControl
    +  ) where
    +
    +import Control.Monad.Reader (ReaderT)
    +import Control.Monad.State (StateT)
    +import qualified Control.Monad.Trans.Control as MTC
    +
    +import qualified Database.Orville.PostgreSQL as O
    +import qualified Database.Orville.PostgreSQL.Internal.Monad as InternalMonad
    +import qualified Database.Orville.PostgreSQL.Internal.Trigger as InternalTrigger
    +import qualified Database.Orville.PostgreSQL.Trigger as OT
    +
    +{-|
    +   liftWithConnectionViaBaseControl can be use as the implementation of
    +   'liftWithConnection' for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadBaseControl'.
    + -}
    +liftWithConnectionViaBaseControl ::
    +     MTC.MonadBaseControl IO m
    +  => (forall b. (conn -> IO b) -> IO b)
    +  -> (conn -> m a)
    +  -> m a
    +liftWithConnectionViaBaseControl ioWithConn action =
    +  MTC.control $ \runInIO -> ioWithConn (runInIO . action)
    +
    +{-|
    +   liftFinallyViaBaseControl can be use as the implementation of
    +   'liftFinally for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadBaseControl'.
    + -}
    +liftFinallyViaBaseControl ::
    +     MTC.MonadBaseControl IO m
    +  => (forall c d. IO c -> IO d -> IO c)
    +  -> m a
    +  -> m b
    +  -> m a
    +liftFinallyViaBaseControl ioFinally action cleanup =
    +  MTC.control $ \runInIO -> ioFinally (runInIO action) (runInIO cleanup)
    +
    +{-|
    +   Because lifting control operations into 'StateT' is fraught with peril, a
    +   'MonadOrvilleControl' instance for 'StateT' is provided here and implemented
    +   via 'MonadBaseControl' rather than together with the 'MonadOrvilleControl'
    +   definition. We do not recommend using stateful Monad transformer layers in
    +   Monad stacks based on IO. For anyone that must, this is the canonical
    +   instance for 'StateT'
    +  -}
    +instance MTC.MonadBaseControl IO m => O.MonadOrvilleControl (StateT a m) where
    +  liftWithConnection = liftWithConnectionViaBaseControl
    +  liftFinally = liftFinallyViaBaseControl
    +
    +{-|
    +   Because we recommend using 'MonadUnliftIO' rather than 'MonadTransControl',
    +   we do not provide 'MonadTransControl' instance for 'OrvilleT' by default
    +   along with the definition. If you do need to use 'MonadTransControl',
    +   however, this is the canonical instance for 'OrvilleT'.
    +  -}
    +instance MTC.MonadTransControl (O.OrvilleT conn) where
    +  type StT (O.OrvilleT conn) a = MTC.StT (ReaderT (O.OrvilleEnv conn)) a
    +  liftWith =
    +    MTC.defaultLiftWith InternalMonad.OrvilleT InternalMonad.unOrvilleT
    +  restoreT = MTC.defaultRestoreT InternalMonad.OrvilleT
    +
    +{-|
    +   Because we recommend using 'MonadUnliftIO' rather than 'MonadBaseControl',
    +   we do not provide 'MonadBaseControl' instance for 'OrvilleT' by default
    +   along with the definition. If you do need to use 'MonadBaseControl',
    +   however, this is the canonical instance for 'OrvilleT'.
    +  -}
    +instance MTC.MonadBaseControl b m =>
    +         MTC.MonadBaseControl b (O.OrvilleT conn m) where
    +  type StM (O.OrvilleT conn m) a = MTC.ComposeSt (O.OrvilleT conn) m a
    +  liftBaseWith = MTC.defaultLiftBaseWith
    +  restoreM = MTC.defaultRestoreM
    +
    +instance MTC.MonadTransControl (OT.OrvilleTriggerT trigger conn) where
    +  type StT (OT.OrvilleTriggerT trigger conn) a = MTC.StT (ReaderT (InternalTrigger.RecordedTriggersRef trigger)) (MTC.StT (O.OrvilleT conn) a)
    +  liftWith f =
    +    InternalTrigger.OrvilleTriggerT $
    +    MTC.liftWith $ \runReader ->
    +      MTC.liftWith $ \runOrville ->
    +        f (runOrville . runReader . InternalTrigger.unTriggerT)
    +  restoreT = InternalTrigger.OrvilleTriggerT . MTC.restoreT . MTC.restoreT
    +
    +instance MTC.MonadBaseControl b m =>
    +         MTC.MonadBaseControl b (OT.OrvilleTriggerT trigger conn m) where
    +  type StM (OT.OrvilleTriggerT trigger conn m) a = MTC.StM (ReaderT (InternalTrigger.RecordedTriggersRef trigger) m) a
    +  liftBaseWith = MTC.defaultLiftBaseWith
    +  restoreM = MTC.defaultRestoreM
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html new file mode 100644 index 0000000..7db6bbc --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html @@ -0,0 +1,88 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +'Database.Orville.PostgreSQL.MonadUnliftIO' provides functions and instances for using
    +'MonadOrville' and 'OrvilleT' for Monad transformer stacks that are using
    +'MonadUnliftIO'.  The most common way to do this is simply to add the
    +following 'MonadOrvilleControl' instance:
    +
    +@
    + instance MonadOrvilleControl MyMonad where
    +   liftWithConnection = liftWithConnectionViaUnliftIO
    +   liftFinally = liftFinallyViaUnliftIO
    +@
    +
    +This module also provides a 'MonadUnliftIO' instance for 'OrvilleT' and 'OrvilleTrigger'.
    +|-}
    +{-# LANGUAGE CPP #-}
    +{-# LANGUAGE RankNTypes #-}
    +
    +module Database.Orville.PostgreSQL.MonadUnliftIO
    +  ( liftWithConnectionViaUnliftIO
    +  , liftFinallyViaUnliftIO
    +  ) where
    +
    +import qualified Control.Monad.IO.Unlift as UL
    +
    +import qualified Database.Orville.PostgreSQL as O
    +import qualified Database.Orville.PostgreSQL.Internal.Monad as InternalMonad
    +import qualified Database.Orville.PostgreSQL.Internal.Trigger as InternalTrigger
    +import qualified Database.Orville.PostgreSQL.Trigger as OT
    +
    +{-|
    +   liftWithConnectionViaUnliftIO can be use as the implementation of
    +   'liftWithConnection' for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadUnliftIO'.
    + |-}
    +liftWithConnectionViaUnliftIO ::
    +     UL.MonadUnliftIO m
    +  => (forall a. (conn -> IO a) -> IO a)
    +  -> (conn -> m b)
    +  -> m b
    +liftWithConnectionViaUnliftIO ioWithConn action =
    +  UL.withRunInIO $ \runInIO -> ioWithConn (runInIO . action)
    +
    +{-|
    +   liftFinallyViaUnliftIO can be use as the implementation of
    +   'liftFinally' for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadUnliftIO'.
    + |-}
    +liftFinallyViaUnliftIO ::
    +     UL.MonadUnliftIO m
    +  => (forall a b. IO a -> IO b -> IO a)
    +  -> m c
    +  -> m d
    +  -> m c
    +liftFinallyViaUnliftIO ioFinally action cleanup = do
    +  unlio <- UL.askUnliftIO
    +  UL.liftIO $ ioFinally (UL.unliftIO unlio action) (UL.unliftIO unlio cleanup)
    +
    +instance UL.MonadUnliftIO m => UL.MonadUnliftIO (O.OrvilleT conn m) where
    +#if MIN_VERSION_unliftio_core(0,2,0)
    +  withRunInIO inner =
    +    InternalMonad.OrvilleT $ do
    +      UL.withRunInIO $ \run ->
    +        inner (run . InternalMonad.unOrvilleT)
    +#else
    +  askUnliftIO =
    +    InternalMonad.OrvilleT $ do
    +      unlio <- UL.askUnliftIO
    +      pure $ UL.UnliftIO (UL.unliftIO unlio . InternalMonad.unOrvilleT)
    +#endif
    +
    +instance UL.MonadUnliftIO m =>
    +         UL.MonadUnliftIO (OT.OrvilleTriggerT trigger conn m) where
    +#if MIN_VERSION_unliftio_core(0,2,0)
    +  withRunInIO inner =
    +    InternalTrigger.OrvilleTriggerT $ do
    +      UL.withRunInIO $ \run ->
    +        inner (run . InternalTrigger.unTriggerT)
    +#else
    +  askUnliftIO =
    +    InternalTrigger.OrvilleTriggerT $ do
    +      unlio <- UL.askUnliftIO
    +      pure $ UL.UnliftIO (UL.unliftIO unlio . InternalTrigger.unTriggerT)
    +#endif
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html new file mode 100644 index 0000000..4f4a1b2 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html @@ -0,0 +1,54 @@ +
    module Database.Orville.PostgreSQL.Pagination
    +  ( Pagination(..)
    +  , buildPagination
    +  ) where
    +
    +import Data.Maybe (maybeToList)
    +import Safe (lastMay)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +import Database.Orville.PostgreSQL.Internal.Monad (MonadOrville)
    +import Database.Orville.PostgreSQL.Internal.OrderBy (SortDirection(Ascending))
    +import Database.Orville.PostgreSQL.Internal.SelectOptions (limit, order, where_)
    +import Database.Orville.PostgreSQL.Internal.Types (TableDefinition(..), FieldDefinition, NotNull)
    +import Database.Orville.PostgreSQL.Internal.Where ((.>=), WhereCondition, whereAnd)
    +import Database.Orville.PostgreSQL.Select (runSelect, selectQueryTable)
    +
    +data Pagination m entity =
    +  Pagination
    +    { pageRows :: [entity]
    +    , pageNext :: Maybe (m (Pagination m entity))
    +    }
    +
    +buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField)
    +                => TableDefinition readEnt write key
    +                -> FieldDefinition NotNull orderField
    +                -> (readEnt -> orderField)
    +                -> Maybe WhereCondition
    +                -> Word
    +                -> m (Pagination m readEnt)
    +buildPagination tableDef orderField getOrderField mbWhereCond pageSize =
    +  let selectOpts bound
    +        = order orderField Ascending
    +       <> limit (fromIntegral pageSize)
    +       <> where_ (whereAnd $ orderField .>= bound
    +                           : maybeToList mbWhereCond
    +                 )
    +
    +      selectAll = runSelect . selectQueryTable tableDef
    +      mkPagination bound = do
    +        rows <- selectAll $ selectOpts bound
    +
    +        let nxt =
    +              case lastMay rows of
    +                Just lst | length rows == fromIntegral pageSize ->
    +                  Just . mkPagination . succ $ getOrderField lst
    +                _ -> Nothing
    +
    +        pure $ Pagination
    +                 { pageRows = rows
    +                 , pageNext = nxt
    +                 }
    +
    +   in mkPagination minBound
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html new file mode 100644 index 0000000..2000b17 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html @@ -0,0 +1,36 @@ +
    {-# LANGUAGE CPP #-}
    +module Database.Orville.PostgreSQL.Plan.Explanation
    +  ( Explanation
    +  , noExplanation
    +  , explainStep
    +  , explanationSteps
    +  ) where
    +
    +newtype Explanation =
    +  Explanation ([String] -> [String])
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup Explanation where
    +  (<>) = appendExplanation
    +#endif
    +
    +instance Monoid Explanation where
    +  mempty = noExplanation
    +  mappend = appendExplanation
    +
    +appendExplanation :: Explanation -> Explanation -> Explanation
    +appendExplanation (Explanation front) (Explanation back) =
    +  Explanation (front . back)
    +
    +noExplanation :: Explanation
    +noExplanation =
    +  Explanation id
    +
    +explainStep :: String -> Explanation
    +explainStep str =
    +  Explanation (str:)
    +
    +explanationSteps :: Explanation -> [String]
    +explanationSteps (Explanation prependTo) =
    +  prependTo []
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html new file mode 100644 index 0000000..b3f337a --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html @@ -0,0 +1,139 @@ +
    module Database.Orville.PostgreSQL.Plan.Many
    +  ( Many
    +  , NotAKey(NotAKey)
    +  , fromKeys
    +  , lookup
    +  , keys
    +  , elems
    +  , map
    +  , toMap
    +  , apply
    +  , compose
    +  ) where
    +
    +import           Prelude hiding (lookup, map)
    +
    +import qualified Data.Either as Either
    +import qualified Data.Map as Map
    +import qualified Data.Maybe as Maybe
    +
    +{-|
    +  'NotAKey' is returned from various 'Many' related functions when presented
    +  with an input parameter that was not one of the original inputs that the
    +  'Many' was constructed with.
    +-}
    +data NotAKey =
    +  NotAKey
    +
    +{-|
    +  A 'Many k a' represents a group of values keyed by list of parameters and
    +  is used to return the results of executing an Orville Plan with a list of
    +  input parameters. If you need to find the result of the query associated
    +  with a particular input parameter, you can use 'lookup' to find it. If you
    +  don't care about the association with particular inputs, you can simply
    +  use 'elems' to get a list of all the results.
    +-}
    +data Many k a =
    +  Many [k] (k -> Either NotAKey a)
    +
    +instance Functor (Many k) where
    +  fmap = map
    +
    +{-|
    +  'fromKeys' constructs a 'Many' value from a list of keys and a function that
    +  maps them to their values. The order and duplication of keys in the list will
    +  be preserved by the 'Many' type in the relevant functions. The mapping
    +  function provided should be a total function -- i.e. it should not produce a
    +  runtime error. If it is not possible to map every @k@ (even those not in the
    +  input list provided to 'fromKeys'), the values should be wrapped in an
    +  appropriate type such as 'Maybe' so that an empty or default value can be
    +  returned.
    +-}
    +fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a
    +fromKeys =
    +  Many
    +
    +{-|
    +   'map' calls a function on all the values found in a 'Many' collection.
    +-}
    +map :: (a -> b) -> Many k a -> Many k b
    +map f (Many ks keyToValue) =
    +  Many ks (fmap f . keyToValue)
    +
    +{-|
    +   'apply' allows you to apply many functions to many values. The function
    +   associated with each parameter is applied to the value associated with the
    +   same paremeter.
    +
    +   (If you're looking for 'pure' or an 'Applicative' instance for 'Many', this
    +   is as good as it gets. 'Many' cannot be an 'Applicative' because there is no
    +   correct implementation of 'pure' that we can reasonably provide).
    +-}
    +apply :: (Many param (a -> b))
    +      -> (Many param a)
    +      -> (Many param b)
    +apply manyFs manyAs =
    +  fromKeys (keys manyFs) applyF
    +    where
    +      applyF param =
    +        lookup param manyFs <*> lookup param manyAs
    +
    +{-|
    +  'compose' uses the values of a 'Many' value as keys to a second 'Many' to
    +  create a 'Many' mapping from the original keys to the final values.
    +-}
    +compose :: Many b c -> Many a b -> Many a c
    +compose manyBC manyAB =
    +  fromKeys (keys manyAB) aToC
    +    where
    +      aToC a = do
    +        b <- lookup a manyAB
    +        lookup b manyBC
    +
    +{-|
    +  'keys' fetches the list of keys from a 'Many'. Note that is a list and not
    +  a set. 'Many' preserves the order and duplication of any key values that were
    +  in the key list at the time of construction.
    +-}
    +keys :: Many k a -> [k]
    +keys (Many ks _) =
    +  ks
    +
    +{-|
    +  'elems' returns all the values that correspond the keys of the 'Many'. The
    +  values will be returned in the same order that the keys were present at the
    +  time of creation, though if you truly care about this it's probably better to
    +  use 'lookup' to make that correspondence explicit.
    +-}
    +elems :: Many k a -> [a]
    +elems (Many ks keyToValue) =
    +  Either.rights $ keyToValue <$> ks
    +
    +{-|
    +  'toMap' converts the 'Many' into a 'Map' value. If all you wanted to do was
    +  find the value for a specific key, you should probably use 'lookup' instead.
    +-}
    +toMap :: Ord k => Many k a -> Map.Map k a
    +toMap (Many ks keyToValue) =
    +  Map.fromList (Maybe.mapMaybe mkPair ks)
    +    where
    +      mkPair k =
    +        case keyToValue k of
    +          Left NotAKey ->
    +            Nothing
    +
    +          Right value ->
    +            Just (k, value)
    +
    +{-|
    +  'lookup' returns the value for the given parameter. If the given @k@ is
    +  not one of the original input values that the 'Many' was constructed with,
    +  the mapping function given at the contructor will determine what value to
    +  return. Often this will be whatever a reasonable empty or default value for
    +  the type @a@ is.
    +-}
    +lookup :: k -> Many k a -> Either NotAKey a
    +lookup k (Many _ keyToValue) =
    +  keyToValue k
    +
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html new file mode 100644 index 0000000..acf7291 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html @@ -0,0 +1,447 @@ +
    {-# LANGUAGE RankNTypes #-}
    +module Database.Orville.PostgreSQL.Plan.Operation
    +  ( Operation(..)
    +  , AssertionFailed
    +  , mkAssertionFailed
    +  , findOne
    +  , findOneWhere
    +  , findAll
    +  , findAllWhere
    +  , findSelect
    +  , askParam
    +  , assertRight
    +
    +  , SelectOperation(..)
    +  , selectOperation
    +  ) where
    +
    +import qualified Control.Monad.Catch as Catch
    +import qualified Data.Foldable as Fold
    +import qualified Data.Maybe as Maybe
    +import qualified Data.Map.Strict as Map
    +import qualified Data.Text as T
    +
    +import           Database.Orville.PostgreSQL.Core ((.==), (.<-))
    +import qualified Database.Orville.PostgreSQL.Core as Core
    +import           Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +import qualified Database.Orville.PostgreSQL.Internal.Select as SelectInternal
    +import qualified Database.Orville.PostgreSQL.Plan.Explanation as Exp
    +import           Database.Orville.PostgreSQL.Plan.Many (Many)
    +import qualified Database.Orville.PostgreSQL.Plan.Many as Many
    +import           Database.Orville.PostgreSQL.Select (Select)
    +import qualified Database.Orville.PostgreSQL.Select as Select
    +
    +{-|
    +  'Operation' provides a stucture for building primitive operations that can be
    +  incorporated into a 'Database.Orville.PostgreSQL.Plan.Plan'. An 'Operation'
    +  provides base case implementations of the various plan execution functions.
    +  You only need to care about this type if you want to create new custom
    +  operations to include in a 'Database.Orville.PostgreSQL.Plan.Plan' beyond
    +  those already provided in the 'Database.Orville.PostgreSQL.Plan.Plan'
    +  api.
    +-}
    +data Operation param result =
    +  Operation
    +    { -- | 'executeOperationOne' will be called when an plan is
    +      -- executed with a single input parameter
    +      executeOperationOne :: forall conn m. (Core.MonadOrville conn m)
    +                          => param
    +                          -> m (Either AssertionFailed result)
    +
    +      -- | 'executeOperationMany' will be called when an plan is
    +      -- executed with multiple input parameters (via 'planMany').
    +    , executeOperationMany :: forall conn m. (Core.MonadOrville conn m)
    +                           => [param]
    +                           -> m (Either AssertionFailed (Many param result))
    +
    +      -- | 'explainOperationOne' will be called when producing an explanation
    +      -- of what the plan will do when given one input parameter. Plans that do
    +      -- not perform any interesting IO interactions should generally return an
    +      -- empty explanation.
    +    , explainOperationOne :: Exp.Explanation
    +
    +      -- | 'explainOperationMany' will be called when producing an explanation
    +      -- of what the plan will do when given multiple input parameters (via
    +      -- 'planMany'). Plans that do not perform any interesting IO interactions
    +      -- should generally return an empty explanation.
    +    , explainOperationMany :: Exp.Explanation
    +    }
    +
    +{-|
    +  'AssertionFailed' may be returned from the execute functions of an
    +  'Operation' to indicate that some expected invariant has failed. For example,
    +  following a foreign key that is enforced by the database only to find that no
    +  record exists. When an 'Operation' returns an 'AssertionFailed' value during
    +  plan execution the error is thrown as an exception using the
    +  'Control.Monad.Catch.MonadThrow' instance for whatever monad the plan is
    +  executing in.
    +-}
    +newtype AssertionFailed =
    +  AssertionFailed String
    +  deriving Show
    +
    +{-|
    +  'mkAssertionFailed' builds an 'AssertionFailed' error from an error message.
    +-}
    +mkAssertionFailed :: String -> AssertionFailed
    +mkAssertionFailed =
    +  AssertionFailed
    +
    +instance Catch.Exception AssertionFailed
    +
    +{-|
    +  'askParam' simply returns the paremeter given from the plan.
    +-}
    +askParam :: Operation param param
    +askParam =
    +  Operation
    +    { executeOperationOne   = pure . Right
    +    , executeOperationMany  = \params -> pure . Right $ Many.fromKeys params Right
    +    , explainOperationOne   = Exp.noExplanation
    +    , explainOperationMany  = Exp.noExplanation
    +    }
    +
    +{-|
    +  'assertRight' returns the value on the 'Right' side of an 'Either'. If
    +  the 'Either' is a 'Left', it raises 'AssertionFailed' with the message
    +  from the left side of the either.
    +-}
    +assertRight :: Operation (Either String a) a
    +assertRight =
    +  Operation
    +    { executeOperationOne = \eitherA ->
    +      pure $
    +        case eitherA of
    +          Left err ->
    +            Left (AssertionFailed $ "Assertion failed: " <> err)
    +
    +          Right b ->
    +            Right b
    +
    +    , executeOperationMany = \eitherAs ->
    +      pure $
    +        case sequence eitherAs of
    +          Left err ->
    +            Left (AssertionFailed $ "Assertion failed: " <> err)
    +
    +          Right _ ->
    +            let
    +              errorOnLeft eitherA =
    +                case eitherA of
    +                  Left _ ->
    +                    -- We proved all the values above didn't have any lefts in
    +                    -- then, so if we get a left here it must not be one of the
    +                    -- keys from the Many.
    +                    Left Many.NotAKey
    +
    +                  Right a ->
    +                    Right a
    +            in
    +              Right $ Many.fromKeys eitherAs errorOnLeft
    +
    +    , explainOperationOne   = Exp.noExplanation
    +    , explainOperationMany  = Exp.noExplanation
    +    }
    +
    +{-|
    +  'findOne' builds a planning primitive that finds (at most) one row from the
    +  given table where the column value for the provided 'Core.FieldDefinition' matches
    +  the plan's input parameter. When executed on multiple parameters it fetches
    +  all rows where the field matches the inputs and arbitrarily picks at most one
    +  of those rows to use as the result for each input.
    +-}
    +findOne :: Ord fieldValue
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Operation fieldValue (Maybe readEntity)
    +findOne tableDef fieldDef =
    +  findOneWithOpts tableDef fieldDef mempty
    +
    +{-|
    +  'findOneWhere' is similar to 'findOne' but allows a 'WhereCondition' to be
    +  specified that is added to the database query to restrict which rows are
    +  returned.
    +-}
    +findOneWhere :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Operation fieldValue (Maybe readEntity)
    +findOneWhere tableDef fieldDef cond =
    +  findOneWithOpts tableDef fieldDef (Core.where_ cond)
    +
    +{-|
    +  'findOneWithOpts' is a internal helper used by 'findOne' and 'findOneWhere'
    +-}
    +findOneWithOpts :: Ord fieldValue
    +                => Core.TableDefinition readEntity writeEntity key
    +                -> Core.FieldDefinition nullability fieldValue
    +                -> Core.SelectOptions
    +                -> Operation fieldValue (Maybe readEntity)
    +findOneWithOpts tableDef fieldDef opts =
    +  selectOperation selectOp
    +    where
    +      selectOp =
    +        SelectOperation
    +          { selectOne = \fieldValue ->
    +              select (opts <> Core.where_ (fieldDef .== fieldValue) <> Core.limit 1)
    +
    +          , selectMany = \fieldValues ->
    +              select (opts <> Core.where_ (fieldDef .<- fieldValues))
    +
    +          , explainSelectOne =
    +              select (opts <> Core.where_ (stringyField .== T.pack "EXAMPLE VALUE"))
    +
    +          , explainSelectMany =
    +              select (opts <> Core.where_ (stringyField .<- map T.pack ["EXAMPLE VALUE 1", "EXAMPLE VALUE 2"]))
    +
    +          , categorizeRow = fst
    +          , produceResult = fmap snd . Maybe.listToMaybe
    +          }
    +
    +      select =
    +         Select.selectQuery
    +           fromSql
    +           (Select.fromClauseTable tableDef)
    +
    +      stringyField =
    +        stringifyField fieldDef
    +
    +      fromSql =
    +        (,)
    +          <$> Core.fieldFromSql fieldDef
    +          <*> Core.tableFromSql tableDef
    +
    +{-|
    +  'findAll' builds a planning primitive that finds all the rows from the
    +  given table where the column value for the provided field matches the
    +  plan's input parameter. Where executed on multiple parameters all rows
    +  are fetch in a single query and then associated with their respective
    +  inputs after being fetched.
    +-}
    +findAll :: Ord fieldValue
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Operation fieldValue [readEntity]
    +findAll tableDef fieldDef =
    +  findAllWithOpts tableDef fieldDef mempty
    +
    +{-|
    +  'findAllWhere' is similar to 'findAll' but allows a 'WhereCondition' to be
    +  specified that is added to the database query to restrict which rows are
    +  returned.
    +-}
    +findAllWhere :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Operation fieldValue [readEntity]
    +findAllWhere tableDef fieldDef cond =
    +  findAllWithOpts tableDef fieldDef (Core.where_ cond)
    +
    +{-|
    +  'findAllWithOpts' is an internal helper used by 'findAll' and 'findAllWhere'
    +-}
    +findAllWithOpts :: Ord fieldValue
    +                => Core.TableDefinition readEntity writeEntity key
    +                -> Core.FieldDefinition nullability fieldValue
    +                -> Core.SelectOptions
    +                -> Operation fieldValue [readEntity]
    +findAllWithOpts tableDef fieldDef opts =
    +  selectOperation selectOp
    +    where
    +      selectOp =
    +        SelectOperation
    +          { selectOne = \fieldValue ->
    +            select (opts <> Core.where_ (fieldDef .== fieldValue))
    +
    +          , selectMany = \fieldValues ->
    +            select (opts <> Core.where_ (fieldDef .<- fieldValues))
    +
    +          , explainSelectOne =
    +            select (opts <> Core.where_ (stringyField .== T.pack "EXAMPLE VALUE"))
    +
    +          , explainSelectMany =
    +            select (opts <> Core.where_ (stringyField .<- map T.pack ["EXAMPLE VALUE 1", "EXAMPLE VALUE 2"]))
    +
    +          , categorizeRow = fst
    +          , produceResult = map snd
    +          }
    +
    +      select =
    +        Select.selectQuery
    +          fromSql
    +          (Select.fromClauseTable tableDef)
    +
    +      stringyField =
    +        stringifyField fieldDef
    +
    +      fromSql =
    +        (,)
    +          <$> Core.fieldFromSql fieldDef
    +          <*> Core.tableFromSql tableDef
    +
    +{-|
    +  'stringifyField' arbitrarily re-labels the 'SqlType' of a field definition
    +  as text. It is an internal helper function that is used for constructing
    +  'WhereCondition' clauses used to generate sql when explaining how a plan
    +  will be executed. Relabeling the type as 'T.Text' allows us to use text
    +  values as example inputs in the queries when for explaining plans.
    +-}
    +stringifyField :: Core.FieldDefinition nullability a
    +               -> Core.FieldDefinition nullability T.Text
    +stringifyField fieldDef =
    +  fieldDef
    +    { Core.fieldType = Core.text 0
    +    }
    +
    +{-|
    +  'SelectOperation' is a helper type for building 'Operation' primitives that
    +  run 'Select' queries. Specifying the fields of 'SelectOperation' and then
    +  using the 'selectOperation' function to build an 'Operation' is more
    +  convenient that building functions to execute the queries thate are required
    +  by the 'Operation' type.
    +-}
    +data SelectOperation param row result =
    +  SelectOperation
    +    { -- | 'selectOne' will be called to build the 'Select' query that should
    +      -- be run when there is a single input parameter while executing a plan.
    +      -- Note that the "One-ness" here refers to the single input parameter
    +      -- rather than result. See 'produceResult' below for more information
    +      -- about returning one values vs. many from a 'SelectOperation'.
    +      selectOne           :: param -> Select row
    +
    +      -- | 'selectMany' will be called to build the 'Select' query that should
    +      -- be run when there are multiple parameters while executing a plan.
    +      -- Note that the "Many-ness" here refers to the multiple input parameters
    +      -- rather than result. See 'produceResult' below for more information
    +      -- about returning one values vs. many from a 'SelectOperation'.
    +    , selectMany          :: [param] -> Select row
    +
    +      -- | 'explainSelectOne' should show a representative query of what will
    +      -- be returned when 'selectOne' is used. No input parameter is available
    +      -- here to build the query, however, because this value is used to
    +      -- explain a plan without actually running it.
    +    , explainSelectOne    :: Select row
    +
    +      -- | 'explainSelectMany' should show a representative query of what will
    +      -- be returned when 'selectMany is used. No input parameters are available
    +      -- here to build the query, however, because this value is used to
    +      -- explain a plan without actually running it.
    +    , explainSelectMany   :: Select row
    +
    +      -- | 'categorizeRow' will be used when a plan is executed with multiple
    +      -- parameters to determine which input parameter the row should be
    +      -- associated with.
    +    , categorizeRow       :: row -> param
    +
    +      -- | 'produceResult' will be used convert the 'row' type returned by the
    +      -- 'Select' queries for the operation input the 'result' type that is
    +      -- present as the output of the operation. The input rows will be all the
    +      -- inputs associated with a single parameter. The 'result' type
    +      -- constructed here need not be a single value. For instance, 'findAll'
    +      -- uses the list type as the 'result' type and 'findOne' uses 'Maybe'.
    +    , produceResult       :: [row] -> result
    +    }
    +
    +{-|
    +  'selectOperation' builds a primitive planning 'Operation' using the functions
    +  given by a 'SelectOperation'. If you are implementing a custom operation that
    +  runs a select statement, it is probably easier to use this function rather
    +  than building the 'Operation' functions directly.
    +-}
    +selectOperation :: Ord param
    +                => SelectOperation param row result
    +                -> Operation param result
    +selectOperation selectOp =
    +  Operation
    +    { executeOperationOne   = runSelectOne selectOp
    +    , executeOperationMany  = runSelectMany selectOp
    +    , explainOperationOne   = Exp.explainStep $ SelectInternal.selectSql (explainSelectOne selectOp)
    +    , explainOperationMany  = Exp.explainStep $ SelectInternal.selectSql (explainSelectMany selectOp)
    +    }
    +
    +
    +{-|
    +  'runSelectOne' is an internal helper function that executes a
    +  'SelectOperation' on a single input parameter.
    +-}
    +runSelectOne :: Core.MonadOrville conn m
    +             => SelectOperation param row result
    +             -> param
    +             -> m (Either AssertionFailed result)
    +runSelectOne selectOp param =
    +  Right . produceResult selectOp <$>
    +    (Select.runSelect . selectOne selectOp $ param)
    +
    +
    +{-|
    +  'runSelectMany' is an internal helper function that executes a
    +  'SelectOperation' on multiple input parameters.
    +-}
    +runSelectMany :: (Ord param, Core.MonadOrville conn m)
    +              => SelectOperation param row result
    +              -> [param]
    +              -> m (Either AssertionFailed (Many param result))
    +runSelectMany selectOp params = do
    +  rows <- Select.runSelect . selectMany selectOp $ params
    +
    +  let
    +    -- Seed add initial map with an empty list for every input parameter
    +    -- to guarantee that each param is a key in the map even if no rows
    +    -- where returned from the select query for that param.
    +    emptyRowsMap =
    +      Map.fromList
    +      . map (\param -> (param, []))
    +      $ params
    +
    +    insertRow results row =
    +      Map.alter
    +        (\mbRows -> Just (row : Maybe.fromMaybe [] mbRows))
    +        (categorizeRow selectOp row)
    +        results
    +
    +    rowMap =
    +      produceResult selectOp <$> Fold.foldl' insertRow emptyRowsMap rows
    +
    +    manyRows =
    +      Many.fromKeys params $ \param ->
    +        case Map.lookup param rowMap of
    +          Nothing ->
    +            -- Because we seeded the map above with all the input parameters we
    +            -- can be sure that if we don't find a value in the map here it is
    +            -- because the function parameter is not one of the original inputs
    +            -- rather than just an input for which no rows were returned by the
    +            -- select query.
    +            Left Many.NotAKey
    +
    +          Just row ->
    +            Right row
    +
    +  pure . Right $ manyRows
    +
    +
    +{-|
    +  'findSelect' builds a plan 'Operation' where the select that is run does not
    +  use the input parameters for the plan in any way. If the
    +  'executeOperationMany' function of the resulting 'Operation' will run the
    +  query once and use the entire result set as the result each of the input
    +  parameters in turn.
    +-}
    +findSelect :: Select.Select row -> Operation param [row]
    +findSelect select =
    +  let
    +    runOne _ =
    +      Right <$> Select.runSelect select
    +
    +    runMany params = do
    +      rows <- Select.runSelect select
    +      pure . Right $ Many.fromKeys params (const (Right rows))
    +  in
    +    Operation
    +      { executeOperationOne   = runOne
    +      , executeOperationMany  = runMany
    +      , explainOperationOne   = Exp.explainStep (SelectInternal.selectSql select)
    +      , explainOperationMany  = Exp.explainStep (SelectInternal.selectSql select)
    +      }
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html new file mode 100644 index 0000000..2187d40 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html @@ -0,0 +1,52 @@ +
    {- |
    +Module    : Orville.PostgreSQL.Connection
    +Copyright : Flipstone Technology Partners 2021
    +License   : MIT
    +
    +This module exports the 'Plan.bind' function as '>>=' so that it can be used in
    +conjuction with the @QualifiedDo@ language extension to write plans using do
    +syntax like so:
    +
    +@
    +{-# LANGUAGE QualifiedDo #-}
    +module MyModule where
    +
    +import qualified Orville.PostgreSQL.Plan.Syntax as PlanSyntax
    +
    +data FooFamily =
    +  FooFamily
    +    { foo :: Foo
    +    , children :: [FooChildren]
    +    , pets :: [FooPets]
    +    }
    +
    +findFooFamily = PlanSyntax.do $
    +  fooHeader <- Plan.findOne fooTable fooIdField
    +  fooChildren <- Plan.findAll fooChildTable fooIdField
    +  fooPets <- Plan.findAll fooPetTable fooIdField
    +
    +  FooFamily
    +    <$> Plan.use fooHeader
    +    <*> Plan.use fooChildren
    +    <*> Plan.use fooPets
    +@
    +
    +-}
    +module Database.Orville.PostgreSQL.Plan.Syntax
    +  ( (>>=),
    +  )
    +where
    +
    +import Prelude ()
    +
    +import qualified Database.Orville.PostgreSQL.Plan as Plan
    +
    +{- |
    +  An operator alias of 'Plan.bind' so that it can be used with @QualifiedDo@.
    +-}
    +(>>=) ::
    +  Plan.Plan scope param a ->
    +  (Plan.Planned scope param a -> Plan.Plan scope param result) ->
    +  Plan.Plan scope param result
    +(>>=) = Plan.bind
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html new file mode 100644 index 0000000..082456c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html @@ -0,0 +1,689 @@ +
    {-# LANGUAGE GADTs #-}
    +{-# LANGUAGE RankNTypes #-}
    +module Database.Orville.PostgreSQL.Plan
    +  ( Plan
    +  , Planned
    +  , Execute
    +  , Explain
    +  , askParam
    +
    +  -- * Using a Plan after it is constructed
    +  , execute
    +  , explain
    +
    +  -- * Making a Plan to find rows in the database
    +  , findMaybeOne
    +  , findMaybeOneWhere
    +  , findOne
    +  , findOneShowVia
    +  , findOneWhere
    +  , findOneWhereShowVia
    +  , findAll
    +  , findAllWhere
    +
    +  -- * Creating a multi-step Plan from other Plan values
    +  , bind
    +  , use
    +  , using
    +  , chain
    +  , apply
    +  , planMany
    +  , planList
    +  , focusParam
    +  , planEither
    +  , planMaybe
    +
    +  -- * Bridges from other types into Plan
    +  , Op.AssertionFailed
    +  , assert
    +  , planSelect
    +  , planOperation
    +  ) where
    +
    +import           Data.Either (partitionEithers)
    +import qualified Control.Monad.Catch as Catch
    +
    +import qualified Database.Orville.PostgreSQL.Core as Core
    +import           Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +import           Database.Orville.PostgreSQL.Plan.Many (Many)
    +import qualified Database.Orville.PostgreSQL.Plan.Many as Many
    +import qualified Database.Orville.PostgreSQL.Plan.Operation as Op
    +import qualified Database.Orville.PostgreSQL.Plan.Explanation as Exp
    +import           Database.Orville.PostgreSQL.Select (Select)
    +
    +{-|
    +  A 'Plan' is an executable set of queries that can be executed to load data
    +  from the database, using the results of prior queries as input parameters to
    +  following queries in controlled ways. In particular, the "controlled" aspect
    +  of this allows plans that take a single input to be adapted to take multiple
    +  input parameters in a list without the resulting plan executing N+1 queries.
    +  This restriction means that while query results can be used as input
    +  parameters to later queries, they cannot be used to decide to run completely
    +  different queries based on other query results. Allowing this would prevent
    +  the 'Plan' structure from eliminating N+1 query loops.
    +
    +  Note that during execution queries are never combined across tables to form
    +  joins or subqueries. Queries are still executed in the same sequence as
    +  specified in the plan, just on all the inputs at once rather than in a loop.
    +  If you need to do a join with a plan, you can always construction your
    +  own custom 'Op.Operation' and use 'planOperation' to incorporate into a plan.
    +
    +  The @param@ type variable indicates what type of value is expected as input
    +  when the plan is executed.
    +
    +  The @result@ type for a plan indicates what Haskell type is produced
    +  when the plan is executed.
    +
    +  The @scope@ type is used internally by Orville to track the plan is currently
    +  executed against a single input or multiple inputs. This type parameter
    +  should never specified as a concrete type in user code, but must be exposed
    +  as a variable to ensure that execute scope is tracked correctly through
    +  usages of 'bind'.
    +
    +-}
    +data Plan scope param result where
    +  PlanOp :: Op.Operation param result -> Plan scope param result
    +
    +  PlanMany :: (forall manyScope. Plan manyScope param result)
    +           -> Plan scope [param] (Many param result)
    +
    +  PlanEither :: Plan scope leftParam leftResult
    +             -> Plan scope rightParam rightResult
    +             -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult)
    +
    +  Bind :: Plan scope param a
    +       -> (Planned scope param a -> Plan scope param result)
    +       -> Plan scope param result
    +
    +  Use :: Planned scope param a -> Plan scope param a
    +
    +  Pure :: a -> Plan scope param a
    +
    +  Apply :: Plan scope param (a -> b)
    +        -> Plan scope param a
    +        -> Plan scope param b
    +
    +  Chain :: Plan scope a b
    +        -> Plan scope b c
    +        -> Plan scope a c
    +
    +instance Functor (Plan scope param) where
    +  fmap f = Apply (Pure f)
    +
    +instance Applicative (Plan scope param) where
    +  pure = Pure
    +  (<*>) = Apply
    +
    +{-|
    +  'Execute' is a tag type used by as the 'scope' variable for
    +  'Plan' values when executing them via the 'execute' function.
    +-}
    +data Execute
    +
    +{-|
    +  'ExecuteMany' is an internal tag type used by as the 'scope' variable for
    +  'Plan' values when executing them against multiple inputs via the
    +  'executeMany' internal function.
    +-}
    +data ExecuteMany
    +
    +{-|
    +  A 'Planned' value is a wrapper around the results of previous run queries
    +  when using the 'bind' function. At the time that you are writing a plan you
    +  do not know whether the 'Plan' will be run with a single input or multiple
    +  inputs. A 'Planned' value may end up being either an individual item or a
    +  list of items. Due to this, your ability to interact with the value is
    +  limited to the use of 'fmap' to extract (or build) other values from the
    +  results. 'Planned' values can be used together with the 'use' function to
    +  make a 'Plan' that produces the extracted value.
    +
    +  Note that while 'Planned' could provide an 'Applicative' instance as well, it
    +  does not to avoid confusion with 'Applicative' instance for 'Plan' itself.
    +  If you need to build a value from several 'Planned' values using
    +  'Applicative', you should call 'use' on each of the values and use the
    +  'Applicative' instance for 'Plan'.
    +-}
    +data Planned scope param a where
    +  PlannedOne      :: a -> Planned Execute param a
    +  PlannedMany     :: Many k a -> Planned ExecuteMany k a
    +  PlannedExplain  :: Planned Explain param a
    +
    +instance Functor (Planned scope param) where
    +  fmap = mapPlanned
    +
    +{-|
    +  'mapPlanned' applies a function to what value or values have been produced by
    +  the plan. This function can also be called as 'fmap' or '<$>' thorugh the
    +  'Functor' instance for 'Planned'.
    +-}
    +mapPlanned :: (a -> b) -> Planned scope param a -> Planned scope param b
    +mapPlanned f planned =
    +  case planned of
    +    PlannedOne a ->
    +      PlannedOne (f a)
    +
    +    PlannedMany manyAs ->
    +      PlannedMany (fmap f manyAs)
    +
    +    PlannedExplain ->
    +      PlannedExplain
    +
    +{-|
    +  'resolveOne' resolves a 'Planned' value that is known to be in the 'One'
    +  scope to its single wrapped value.
    +-}
    +resolveOne :: Planned Execute param a -> a
    +resolveOne (PlannedOne a) = a
    +
    +{-|
    +  'resolveMany resolves a 'Planned' value that is known to be in the 'Many'
    +  scope to the 'Many' value wrapped inside it.
    +-}
    +resolveMany :: Planned ExecuteMany k a -> Many k a
    +resolveMany (PlannedMany as) = as
    +
    +{-|
    +  'planOperation' allows any primitive 'Op.Operation' to be used as an atomic step
    +  in a plan. When the plan is executed, the appropriate 'Op.Operation' functions
    +  will be used depending on the execution context.
    +-}
    +planOperation :: Op.Operation param result
    +              -> Plan scope param result
    +planOperation =
    +  PlanOp
    +
    +{-|
    +  'planSelect' allows any Orville 'Select' query to be incorporated into a
    +  plan. Note that the 'Select' cannot depend on the plan's input parameters in
    +  this case. If the plan is executed with multiple inputs the same set of all
    +  the results will be used as the results for each of the input parameters.
    +-}
    +planSelect :: Select row -> Plan scope () [row]
    +planSelect select =
    +  planOperation (Op.findSelect select)
    +
    +{-|
    +  'askParam' allows the input parameter for the plan to be retrieved as the
    +  result of the plan. Together with 'bind' you can use this to get access to
    +  the input parameter as a 'Planned' value.
    +-}
    +askParam :: Plan scope param param
    +askParam =
    +  planOperation Op.askParam
    +
    +{-|
    +  'findMaybeOne' constructs a 'Plan' that will find at most one row from
    +  the given table where the plan's input value matches the given database
    +  field.
    +-}
    +findMaybeOne :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Plan scope fieldValue (Maybe readEntity)
    +findMaybeOne tableDef fieldDef =
    +  planOperation (Op.findOne tableDef fieldDef)
    +
    +{-|
    +  'findMaybeOneWhere' is similar to 'findMaybeOne', but allows a
    +  'WhereCondition' to be specified to restrict which rows are matched by the
    +  database query.
    +-}
    +findMaybeOneWhere :: Ord fieldValue
    +                  => Core.TableDefinition readEntity writeEntity key
    +                  -> Core.FieldDefinition nullability fieldValue
    +                  -> Core.WhereCondition
    +                  -> Plan scope fieldValue (Maybe readEntity)
    +findMaybeOneWhere tableDef fieldDef cond =
    +  planOperation (Op.findOneWhere tableDef fieldDef cond)
    +
    +{-|
    +  'findOneShowVia' is similar to 'findMaybeOne, but it expects that there will
    +  always be a row found matching the plan's input value. If no row is found an
    +  'Op.AssertionFailed' exception will be thrown. This is a useful convenience
    +  when looking up foreign-key associations that are expected to be enforced by
    +  the database itself.
    +-}
    +findOneShowVia :: Ord fieldValue
    +               => (fieldValue -> String)
    +               -> Core.TableDefinition readEntity writeEntity key
    +               -> Core.FieldDefinition nullability fieldValue
    +               -> Plan scope fieldValue readEntity
    +findOneShowVia showParam tableDef fieldDef =
    +  assert
    +    (assertFound showParam tableDef fieldDef)
    +    (findMaybeOne tableDef fieldDef)
    +
    +{-|
    +  'findOne' is an alias to 'findOneShowVia' that uses the 'Show' instance of
    +  'fieldValue' when producing a failure message in the result the entity cannot
    +  be found.
    +-}
    +findOne :: (Show fieldValue, Ord fieldValue)
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Plan scope fieldValue readEntity
    +findOne tableDef fieldDef =
    +  assert
    +    (assertFound show tableDef fieldDef)
    +    (findMaybeOne tableDef fieldDef)
    +
    +{-|
    +  'findOneWhereShowVia' is similar to 'findOneShowVia', but allows a 'WhereCondition' to be
    +  specified to restrict which rows are matched by the database query.
    +-}
    +findOneWhereShowVia :: Ord fieldValue
    +                    => (fieldValue -> String)
    +                    -> Core.TableDefinition readEntity writeEntity key
    +                    -> Core.FieldDefinition nullability fieldValue
    +                    -> Core.WhereCondition
    +                    -> Plan scope fieldValue readEntity
    +findOneWhereShowVia showParam tableDef fieldDef cond =
    +  assert
    +    (assertFound showParam tableDef fieldDef)
    +    (findMaybeOneWhere tableDef fieldDef cond)
    +
    +{-|
    +  'findOneWhere' is an alias to 'findOneWhereShowVia' that uses the 'Show' instance of
    +  'fieldValue' when producing a failure message in the result the entity cannot
    +  be found.
    +-}
    +findOneWhere :: (Show fieldValue, Ord fieldValue)
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Plan scope fieldValue readEntity
    +findOneWhere = findOneWhereShowVia show
    +
    +{-|
    +  'assertFound' is an internal helper that checks that row was found where
    +  one was expected.
    +-}
    +assertFound :: (fieldValue -> String)
    +            -> Core.TableDefinition readEntity writeEntity key
    +            -> Core.FieldDefinition nullability fieldValue
    +            -> fieldValue
    +            -> Maybe result
    +            -> Either String result
    +assertFound showParam tableDef fieldDef param maybeRecord =
    +  case maybeRecord of
    +    Just a ->
    +      Right a
    +
    +    Nothing ->
    +      Left $
    +        unwords
    +          [ "Failed to find record in table"
    +          , Core.tableName tableDef
    +          , "where"
    +          , Core.fieldName fieldDef
    +          , " = "
    +          , showParam param
    +          ]
    +
    +{-|
    +  'findAll' constructs a 'Plan' that will find all the rows from the given
    +  table there the plan's input value matches the given database field.
    +-}
    +findAll :: Ord fieldValue
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Plan scope fieldValue [readEntity]
    +findAll tableDef fieldDef =
    +  planOperation (Op.findAll tableDef fieldDef)
    +
    +{-|
    +  'findAllWhere' is similar to 'findAll', but allows a 'WhereCondition' to be
    +  specified to restrict which rows are matched by the database query.
    +-}
    +findAllWhere :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Plan scope fieldValue [readEntity]
    +findAllWhere tableDef fieldDef cond =
    +  planOperation (Op.findAllWhere tableDef fieldDef cond)
    +
    +{-|
    +  'planMany' adapts a plan that takes a single input parameter to work on
    +  multiple input parameters. When the new plan is executed each query will
    +  execute in the same basic order, but with adjusted conditions to find all the
    +  rows for all inputs at once rather than running the planned queries once for
    +  each input.
    +-}
    +planMany :: (forall manyScope. Plan manyScope param result)
    +         -> Plan scope [param] (Many param result)
    +planMany =
    +  PlanMany
    +
    +{-|
    +  'planList' lifts a plan so both its param and result become lists.
    +  This saves you from having to fmap in 'Many.elems' when all you want back
    +  from a 'Many' is the list of results inside it.
    +-}
    +planList :: (forall scope. Plan scope param result)
    +         -> Plan listScope [param] [result]
    +planList plan =
    +  Many.elems <$> planMany plan
    +
    +{-|
    +  'focusParam' builds a plan from a function and an existing plan taking the
    +  result of that function as input. This is especially useful when there is some
    +  structure, and a plan that only needs a part of that structure as input. The
    +  function argument can access part of the structure for the plan argument to use,
    +  so the final returned plan can take the entire structure as input.
    +-}
    +focusParam :: (a -> b)
    +           -> Plan scope b result
    +           -> Plan scope a result
    +focusParam focuser plan =
    +  chain (focuser <$> askParam) plan
    +
    +
    +{-|
    +  'planEither' lets you construct a plan that branches by executing a different
    +  plan for the 'Left' and 'Right' sides of an 'Either' value. When used with a
    +  single input parameter only one of the two plans will be used, based on the
    +  input parameter. When used on multiple input parameters, each of the two
    +  plans will be executed only once with all the 'Left' and 'Right' values
    +  provided as input parameters respectively.
    +-}
    +planEither :: Plan scope leftParam leftResult
    +           -> Plan scope rightParam rightResult
    +           -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult)
    +planEither =
    +  PlanEither
    +
    +{-|
    +  'planMaybe' lifts a plan so both its param and result become 'Maybe's. This is
    +  useful when modifying an existing plan to deal with optionality. Writing just
    +  one plan can then easily produce both the required and optional versions.
    +-}
    +planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b)
    +planMaybe plan =
    +  focusParam (maybe (Left ()) Right) $
    +    either id id <$> planEither (pure Nothing) (Just <$> plan)
    +
    +{-|
    +  'bind' gives access to the results of a plan to use as input values to future
    +  plans. The plan result is given the input parameter to the provided function,
    +  which must produce the remaining 'Plan' to be executed. The value will be
    +  wrapped in the 'Planned' type, which may represent either a result or
    +  multiple results, depending on whether one plan is currently be executed with
    +  one and multiple input parameters. This ensures that the caller produces only
    +  a single remaining 'Plan' to be used for all inputs when there are multiple
    +  to eliminate the need to possibly run different queries for different inputs
    +  (which would an introduce N+1 query execution).
    +
    +  The 'Planned' value (or values) provided by 'bind' have actually been
    +  retrieved from the database, so the value can be used multiple times when
    +  constructing the remaining 'Plan' without fear of causing the query to run
    +  multiple times.
    +
    +  Also see 'use' for how to lift a 'Planned' value back into a 'Plan'.
    +-}
    +bind :: Plan scope param a
    +     -> (Planned scope param a -> Plan scope param result)
    +     -> Plan scope param result
    +bind =
    +  Bind
    +
    +{-|
    +  'use' constructs a 'Plan' that always produces the 'Planned' value
    +  as its result, regardless of the parameter given as input to the plan.
    +-}
    +use :: Planned scope param a -> Plan scope param a
    +use =
    +  Use
    +
    +{-|
    +  'using' uses a 'Planned' value in the input to another 'Plan'. The
    +  resulting plan will ignore its input and use the 'Planned' value as
    +  the input to produce its result instead.
    +-}
    +using :: Planned scope param a
    +      -> Plan scope a b
    +      -> Plan scope param b
    +using planned plan =
    +  chain (use planned) plan
    +
    +{-|
    +  'apply' applies a function produced by a plan to the value produced
    +  by another plan. This is usually used via the '<*>' operator through
    +  the 'Applicative' instance for 'Plan'.
    +-}
    +apply :: Plan scope param (a -> b)
    +      -> Plan scope param a
    +      -> Plan scope param b
    +apply =
    +  Apply
    +
    +{-|
    +  'chain' connects the output of one plan to the input of another to form a
    +  larger plan that will execute the first followed by the second.
    +-}
    +chain :: Plan scope a b
    +      -> Plan scope b c
    +      -> Plan scope a c
    +chain =
    +  Chain
    +
    +{-|
    +  'assert' allows you to make an assertion about a plans result that will throw
    +  an 'Op.AssertionFailed' failed exception during execution if it proves to be
    +  false. The first parameter is the assertion function, which should return
    +  either an error message to be given in the exception or the value to be used
    +  as the plan's result.
    +-}
    +assert :: (param -> a -> Either String b)
    +       -> Plan scope param a
    +       -> Plan scope param b
    +assert assertion aPlan =
    +  let
    +    eitherPlan =
    +      assertion
    +        <$> askParam
    +        <*> aPlan
    +  in
    +    chain eitherPlan (PlanOp Op.assertRight)
    +
    +{-|
    +  'execute' accepts the input parameter (or parameters) expected by a 'Plan'
    +  and runs the plan to completion, either throwing an 'Op.AssertionFailed'
    +  exception in the monad 'm' or producing the expected result.
    +
    +  If you have a plan that takes one input and want to provide a list of
    +  input, use 'planMany' to adapt it to a multple-input plan before calling
    +  'execute'.
    +-}
    +execute :: Core.MonadOrville conn m
    +        => Plan Execute param result
    +        -> param
    +        -> m result
    +execute plan param =
    +  executeOne plan param
    +
    +{-|
    +  'executeOne' is an internal helper that executes a 'Plan' with a concrete
    +  'scope' type to ensure all 'Planned' values are built with 'PlannedOne'.
    +-}
    +executeOne :: Core.MonadOrville conn m
    +           => Plan Execute param result
    +           -> param
    +           -> m result
    +executeOne plan param =
    +  case plan of
    +    PlanOp operation -> do
    +      opResult <- Op.executeOperationOne operation param
    +
    +      case opResult of
    +        Left err ->
    +          Catch.throwM err
    +
    +        Right result ->
    +          pure result
    +
    +    PlanMany manyPlan ->
    +      executeMany manyPlan param
    +
    +    PlanEither leftPlan rightPlan ->
    +      case param of
    +        Left leftParam ->
    +          Left <$> executeOne leftPlan leftParam
    +
    +        Right rightParam ->
    +          Right <$> executeOne rightPlan rightParam
    +
    +    Bind intermPlan continue -> do
    +      interm <- executeOne intermPlan param
    +      executeOne
    +        (continue (PlannedOne interm))
    +        param
    +
    +    Use planned ->
    +      pure . resolveOne $ planned
    +
    +    Pure a ->
    +      pure a
    +
    +    Apply planF planA ->
    +      executeOne planF param <*> executeOne planA param
    +
    +    Chain planAB planBC -> do
    +      b <- executeOne planAB param
    +      executeOne planBC b
    +
    +{-|
    +  'executeMany' is an internal helper that executes a 'Plan' with a concrete
    +  @scope@ type to ensure all 'Planned' values are built with 'PlannedMany'.
    +-}
    +executeMany :: Core.MonadOrville conn m
    +            => Plan ExecuteMany param result
    +            -> [param]
    +            -> m (Many.Many param result)
    +executeMany plan params =
    +  case plan of
    +    PlanOp operation -> do
    +      opResult <- Op.executeOperationMany operation params
    +
    +      case opResult of
    +        Left err ->
    +          Catch.throwM $ err
    +
    +        Right results ->
    +          pure results
    +
    +    PlanMany manyPlan -> do
    +      let
    +        flatParams = concat params
    +
    +      allResults <- executeMany manyPlan flatParams
    +
    +      let
    +        restrictResults subParams =
    +          Many.fromKeys subParams (\k -> Many.lookup k allResults)
    +
    +      pure $ Many.fromKeys params (Right . restrictResults)
    +
    +    PlanEither leftPlan rightPlan -> do
    +      let
    +        (leftParams, rightParams) = partitionEithers params
    +
    +      leftResults <- executeMany leftPlan leftParams
    +      rightResults <- executeMany rightPlan rightParams
    +
    +      let
    +        eitherResult eitherK =
    +          case eitherK of
    +            Left k ->
    +              Left <$> Many.lookup k leftResults
    +
    +            Right k ->
    +              Right <$> Many.lookup k rightResults
    +
    +      pure $ Many.fromKeys params eitherResult
    +
    +    Bind intermPlan continue -> do
    +      interms <- executeMany intermPlan params
    +      executeMany
    +        (continue (PlannedMany interms))
    +        params
    +
    +    Use planned ->
    +      pure . resolveMany $ planned
    +
    +    Pure a ->
    +      pure $ Many.fromKeys params (const (Right a))
    +
    +    Apply planF planA -> do
    +      manyFs <- executeMany planF params
    +      manyAs <- executeMany planA params
    +
    +      pure (Many.apply manyFs manyAs)
    +
    +    Chain planAB planBC -> do
    +      bs <- executeMany planAB params
    +      cs <- executeMany planBC (Many.elems bs)
    +      pure $ Many.compose cs bs
    +
    +{-|
    +  'Explain' is an tag type used as the 'scope' variable when explaining a
    +  'Plan' via the 'explain' function.
    +-}
    +data Explain
    +  = ExplainOne
    +  | ExplainMany
    +
    +{-|
    +  'explain' produces a textual description of the steps outlined by
    +  a 'Plan' -- in most cases example SQL queries. If you want to see
    +  the explanation of how the plan will run with multiple input parameters,
    +  you can use 'planMany' to adapt it before calling 'explain'.
    +-}
    +explain :: Plan Explain param result -> [String]
    +explain plan =
    +  Exp.explanationSteps $
    +    explainPlan ExplainOne plan
    +
    +{-|
    +  'explainPlan' is an internal helper to executes a plan with the
    +  'scope' type fixed to 'Explain' to ensure that all 'Planned'
    +  values are constructed with the 'PlannedExplain' constructor.
    +-}
    +explainPlan :: Explain
    +            -> Plan Explain param result
    +            -> Exp.Explanation
    +explainPlan mult plan =
    +  case plan of
    +    PlanOp operation -> do
    +      case mult of
    +        ExplainOne ->
    +          Op.explainOperationOne operation
    +
    +        ExplainMany ->
    +          Op.explainOperationMany operation
    +
    +    PlanMany manyPlan -> do
    +      explainPlan ExplainMany manyPlan
    +
    +    PlanEither leftPlan rightPlan ->
    +      explainPlan mult leftPlan <> explainPlan mult rightPlan
    +
    +    Bind intermPlan continue ->
    +      let
    +        nextPlan = continue PlannedExplain
    +      in
    +        explainPlan mult intermPlan <> explainPlan mult nextPlan
    +
    +    Use _ ->
    +      Exp.noExplanation
    +
    +    Pure _ ->
    +      Exp.noExplanation
    +
    +    Apply planF planA -> do
    +      explainPlan mult planF <> explainPlan mult planA
    +
    +    Chain planAB planBC -> do
    +      explainPlan mult planAB <> explainPlan mult planBC
    +
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html new file mode 100644 index 0000000..8e324d2 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html @@ -0,0 +1,589 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Popper
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE GADTs #-}
    +{-# LANGUAGE RankNTypes #-}
    +
    +module Database.Orville.PostgreSQL.Popper
    +  ( PopError(..)
    +  , Popper
    +  , Popped(..)
    +  , (>>>)
    +  , (<<<)
    +  , abortPop
    +  , certainly
    +  , certainly'
    +  , fromKern
    +  , hasMany
    +  , hasManyIn
    +  , hasOneIn
    +  , hasManyInWhere
    +  , hasManyWhere
    +  , hasOne
    +  , hasOne'
    +  , hasOneWhere
    +  , kern
    +  , popMissingRecord
    +  , onKern
    +  , pop
    +  , popThrow
    +  , popFirst
    +  , popMany
    +  , onPopMany
    +  , popMaybe
    +  , popQuery
    +  , popRecord
    +  , popRecord'
    +  , popTable
    +  , explain
    +  , explainLines
    +  ) where
    +
    +import Prelude hiding ((.))
    +
    +import Control.Applicative
    +import Control.Arrow
    +import Control.Category
    +import Control.Monad.Catch
    +import Data.Either
    +import Data.List (intercalate)
    +import qualified Data.Map.Strict as Map
    +import Data.Maybe
    +
    +import Database.Orville.PostgreSQL.Core
    +import Database.Orville.PostgreSQL.Internal.QueryCache
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +
    +-- Simple helpers and such that make the public API
    +kern :: Popper a a
    +kern = PopId
    +
    +fromKern :: (a -> b) -> Popper a b
    +fromKern f = f <$> kern
    +
    +onKern :: (a -> b -> c) -> Popper b a -> Popper b c
    +onKern mkPuff popper = mkPuff <$> popper <*> kern
    +
    +liftPop :: (a -> Popped b) -> Popper a b
    +liftPop = PopLift
    +
    +abortPop :: PopError -> Popper a b
    +abortPop = PopAbort
    +
    +{-|
    +   popQuery embeds an Orville operation in a popper. It is left up to the
    +   programmer to ensure that the Orville operation does not do any updates
    +   to the database, but only does queries.
    +
    +   The initial string argument is a description of the query to put into
    +   the results of `explain`
    +-}
    +popQuery ::
    +     String
    +  -> (forall conn m. MonadOrville conn m =>
    +                       m b)
    +  -> Popper a b
    +popQuery explanation orville = PopPrim (PrimQuery explanation orville)
    +
    +certainly :: PopError -> Popper (Maybe b) b
    +certainly err = liftPop $ maybe (PoppedError err) PoppedValue
    +
    +certainly' :: Popper a PopError -> Popper a (Maybe b) -> Popper a b
    +certainly' msgPopper bPopper =
    +  (msgPopper &&& bPopper) >>>
    +  liftPop (\(err, maybeB) -> maybe (PoppedError err) PoppedValue maybeB)
    +
    +popRecord ::
    +     TableDefinition readEntity writeEntity key
    +  -> key
    +  -> Popper a (Maybe readEntity)
    +popRecord tableDef key = popQuery explanation (findRecord tableDef key)
    +  where
    +    explanation = "popRecord " ++ tableName tableDef
    +
    +popRecord' ::
    +     TableDefinition readEntity writeEntity key -> key -> Popper a readEntity
    +popRecord' td key = popRecord td key >>> certainly err
    +  where
    +    err = MissingRecord td (tablePrimaryKey td) key
    +
    +popFirst ::
    +     TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> Popper a (Maybe readEntity)
    +popFirst tableDef opts = popQuery explanation (selectFirst tableDef opts)
    +  where
    +    explanation = "popFirst " ++ tableName tableDef
    +
    +popTable ::
    +     TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> Popper a [readEntity]
    +popTable tableDef opts = popQuery explanation (selectAll tableDef opts)
    +  where
    +    explanation =
    +      "popTable " ++ tableName tableDef ++ " " ++ selectOptClause opts
    +
    +popMaybe :: Popper a b -> Popper (Maybe a) (Maybe b)
    +popMaybe = PopMaybe
    +
    +hasMany ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue [readEntity]
    +hasMany tableDef fieldDef = PopPrim (PrimRecordManyBy tableDef fieldDef mempty)
    +
    +hasOneIn ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper [fieldValue] (Map.Map fieldValue readEntity)
    +hasOneIn tableDef fieldDef = PopPrim (PrimRecordsBy tableDef fieldDef mempty)
    +
    +hasManyIn ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper [fieldValue] (Map.Map fieldValue [readEntity])
    +hasManyIn tableDef fieldDef =
    +  PopPrim (PrimRecordsManyBy tableDef fieldDef mempty)
    +
    +hasManyWhere ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> Popper fieldValue [readEntity]
    +hasManyWhere tableDef fieldDef opts =
    +  PopPrim (PrimRecordManyBy tableDef fieldDef opts)
    +
    +hasManyInWhere ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> Popper [fieldValue] (Map.Map fieldValue [readEntity])
    +hasManyInWhere tableDef fieldDef opts =
    +  PopPrim (PrimRecordsManyBy tableDef fieldDef opts)
    +
    +hasOne ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue (Maybe readEntity)
    +hasOne tableDef fieldDef = hasOneWhere tableDef fieldDef mempty
    +
    +hasOneWhere ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> Popper fieldValue (Maybe readEntity)
    +hasOneWhere tableDef fieldDef opts =
    +  PopPrim (PrimRecordBy tableDef fieldDef opts)
    +
    +hasOne' ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue readEntity
    +hasOne' tableDef fieldDef =
    +  certainly' (popMissingRecord tableDef fieldDef) (hasOne tableDef fieldDef)
    +
    +popMissingRecord ::
    +     TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue PopError
    +popMissingRecord tableDef fieldDef = fromKern (MissingRecordBy tableDef fieldDef)
    +
    +-- popMany is the most involved helper. It recursively
    +-- rewrites the entire Popper expression to avoid
    +-- running the popper's queries individually for each
    +-- item in the list.
    +--
    +-- This is where the magic happens.
    +--
    +popMany :: Popper a b -> Popper [a] [b]
    +popMany (PopOnMany _ manyPopper) = manyPopper
    +popMany (PopPrim (PrimRecordBy tableDef fieldDef selectOptions)) =
    +  zipWith Map.lookup <$> kern <*>
    +  (repeat <$> PopPrim (PrimRecordsBy tableDef fieldDef selectOptions))
    +popMany (PopPrim (PrimRecordManyBy tableDef fieldDef opts)) =
    +  zipWith getRecords <$> kern <*>
    +  (repeat <$> PopPrim (PrimRecordsManyBy tableDef fieldDef opts))
    +  where
    +    getRecords key = fromMaybe [] . Map.lookup key
    +popMany (PopPrim (PrimRecordsManyBy tableDef fieldDef opts)) =
    +  (zipWith restrictMap) <$> kern <*>
    +  (fromKern concat >>>
    +   PopPrim (PrimRecordsManyBy tableDef fieldDef opts) >>> fromKern repeat)
    +  where
    +    restrictMap keys = Map.filterWithKey (isKey keys)
    +    isKey keys key _ = key `elem` keys
    +popMany (PopPrim (PrimRecordsBy tableDef fieldDef opts)) =
    +  (zipWith restrictMap) <$> kern <*>
    +  (fromKern concat >>>
    +   PopPrim (PrimRecordsBy tableDef fieldDef opts) >>> fromKern repeat)
    +  where
    +    restrictMap keys = Map.filterWithKey (isKey keys)
    +    isKey keys key _ = key `elem` keys
    +popMany PopId = PopId
    +popMany (PopAbort err) = (PopAbort err)
    +popMany (PopPure a)
    +  -- Important: Even though lists are ZipLists in the context of popMany, it is
    +  -- important that the popMany version of pure actual examines its input and
    +  -- produces the correct number of outputs. Using `repeat` here can produce
    +  -- a list of infinite results for a finite input list, which can then ultimately
    +  -- create an infinite loop when zipped without non-finite lists. Instead of
    +  -- using `repeat` here we use `map` to product *exactly a many as* as there are
    +  -- input values.
    + = PopLift (PoppedValue . map (const a))
    +popMany (PopLift f) =
    +  PopLift $ \inputs ->
    +    let poppeds = map f inputs
    +        extract (PoppedValue b) (PoppedValue bs) = PoppedValue (b : bs)
    +        extract _ (PoppedError err) = PoppedError err
    +        extract (PoppedError err) _ = PoppedError err
    +     in foldr extract (PoppedValue []) poppeds
    +popMany (PopMap f popper) = PopMap (fmap f) (popMany popper)
    +popMany (PopApply fPopper aPopper) =
    +  getZipList <$>
    +  PopApply
    +    (fmap (<*>) (ZipList <$> popMany fPopper))
    +    (ZipList <$> popMany aPopper)
    +popMany (PopChain bPopper aPopper) =
    +  PopChain (popMany bPopper) (popMany aPopper)
    +popMany (PopArrowFirst popper) =
    +  fromKern unzip >>> first (popMany popper) >>> fromKern (uncurry zip)
    +popMany (PopArrowLeft popper) =
    +  rebuildList <$> kern <*> (fromKern lefts >>> popMany popper)
    +  where
    +    rebuildList [] _ = []
    +    rebuildList (Left _:_) [] = [] -- shouldn't happen?
    +    rebuildList (Right c:eacs) bs = Right c : rebuildList eacs bs
    +    rebuildList (Left _:eacs) (b:bs) = Left b : rebuildList eacs bs
    +popMany (PopMaybe singlePopper) =
    +  rebuildList <$> kern <*> (fromKern catMaybes >>> popMany singlePopper)
    +  where
    +    rebuildList [] _ = []
    +    rebuildList (Just _:_) [] = [] -- shouldn't happen?
    +    rebuildList (Nothing:as) bs = Nothing : rebuildList as bs
    +    rebuildList (Just _:as) (b:bs) = Just b : rebuildList as bs
    +popMany (PopPrim (PrimQuery explanation orm))
    +  -- the orm query here doesn't depend on the Popper input,
    +  -- so we can run it once and then construct an infinite
    +  -- list of the results to be lined up as the outputs for
    +  -- each input in the list
    +  --
    +  -- ('repeat' is 'pure' since lists here are zipped)
    +  --
    + = PopPrim (PrimQuery explanation (repeat <$> orm))
    +
    +-- Manually specifies the many handling of a popper. The original popper
    +-- is lift unchanged. If it becomes involved in a `popMany` operation, the
    +-- provided popper with be substituted for it, rather than apply the normal
    +-- popper re-write rules.
    +--
    +-- This is useful if either of the cases can manually optimized in a way that
    +-- is incompatible with the normal popping mechanisms
    +--
    +onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b
    +onPopMany = PopOnMany
    +
    +-- The Popper guts
    +data PopError
    +  = forall readEntity writeEntity key.
    +    MissingRecord (TableDefinition readEntity writeEntity key)
    +                  (PrimaryKey key)
    +                  key
    +
    +  | forall readEntity writeEntity key fieldValue nullability.
    +    MissingRecordBy (TableDefinition readEntity writeEntity key)
    +                    (FieldDefinition nullability fieldValue)
    +                    fieldValue
    +
    +  | Unpoppable String
    +
    +instance Show PopError where
    +  show (MissingRecord tableDef keyDef keyValue) =
    +    "MissingRecord: " ++ missingRecordMessage tableDef keyDef keyValue
    +
    +  show (MissingRecordBy tableDef fieldDef fieldValue) =
    +    "MissingRecord: " ++ missingRecordByMessage tableDef fieldDef fieldValue
    +
    +  show (Unpoppable msg) = "Unpoppable: " ++ msg
    +
    +missingRecordMessage ::
    +     TableDefinition readEntity writeEntity key
    +  -> PrimaryKey key
    +  -> key
    +  -> String
    +missingRecordMessage tableDef keyDef keyValue =
    +  concat
    +    [ "Unable to find "
    +    , tableName tableDef
    +    , " with "
    +    , primaryKeyDescription keyDef
    +    , " = "
    +    , show (primaryKeyToSql keyDef keyValue)
    +    ]
    +
    +missingRecordByMessage ::
    +     TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> fieldValue
    +  -> String
    +missingRecordByMessage tableDef fieldDef fieldValue =
    +  concat
    +    [ "Unable to find "
    +    , tableName tableDef
    +    , " with "
    +    , fieldName fieldDef
    +    , " = "
    +    , show (fieldToSqlValue fieldDef fieldValue)
    +    ]
    +
    +instance Exception PopError
    +
    +data Popped a
    +  = PoppedValue a
    +  | PoppedError PopError
    +
    +instance Functor Popped where
    +  fmap f (PoppedValue a) = PoppedValue (f a)
    +  fmap _ (PoppedError err) = PoppedError err
    +
    +instance Applicative Popped where
    +  pure = PoppedValue
    +  (PoppedValue f) <*> (PoppedValue a) = PoppedValue (f a)
    +  (PoppedError err) <*> _ = PoppedError err
    +  _ <*> (PoppedError err) = PoppedError err
    +
    +-- Prim GADT. This defines the core database operations that can be performed
    +-- as part of popping.
    +--
    +data Prim a b
    +  -- The trivial primitive
    +      where
    +  PrimQuery
    +    :: String
    +    -> (forall conn m. MonadOrville conn m =>
    +                         m b)
    +    -> Prim a b
    +  -- The singlar primitives
    +  PrimRecordBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim fieldValue (Maybe readEntity)
    +  PrimRecordManyBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim fieldValue [readEntity]
    +  --  The many primitives (each of these is a fixed point -- its own many)
    +  PrimRecordsBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim [fieldValue] (Map.Map fieldValue readEntity)
    +  PrimRecordsManyBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim [fieldValue] (Map.Map fieldValue [readEntity])
    +
    +-- Popper GADT. This defines the popper expression dsl
    +-- that is used internally to represent poppers. These
    +-- constructors are not exposed, so they can be changed
    +-- freely as long as the exported API is stable.
    +--
    +data Popper a b where
    +  PopPrim :: Prim a b -> Popper a b
    +  PopId :: Popper a a
    +  PopPure :: b -> Popper a b
    +  PopLift :: (a -> Popped b) -> Popper a b
    +  PopAbort :: PopError -> Popper a b
    +  PopMap :: (b -> c) -> Popper a b -> Popper a c
    +  PopApply :: Popper a (b -> c) -> Popper a b -> Popper a c
    +  PopChain :: Popper b c -> Popper a b -> Popper a c
    +  PopArrowFirst :: Popper a b -> Popper (a, c) (b, c)
    +  PopArrowLeft :: Popper a b -> Popper (Either a c) (Either b c)
    +  PopOnMany :: Popper a b -> Popper [a] [b] -> Popper a b
    +  PopMaybe :: Popper a b -> Popper (Maybe a) (Maybe b)
    +
    +instance Functor (Popper a) where
    +  fmap = PopMap
    +
    +instance Applicative (Popper a) where
    +  pure = PopPure
    +  (<*>) = PopApply
    +
    +instance Category Popper where
    +  id = PopId
    +  (.) = PopChain
    +
    +instance Arrow Popper where
    +  arr = fromKern
    +  first = PopArrowFirst
    +
    +instance ArrowChoice Popper where
    +  left = PopArrowLeft
    +
    +popThrow :: MonadOrville conn m => Popper a b -> a -> m b
    +popThrow popper a = do
    +  popped <- pop popper a
    +  case popped of
    +    PoppedValue b -> return b
    +    PoppedError e -> throwM e
    +
    +-- This is where the action happens. pop converts the
    +-- Popper DSL into Orville calls with the provided input
    +--
    +pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b)
    +pop popper a = runQueryCached $ popCached popper a
    +
    +popPrim ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => Prim a b
    +  -> a
    +  -> QueryCached m (Popped b)
    +popPrim (PrimQuery _ query) _ = PoppedValue <$> unsafeLift query
    +popPrim (PrimRecordBy tableDef fieldDef opts) recordId =
    +  PoppedValue <$>
    +  selectFirstCached tableDef (where_ (fieldDef .== recordId) <> opts)
    +popPrim (PrimRecordManyBy tableDef fieldDef opts) recordId =
    +  PoppedValue <$>
    +  selectCached tableDef (where_ (fieldDef .== recordId) <> opts)
    +popPrim (PrimRecordsBy tableDef fieldDef opts) recordIds =
    +  PoppedValue <$> Map.map head <$>
    +  findRecordsByCached
    +    tableDef
    +    fieldDef
    +    (where_ (fieldDef .<- recordIds) <> opts)
    +popPrim (PrimRecordsManyBy tableDef fieldDef opts) recordIds =
    +  PoppedValue <$>
    +  findRecordsByCached
    +    tableDef
    +    fieldDef
    +    (where_ (fieldDef .<- recordIds) <> opts)
    +
    +popCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => Popper a b
    +  -> a
    +  -> QueryCached m (Popped b)
    +popCached (PopOnMany singlePopper _) a = popCached singlePopper a
    +popCached (PopPrim prim) a = popPrim prim a
    +popCached (PopAbort err) _ = pure (PoppedError err)
    +popCached PopId a = pure (PoppedValue a)
    +popCached (PopPure a) _ = pure (PoppedValue a)
    +popCached (PopLift f) a = pure (f a)
    +popCached (PopMap f popper) a = fmap f <$> popCached popper a
    +popCached (PopApply fPopper bPopper) a =
    +  (fmap (<*>) (popCached fPopper a)) <*> popCached bPopper a
    +popCached (PopChain popperB popperA) a = do
    +  value <- popCached popperA a
    +  case value of
    +    PoppedError err -> pure (PoppedError err)
    +    PoppedValue b -> popCached popperB b
    +popCached (PopArrowFirst popper) (a, c) = do
    +  poppedB <- popCached popper a
    +  case poppedB of
    +    PoppedValue b -> return (PoppedValue (b, c))
    +    PoppedError err -> return (PoppedError err)
    +popCached (PopArrowLeft popper) ac = do
    +  case ac of
    +    Left a -> fmap Left <$> popCached popper a
    +    Right c -> pure (PoppedValue (Right c))
    +popCached (PopMaybe popper) a =
    +  case a of
    +    Nothing -> pure (PoppedValue Nothing)
    +    Just val -> fmap Just <$> popCached popper val
    +
    +explain :: Popper a b -> String
    +explain = unlines . explainLines
    +
    +explainLines :: Popper a b -> [String]
    +explainLines subject =
    +  case subject of
    +    PopPrim prim -> explainLinesPrim prim
    +    PopId -> []
    +    PopPure _ -> []
    +    PopLift _ -> []
    +    PopAbort _ -> []
    +    PopMap _ popper -> explainLines popper
    +    -- Note the argument order to PopApply in comparison to PopChain below
    +    PopApply popperA popperB -> explainLines popperA ++ explainLines popperB
    +    -- Note the argument order to PopApply in comparison to PopApply above
    +    PopChain popperB popperA -> explainLines popperA ++ explainLines popperB
    +    PopArrowFirst popper -> explainLines popper
    +    PopArrowLeft popper -> explainLines popper
    +    PopOnMany singlePopper _
    +      -- If a `PopOnMany` is left in the tree at the time of execution, it
    +      -- always represents a single pop. Other `popMany` would have removed
    +      -- it from the tree and replaced it with a direct reference to the many
    +      -- popper that it holds.
    +     -> explainLines singlePopper
    +    PopMaybe popper -> explainLines popper
    +
    +explainLinesPrim :: Prim a b -> [String]
    +explainLinesPrim prim =
    +  case prim of
    +    PrimQuery explanation _ -> [explanation]
    +    PrimRecordBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              ["fetch one", entity, "by one", field, explainSelectOpts opts]
    +          ]
    +    PrimRecordManyBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              ["fetch many", entity, "by one", field, explainSelectOpts opts]
    +          ]
    +    PrimRecordsBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              [ "fetch many"
    +              , entity
    +              , "by many"
    +              , field
    +              , "(1-1)"
    +              , explainSelectOpts opts
    +              ]
    +          ]
    +    PrimRecordsManyBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              [ "fetch many"
    +              , entity
    +              , "by many"
    +              , field
    +              , "(*-1)"
    +              , explainSelectOpts opts
    +              ]
    +          ]
    +
    +explainSelectOpts :: SelectOptions -> String
    +explainSelectOpts opts =
    +  let clause = selectOptClause opts
    +   in if any (/= ' ') clause
    +        then concat ["(", clause, "("]
    +        else ""
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html new file mode 100644 index 0000000..5a1eb1f --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html @@ -0,0 +1,94 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Raw
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Raw
    +  ( selectSql
    +  , selectSqlRows
    +  , decodeSqlRows
    +  , ResultSet
    +  , updateSql
    +  , withConnection
    +  , withTransaction
    +  , withCachedConnection
    +  ) where
    +
    +import Control.Exception (finally)
    +import Control.Monad
    +import Control.Monad.IO.Class
    +import Data.IORef
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Select
    +
    +selectSqlRows :: MonadOrville conn m => String -> [SqlValue] -> m ResultSet
    +selectSqlRows sql values = runSelect $ selectQueryRawRows sql values
    +
    +selectSql ::
    +     MonadOrville conn m
    +  => String
    +  -> [SqlValue]
    +  -> FromSql result
    +  -> m [result]
    +selectSql sql values builder = runSelect $ selectQueryRaw builder sql values
    +
    +updateSql :: MonadOrville conn m => String -> [SqlValue] -> m Integer
    +updateSql sql values =
    +  withConnection $ \conn -> do
    +    executingSql UpdateQuery sql $ do run conn sql values
    +
    +startTransaction :: ConnectionEnv conn -> ConnectionEnv conn
    +startTransaction c = c {ormTransactionOpen = True}
    +
    +{-|
    +  Migration Guide: @withCachedConnection@ has been renamed to @withConnection_@
    +
    +  Runs an action with a cached connection.
    +  Without using this, or wrapping calls in a transaction using `withTransaction`, successive
    +  calls to functions like `insertRecord` and `updateRecord` are *not* guaranteed to occur on the
    +  same connection.
    +-}
    +withCachedConnection :: MonadOrville conn m => m a -> m a
    +withCachedConnection action =
    +  withConnectionEnv (const action)
    +
    +{-|
    +  Migration Guide: @withTransaction@ retains the same name.
    +-}
    +withTransaction :: MonadOrville conn m => m a -> m a
    +withTransaction action =
    +  withConnectionEnv $ \connected ->
    +    if ormTransactionOpen connected
    +      then action
    +      else localOrvilleEnv
    +             (setConnectionEnv $ startTransaction connected)
    +             doTransaction
    +  where
    +    doTransaction =
    +      withConnection $ \conn -> do
    +        txnCallback <- ormEnvTransactionCallback <$> getOrvilleEnv
    +        committed <- liftIO $ newIORef False
    +        startTran <- startTransactionSQL
    +        let doAction = do
    +              liftIO $ do
    +                (executeRaw =<< prepare conn startTran)
    +                txnCallback TransactionStart
    +              value <- action
    +              liftIO $ do
    +                commit conn
    +                writeIORef committed True
    +                txnCallback TransactionCommit
    +              return value
    +        let rollbackUncommitted =
    +              liftIO $ do
    +                finished <- readIORef committed
    +                when (not finished) $ do
    +                  rollback conn
    +                  txnCallback TransactionRollback
    +        liftFinally finally doAction rollbackUncommitted
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html new file mode 100644 index 0000000..dcff32f --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html @@ -0,0 +1,71 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +'Database.Orville.PostgreSQL.ResourceT' provides 'ResourceT' instance of the Orville typeclasses for situations
    +where you might need it. In particular, if you are using the conduit library, you
    +may want to wrap 'ResourceT' around your normal monad stack, in which case you'll need
    +the 'MonadOrville' instance provided here to use 'selectConduit'.
    +
    +These instances are not included in the default exports for Orville because the required
    +either a 'MonadUnliftIO' or 'MonadBaseControl' instance of the monad underlying 'ResourceT',
    +depending on the version of 'ResourceT' you are using. For resource-1.1.10 and above you
    +must provide 'MonadUnliftIO' instance. For versions prior to 1.1.10 you must provide a
    +'MonadBaseControl' instance.
    +
    +This is required by 'MonadOrville' requires an instance to 'MonadBaseControl' to be defined.
    +The instance provided here can only use one lifting strategy, one we choose 'MonadUnliftIO'
    +wherever possible (both by our own opinion and because later versions of 'ResourceT' have
    +removed 'MonadBaseControl' support). 'MonadBaseControl' is used for versions of 'ResourceT'
    +before 'ResourceT' supported 'MonadUnliftIO'.
    +-}
    +{-# LANGUAGE CPP #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +
    +module Database.Orville.PostgreSQL.ResourceT
    +  (
    +  ) where
    +
    +import Control.Monad.Trans (lift)
    +import Control.Monad.Trans.Resource (ResourceT, transResourceT)
    +import qualified Database.Orville.PostgreSQL as O
    +--
    +#if MIN_VERSION_resourcet(1,1,10)
    +import Control.Monad.IO.Unlift (MonadUnliftIO)
    +import qualified Database.Orville.PostgreSQL.MonadUnliftIO as OULIO
    +#else
    +import Control.Monad.Trans.Control (MonadBaseControl)
    +import qualified Database.Orville.PostgreSQL.MonadBaseControl as OMBC
    +#endif
    +--
    +instance (Monad m, O.HasOrvilleContext conn m) =>
    +         O.HasOrvilleContext conn (ResourceT m) where
    +  getOrvilleEnv = lift O.getOrvilleEnv
    +  localOrvilleEnv modEnv = transResourceT (O.localOrvilleEnv modEnv)
    +--
    +#if MIN_VERSION_resourcet(1,1,10)
    +--
    +instance (O.MonadOrvilleControl m, MonadUnliftIO m) =>
    +         O.MonadOrvilleControl (ResourceT m) where
    +  liftWithConnection = OULIO.liftWithConnectionViaUnliftIO
    +  liftFinally = OULIO.liftFinallyViaUnliftIO
    +
    +instance (MonadUnliftIO m, O.MonadOrville conn m) =>
    +         O.MonadOrville conn (ResourceT m)
    +--
    +#else
    +--
    +instance (O.MonadOrvilleControl m, MonadBaseControl IO m) =>
    +         O.MonadOrvilleControl (ResourceT m) where
    +  liftWithConnection = OMBC.liftWithConnectionViaBaseControl
    +  liftFinally = OMBC.liftFinallyViaBaseControl
    +
    +instance (MonadBaseControl IO m, O.MonadOrville conn m) =>
    +         O.MonadOrville conn (ResourceT m)
    +--
    +#endif
    +
    +--
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html new file mode 100644 index 0000000..2a2634c --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html @@ -0,0 +1,44 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Select
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Select
    +  ( Select
    +  , selectQuery
    +  , selectQueryTable
    +  , selectQueryRows
    +  , selectQueryRaw
    +  , selectQueryRawRows
    +  , selectQueryColumns
    +  , selectField
    +  , FromClause
    +  , fromClauseRaw
    +  , fromClauseTableName
    +  , fromClauseTable
    +  , runSelect
    +  ) where
    +
    +import Control.Monad (void)
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.FromClause
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Select
    +
    +runSelect :: MonadOrville conn m => Select row -> m [row]
    +runSelect select = do
    +  rows <-
    +    withConnection $ \conn -> do
    +      executingSql SelectQuery sql $ do
    +        query <- prepare conn sql
    +        void $ execute query values
    +        fetchAllRowsAL' query
    +  decodeSqlRows builder rows
    +  where
    +    sql = selectSql select
    +    values = selectValues select
    +    builder = selectBuilder select
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html new file mode 100644 index 0000000..934f2a6 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html @@ -0,0 +1,21 @@ +
    module Database.Orville.PostgreSQL.Trigger
    +  ( insertTriggered
    +  , InsertTrigger(insertTriggers)
    +  , updateTriggered
    +  , UpdateTrigger(updateTriggers)
    +  , deleteTriggered
    +  , DeleteTrigger(deleteTriggers)
    +  , MonadTrigger(runTriggers)
    +  , OrvilleTriggerT
    +  , RecordedTriggers
    +  , committedTriggers
    +  , uncommittedTriggers
    +  , runOrvilleTriggerT
    +  , mapOrvilleTriggerT
    +  , liftOrville
    +  , askTriggers
    +  , clearTriggers
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Internal.Trigger
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html new file mode 100644 index 0000000..e6c1729 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html @@ -0,0 +1,17 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +See "Database.Orville.PostgreSQL.Core" for information about migrating to the
    +new LibPQ-based Orville.
    +
    +-}
    +module Database.Orville.PostgreSQL
    +  ( module Database.Orville.PostgreSQL.Core
    +  , module Database.Orville.PostgreSQL.Popper
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Core
    +import Database.Orville.PostgreSQL.Popper
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html b/docs/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html new file mode 100644 index 0000000..b8fcd68 --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html @@ -0,0 +1,51 @@ +
    {-# LANGUAGE CPP #-}
    +{-# LANGUAGE NoRebindableSyntax #-}
    +{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
    +module Paths_orville_postgresql_legacy (
    +    version,
    +    getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
    +    getDataFileName, getSysconfDir
    +  ) where
    +
    +import qualified Control.Exception as Exception
    +import Data.Version (Version(..))
    +import System.Environment (getEnv)
    +import Prelude
    +
    +#if defined(VERSION_base)
    +
    +#if MIN_VERSION_base(4,0,0)
    +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
    +#else
    +catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
    +#endif
    +
    +#else
    +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
    +#endif
    +catchIO = Exception.catch
    +
    +version :: Version
    +version = Version [0,9,0,1] []
    +bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
    +
    +bindir     = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/bin"
    +libdir     = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/lib/x86_64-linux-ghc-8.6.5/orville-postgresql-legacy-0.9.0.1-6h95xZctkqe4xM2K1EuWl8"
    +dynlibdir  = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/lib/x86_64-linux-ghc-8.6.5"
    +datadir    = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/share/x86_64-linux-ghc-8.6.5/orville-postgresql-legacy-0.9.0.1"
    +libexecdir = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/libexec/x86_64-linux-ghc-8.6.5/orville-postgresql-legacy-0.9.0.1"
    +sysconfdir = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/etc"
    +
    +getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
    +getBinDir = catchIO (getEnv "orville_postgresql_legacy_bindir") (\_ -> return bindir)
    +getLibDir = catchIO (getEnv "orville_postgresql_legacy_libdir") (\_ -> return libdir)
    +getDynLibDir = catchIO (getEnv "orville_postgresql_legacy_dynlibdir") (\_ -> return dynlibdir)
    +getDataDir = catchIO (getEnv "orville_postgresql_legacy_datadir") (\_ -> return datadir)
    +getLibexecDir = catchIO (getEnv "orville_postgresql_legacy_libexecdir") (\_ -> return libexecdir)
    +getSysconfDir = catchIO (getEnv "orville_postgresql_legacy_sysconfdir") (\_ -> return sysconfdir)
    +
    +getDataFileName :: FilePath -> IO FilePath
    +getDataFileName name = do
    +  dir <- getDataDir
    +  return (dir ++ "/" ++ name)
    +
    \ No newline at end of file diff --git a/docs/orville-postgresql-legacy-docs/src/highlight.js b/docs/orville-postgresql-legacy-docs/src/highlight.js new file mode 100644 index 0000000..1e903bd --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/highlight.js @@ -0,0 +1,27 @@ + +var highlight = function (on) { + return function () { + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + var that = links[i]; + + if (this.href != that.href) { + continue; + } + + if (on) { + that.classList.add("hover-highlight"); + } else { + that.classList.remove("hover-highlight"); + } + } + } +}; + +window.onload = function () { + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + links[i].onmouseover = highlight(true); + links[i].onmouseout = highlight(false); + } +}; diff --git a/docs/orville-postgresql-legacy-docs/src/style.css b/docs/orville-postgresql-legacy-docs/src/style.css new file mode 100644 index 0000000..e83dc5e --- /dev/null +++ b/docs/orville-postgresql-legacy-docs/src/style.css @@ -0,0 +1,55 @@ +body { + background-color: #fdf6e3; +} + +.hs-identifier { + color: #073642; +} + +.hs-identifier.hs-var { +} + +.hs-identifier.hs-type { + color: #5f5faf; +} + +.hs-keyword { + color: #af005f; +} + +.hs-string, .hs-char { + color: #cb4b16; +} + +.hs-number { + color: #268bd2; +} + +.hs-operator { + color: #d33682; +} + +.hs-glyph, .hs-special { + color: #dc322f; +} + +.hs-comment { + color: #8a8a8a; +} + +.hs-pragma { + color: #2aa198; +} + +.hs-cpp { + color: #859900; +} + +a:link, a:visited { + text-decoration: none; + border-bottom: 1px solid #eee8d5; +} + +a:hover, a.hover-highlight { + background-color: #eee8d5; +} diff --git a/docs/orville-postgresql-legacy-docs/synopsis.png b/docs/orville-postgresql-legacy-docs/synopsis.png new file mode 100644 index 0000000000000000000000000000000000000000..85fb86ec84907bcc86531dc82871948ff4d471fa GIT binary patch literal 11327 zcmV-FEWp!=P)4Tx0C)k_S!GyNTeqHT_l8Y(cXyX`gGi?cY`Qxn1VID|MJXwjPC)?)F$h6K zMMOd+6hs7sqbPzXbr*U(-*=zy-hcPcUC*=TdiNM(jyd-lv&OpsU|J&v2m2!^0SE{T z54F(O;E2!K(!rTCW z%wV;vdzf1QjBf#e&~gh74F>?Z4a=WLg$KhJ^$5nap>PLbJadS>e&h8+?D`9%QNL`g zEVKbYGXj7k5Q(8)0Fd#*a?VIMFW3*64geVHKzE-&0BG!BtmfuTbO(T`0Jaeg2nagF z{V*1E{Wm{e|AvV~*MEExiC+KU-~R=!2{)|c6Bg`GjQ;iG|FQ`1kAUCTuZtQk34#8{ z4r4(3g7#|{=Z@d+d#}7f!3C=>=26vx*jwA8>@MS>RG@Tt_zt3hie^T z_?0%9VUd=)Fos7I z^ghPh%Jy%YZ|)vCf6EaFPai$Q-!=$ppK!y&wrJs)bNdAuANB!m3n34Tfj{s75g-&U z1A!Pg3bcXF-=!Gv1VmU93G2duANT;{0JugFTqg*|oPXPC|A$2HS3NJd-hcPV3EW`Y zh=1Dr-5Mv{<{zIvz#Ybay&^Vcn^E_`qRfl{{bzYkp)4~$~NAx_VB;E z{?P)PU)DbV{Qi#~0H0@T9czDj06@6MNq8OrpdAz(9qQxd9nPr<&s+~tPQySqaZyfb zNh!%g_5YjeaLxMN*$sv_p;d%b#U$Wpz0Geb0U>E+EOsEQ;I!&= zNC6q(BFFWohy&t- zL?CHM5mJM6p`(xmWDmJOUQi$u0mVUQpbRJ*DuT+OI;a`C4fR4p&?xj8nuk`Puh35f z55*JWF{C0=8)=GkKzbrWk@3iMWInPS*@Wyu4kE{pbI3L14-^JPgW^Pq!Q<2bWsPz} zg`nb5nW!REEvg;Wj~YYGqt;RTXfiY_S_G|(HbmQ@z0gtU6m&ki8r_B-Ku@3-(OVb{ zh8`n;QNS2r>@mKWSWG773g!l;2Q!LUz-(f%SSG9pRuyZCC1S&|DcC~nb!<2G1$Gg; zjU&Zz;G}VSI0sxHE(w>9tH<5Py}&KucJP#VKD;vC6z`6Y#%JLx@m=^4{33pbgo;Ff zM3uyf#Fr$Iq=2M}WPoIbWP_BHl$%tE)ST3Z^fYM!=}po{r1PXd2-E~&f;PdC5J9*= zs3G(aUK2LR$jJD~G{_vt!pSa>)sa0QdqcKOPD3tEZbLrbsZB|wjHfK7yiNI%a+8XNN{Y&qDu61Js-9|yYMB~K%}=dM z?M|IcT|xbTdVvN>!$YG@<3@9arjllWW|0;{D?n>V>r0zK+erJ2cAbuzPL|Gw?j&6? z-95TFdL%tRy&=6neHMKS{UrTQ1~vvw1`mcbh9-s=4Br`97&RC@7}FVVFitT3Wa4Df zW%6UX#MHqw%Zy?cW;SPzV!p~ez`Vvn%c8>K#*)s`!ZO8*U=?PyV2x$1V13HE$;Qs6 z&lb#9$o7D3jh&udgWZ=sm;FBb3I`2`8ix-@E=M=VM@~9UO-_H#0?vNUbuLye1Fi_J zGOlM_JKO@?*4#+T3Fgmx>$N#hD=6JCPAiC=8LR|tcUDX*;jHjawc-Aa(!}p@(S{y z@=fw93cLy~3MC3J6=@aC6f+ecDWR3LloFKgD*aHFR}NQhQU0tVrsAhkud;kZ;E2bO z$|DP^+^R&?GSxXXPBj;`QnfjCE_I@Mx%xW|9u0SmYKzbdmB(*}d+O)oF zD{G(9?$JT&=D|u+DJZ zNWtioQNJ<4*wVPj_}x+AqoGH;Ob{kUCOIZE$M}u~9_ug#riP|Drn6=OW+7&G%rWL> z=Ede8ETk;rECwxUES)XuEw`++tg@`8tp%+ktov*zY#eRsY`)v-*k;?#*-6-)vU_6B zZ0}>=>40^xaj16KJg$2@@A#sloMVdPRon; zro?jMrmLZAiR-$Xw%cX5Rd)^dT=x|ZRgY|sB~Mk)Y|mvcRj(Yc6>oL#eD5_MZJ#2a zFTMu8*L=VGnflfE9r)Y&-w413xCGn|qz?28>kOxb4~I`91S8Hy%txw47DsMJ*+jLTq&gXR@@ceibXxRMj9yGtEGpJ5wl9t= zE-`NYl;)|jcqraAzAu3%Avt03wEpSZM3O|m#Ni~#r0k?`XKc@OC9@@;PF^^xf3_io zJS8;cWvWW*wR5O*KIfjL$)pvg?Wen^KhBWM$j{i#bjy5vUg~_o`GX6d7oKIwXI;IB zxfpnH@{;j<`HmaI~Pakhkz+;ck(4 z(L}LU@r@GJlC+ZVSKP0>xT6f*a^OxsWU@9UjK2+LN4pu2v z)m1ZBXH@Ui1lG*eTGaN}Db&@~v({%dAQ~bXR<1ijt)TYR@l+GyI++oAU8_Vo_$j=4_z&e7XOxBI$Oy4voD->JFFb+`B) z-My^)B=?i=A9TlbZ}tTDto3^JF7!F~O+T=EFy3$8|7^f`;L$_9hYtod2fH7sKDs-k zJaqf9;^U4d@=w~I$~|oxmK$z+CjYE`L}8@!xzh8l(IcbxU#P$69n%?mIBq!pWa8Mw z=%n@JtCx;1=U%zLT7K>S`pZ=0)Xwzj8T3s0Eahze8`d}FZ-w68n3JEoH?K4Q^qu9q z=>@li)%RiVcNddCkbTHs;#jI%mR`QQqPOz=CgGy+9whdp4g`BLCvp!8U&;uov(!a2t+bEnRv6HXyi9t`-YglcEo`$K zI8GTZXYLH1F5YE+b^&9-c%dfYc~N>X1MygiCdpZ8N*OKLV7W5+5rusvVP$KTgd_E; zV`@J%*flk^Jhjj1)aX9cTQC5ItVZ(2W=FkE;*aH-)|+*kk6SET?pjmWaNEk+>D${o z_#cmV%sNr-bj$gX%QW$m8{|&wA?SI;%go!uC))SCU%7vKz~jI-L0?1Ap^RZ7;i?hG zB3+__P9{WW#uUa@#oavB8Q+`m==5;nXwvwZiR6j1<0+%5!{;8Q^`_s>XwIxTUvlAM z)|rdpmprp=bM$iM@_6#8@((Vr7Q8HcP;{fXs3iGH;8nY8TBRaov}JqcixtC_ZBw07?YBCLI#1vB=rX<|d6)j~ z?!9;SA9XkN4rDD83J6N{$`!z{xG&lW}=KCd6md=WHe zF)la3F!5t@`sLkMS6?Sg5vR3gcxTbGOK%>(y*_twKH{Cjg64anMViI^4{J-a%g0=3|@n*5+(H4=G;Z`Bm z0XDw2UUnY#t`5ZG&WObDFO_)C zCe0{aEki1k_dNXt+=U-mA1_W_8p^(%Qj|@Mb z9sM+h7-yIepVWIvd=>Y)XzKR#)XeT1jH zI8-@&65hs?W6g0$Tn9b?K9MevmJ{6JljSOT6GbGYHWfM5G<6M41g#z&E8Qx6H$yI? z50eHn6Z1ODBi1suSavH8F-{EUJXaTYHjh8AJ|73)7XPq7gt>OirQ5IDz)!g7S$y<#pnvPn` zTCcP(>sag3>W=B<=vx}l7>pa{8`&AN7|$LpGx0noeC)GnyV)so9SefRgyl6WA8Q%w zeVfO&`F8I1(hk7k+3~B6fhW|RD4pIpx4EPekGo2^q1>k2n?25Xx_BviQ+coYJoGK~ zi}SY&kPV~?{2VkK+z^r;>Jw%VE)ao-y@)AN%A4?QY z!X(X~xtpASHaNvFl_z!g+(cSqdP;^mD`$^mG5`i zpn$&+Rk%>pUtCp^dd2Um*){o6wlZ|t=klqF!OHfk>gs};%-W>7nEHr@(CeX%5lwM7 zQg7xp*S7SwzHLLbOLn+*Uc0?`NAB*$d)wWCJsW)~{h|X4gV%@BpPU*_8L1qd8t0!( zdySmVd!st{bK%K{=9Rj&=Ffv)KX1|hFxkC)82{hg(&3(fkq6-NB>?O?0kGBtAd?QJ zm0$~|LIBLj0I*U5i1iA9XzK$|?dCuG2lOlFq=GX}9v}f{nuc(O=>uZH1yBw;!3bD_ zU{(i`gLA_m=mOLPjX+-zbO8W#QsA+O&>1m7Uxak_`<>>nu%o*kx!T2DqomQ{`*59GHMHWa@qZ7S~^!Kl)z@vEz7SZjuAWovinywxMoS2FN7 zEH|1t%4A}H?2754xrD_j%Moi{n>gE7_6iP##}7_;J59Lg5Ifz(-D^B~y{dc!eQ)?H z1`GsQ2d{)Cgfm98MOmHv9&;s5@6?xs(nO0hxa6LcxN|CLdl`M_GqP+i31t7w9nHU9 zkY40hVt!S*RG^%pl2DDR1@+)Ms)_U_Lks^c#r9*J-d)LeEAIFAEIl9{kQ}rbihXiz zxOZfJbZ?wtQtXx5l+ld&8>=~scSi5kK8P(dtn9DO{nh=s_)Emb(M`^+uiKA)7VrA) zEB#tO5ODlSVZM$P@WWh#2Fx+Iz|6u~m`%6|24UXdCqxG`1g0=2kOkd@#-Q&AR(P%P zMdTpvAy(jBM;jT2tUyk{D~~EF3{{U>K(nFk;T(JdLx-`&6l3PF0@xsI7Y>87!d2q7 z@J9GD{0|aKlAELyq`{in5#@A}YP&ZEYQ#XH-V)Gsvv6_^~14ao?j4lj=6k7|w9iW!UZJhhvUlPHq(FxfQ) zq?V>>q`%8dxgeZ1aw#H*HTOZjUjc35y<*QR6jwV-iRB~}tyPXS=-S45n}+?ysv9OZ zzqJ(K(rR1j$hs}xHG4PtzG(M&@2Lj@{VyISJQ5#z^W@U7{hV|l=i6Vte3RLV-yYuK+dKCw{z!laG%#N$3ABJM%p<0O zYA^skKqQbP%m$r-WBwLFh0ujLomRwONMWQ8vL5*f<`CmhgJ?Rm2f718hVj63W7)9r z*mpQXTq~XnpG|@xNg&xFjU_!Gq>|CVvs#J#1w}9=HDxE2J2egUAWZ`85!yYvKKcv> zJ4PYKJ*G+KW|m8=VQlv7TJY|}%00wyKDli~41a=UN19Bb{{JVSQ=?d&3H&&qviwE*<+| zre!9^?4cDF}{Txa*#Kx+jZQvyZXwvVVG@WYFu7)G)>HwaCho zPBE;pGpDX4cqED@Z6)`nTsY^LE}F4-ek7|Lj+#LpTmF}Vfuf?4z^j_2v}GSEI;v7@ ztn0YySFg7=Mcq_r{?^*qM(m*I?Cd&z=li|$-7G!jeOwO;25=992SX5MzsmCeV$vtN*Wk9q%cvGzm6 zlGZYQ`Nc~9M~79`)tR-DzwAEIeH!_EZe4SI`^$~5?i-97Prt=)N^Q<3ePg@o zht*Hi&(|HuI*eO3a z*sFk(4fq>KkN@xQ6^F(cm~$_2K14li9;XkV|9<@!M&f%8Nam8p00009a7bBm000XU z000XU0RWnu7ytkil}SWFRCodHT?u#;Rkr@KbUNvfeG_5`YY-wNfPp{+o{ADgGcxep z5O;8ydCWk3pWowCbe1RjK4lzy;4&jKqk}U-a1=+ud7z@;LLwlFC>S)v1jwFrI_XY2 zop;WyuIf%_F~x?x|CCgE~7q5lBOq0>MKUdH^|7ARquk zTn+*P5DlHMG@8ELxbaVWHf?&T znHpfF&E_pZ&^rD;1;7qozi0Q$(`V)7{8<+kI>wdbHk%E>!9AN2eO+^{$KB)hHtVU6 z4;0@%KYw`%{kM%aj|)L>`1``u*EM%B_Ep|f_7iHT~t6&rZsneaT;XVt##n z3*O&%0=#!k4Gq$@x_XoAC663)d$?Wm=UXTrha?_sgD)BZa!4dhf)W5g$)o+5f!@!6p= z7>#E6lGpa0z~7?)*juclePn!mT$U>W2F?VqT7?}(LqHHhL#3+DoNXk5_#Pb{(lwSP zZ<=X|iSbjYeFoatR`H}3=!RdX3qeSTbc>FTPC&5WKoW3vT<}n4p!jve)Qtntp05&Y$`N~L&mauhNrjZlt#E%Rdnz*4RdA(~WsS0P~4Cker*^h9K3rID79 zAhx!)2_f*-6tD+E@|~5o_HbR*DQEm#fix64W;xPOIEsuwz3>ej`Mg}wlx+M?%^s;7 zt7<_1|D+24j|zb6{d*Duo)R*nQ%A&N`m}UK6}Gim#oV|jr-^I5{&3u6Y!z0&JjK=N zf~iA{0UNr_&1RH*=FkdaRxmwXu@ih1pW6b!KwO1@&&hNBf0 z=VYU~zns|bF>|Ig{pE8Oi&e4q8Sf>;d>$HnJ*g4^2E{@!BWJXj|MK2>t{)#4iCiKM z_X3_Wd3!22SVWGECF_5t9Wx1ebdVe1IRabo*K&Me+mp(08G`jsI~A7O*rz=A?*I(Ym_y4*ZBHj<`2EIL z@XCfeuGtW8G6RGFlFM<@CjE-OtU#5a;0kB%yXw(N%<3n(~sBeG(H{~)Y9EAyo%kT#Rg2j zpdOnacnjrpoDswQL%S&=xD)LJZ^c?^7~tUKxVSW2U-+UJ`I8c2{Q|sd4FLUcTr-0M zaqMa26wFKpz7U~s3AlNV^qhrHMbm9<`9gTLcVV_VCkYcW$bp+1aV?*4j`n;5NQvl5P$NHC1)DVqF ze?14Uta}S5dTDmrRR#Fn;tPAZ>c6M&cw`%zt17X5(`x+mXPZPMYENh$xHA{IIn#Q& z^ zG}YF_5*3HIuofIEDMeLB1jc8M#;C+D(d52>)gx`#@~i9ZqkAV_+e~x*&R~QFvHtHw zX=O8P?QIyJ9Ss9*B|&g;0hMp z3Alm-uHb+xn7Ts16&!E{`__2XkJh+p1UhOAxPk+&;D9SQ;0g}7f`^~4p*Mp`Hum_uHM8Ep9TllPO>m-^Cs zpVwg1bK6i`-w1z*2vDs7WXVaJJHyU=rk@Vk3#W^iKzdl}7D4^3u#E2B8*>%rGlt8u z5=Bg)^vMF>N2OW-kTeo=C=#;#Uwg6hiz=At%UPznGuZL$9uX3jIcgXzEoL+}ne7De zePX!NLIZ__1sfvpaY5fTR( zUH5HKQ7-^w@TCk-ATqS$+;^2Y-9Yg{p~En8>~LcE&~OCN2SO-y!qgT7qsff0kWR!$ z^D81!lBm$TfXL;}=Y9YJK+SF{!{d*=}ZDsk}pA}{0WdF3_)n|T5 zFNK7P(SF;zrP#jx9qieE2>F-K@p;gyHGt(@rI_!hEt)McpP}lbFn3v=a0JCAI=-Ld z^HfmLKw}#PgVO)j-n&3BpR3@}{)WrPilHHGIK3w22T8R6=u<`rMwjnBh~jFy5zt}A zN81hv!KkMXNNPDnh1mq7H@>uwma1@k3;2!wtQCOj+9tn%uigkWBw{AL|5)BofhX2& zA+XZ302%fCsUzg9CimQPVv`f;C6O8|{n>ML#6sZcPqU_9DPe!$!>g7coyleK6R!5=0O9Kit+4(r(6 ziv6QJ8-P(X4Sa3SakRGjFIv?a0G4_jZD3}d!^RD-cH>&cq5?d2jrKkeAp_;!Ur#;& z9W7Y4e9epUX=T6m-g%gom8l&2YDT>Vpn#D2K2TLOYC9;D1)wkDRn>N#8T3J_^Lk0W z2GEDo5^3Wxdgdfd9w7&WOIUcVywJ$#^9sz{H)rNATQUdN%*}+3f?}K#TL)6Cfb&`3 z%&Qjw3IaWJ_$1z;4dDsM&%YQ~=42pUgopbkSWmW!9lu+5e2Bl(Hp~!=)psw#l#5d7 z<59t4!9`Er%bRtn7l4p3WRMY9&31sf7Q0{HC$^-K>G(;07G_Pk5PmWfQbk{$>nD;C z$aX+;iw(co_@<~Qn^p+B=a%_MiWA>XQ&sn1{z<(6(1#*dufHEF>#Fe8m!&8!F2%dw zHlg}-8UFYJZG<8tdn)d^eHPNC3G-m$^7_440RBMV3*u1l6Q_-MckXuK!rmQ$k)#dR$sG z@^U71!@qOSF|2)@pOpG;Qm+AE#NKTmpy<6aRJ-8I$ex7UR10>zRSMI&Dx4*+aC%oe z$>ksZdHCl3@33X-u5M#~!F>8s>bP;(@Z1iZ5DQ57E(pe>^RmdH=2Rkv1Y;;r0f4a|kUQI?AO7tZbEf zJ(*E203jiWBR5FKRnt*$=_L9l06hS)bRb+XpPQ(|6)W>G1u?i-W6WoCJgUlRkTWYJ9y;~2lKhQP~5|72z2_#^8q&npdI^OKWZnM4)jd~lxFIKK%PKOm(9u+`!IG4P>PAtq9@Rh0JE!{0DuH! zkK`y|6ZXDM&ju*fYcM2?dkd?0BQd?AvKl9=rI$l^%Bzo%82pwp_ z3!t@d`N^j}MPee&>2}gr!FRvB)4o^~UCPYDMfxiI>b@c+MsVI_ZG?n%#SdILF9)yD z8iBv~&32h6$j=)^`5;_--)1F7aK==Pycf`JwRRcIa&EjD`NGhX@h9M+TM4YCmA;oJ zrO3=nv3MeD1n(z%`&dZj&7(JU#eehVv~0XE^yJ%^arZ3+;^s6cinJi_LRv*8MlRsh z{Xp^er2%-zvwii|iPQND<~cxwB;)S&_u$&{D%8_7aQMh%>8YP30yAe!z=De>;j*0J zN>6b7(K|VAAJyy)=J$-BZpMp7n5{I{+sN@1<}jm{UYm<6az zC)2KLBDKeY!To$ha&qG2BZqfAotPNM^BbQ^H8u4$*;5z(vZ|_v=c1LgH4&aJ8cR)s zhZ25=_;#ffO9d0sLd30K^&jiDoI6+3R|Htse-FYDw`bL=buUu;*yY6jR@v$9iMtOO z{Jm)a77X@ba%$f%7edh>l!!{woQDqvAyLn?wOiY*$B%zo zv32X~pEWczvH$rLZ56cfy6vr`0a$epDA9d}4E`PkfT>4BU?%e$j!CrfB%e1P1~}M{ zuQ8DZRRHLI>|J6XE5CNbPoY`u^Tv~L_DESt0J@K9biv&;RPgs@1TwMtC4bqg&n_U& z^RqpU@fmCZV8(Krcxd8Db|Y=v9v+%_sqO*ye5%7a4GH|cY5=AL^#T?U?(IAraOf}Z znfd(s?_l?Sx}{(;kM%5!ES&ry9?r8?uz9NYQ(Ynr1^j&q08@d8z|&jaWMSaE-1`Sx z2*lKk?$1KN8*2mJGw(g3`l+riN$dE3Q~;P7LCd=wx?7hW&8J3pu z_e%g|LIn2Oqk!C_wTCQ#s9zKa2tdEcq}@UR0njdQ`-LnZ0R1A9b_)drK)bx{7qWl= z^ovZ|Eff#{?eex?$N~b;FEVMjP(T2*%iDe-`+v|7m{y$1dn*6{002ovPDHLkV1lnB B5rhB$ literal 0 HcmV?d00001 diff --git a/docs/tutorials/getting-started.html b/docs/tutorials/getting-started.html new file mode 100644 index 0000000..e69b36e --- /dev/null +++ b/docs/tutorials/getting-started.html @@ -0,0 +1,164 @@ + + + + + + + Orville - Getting Started + + + + +
    +
    +

    + + Orville Logo + +

    +
    + + + +
    + Site proudly generated by + Hakyll +
    +
    + +
    +

    Getting Started

    +
    +
    +

    Orville is a PostgreSQL client library, so it needs a working PostgreSQL server +to work. This tutorial assumes that PostgreSQL in running on localhost, +listening on port 5432 and that the user postgres exists with password +postgres.

    +

    Orville itself depends on the native LibPQ library being installed to +communicate with the server, so we need to install it before building +everything. If you’re on Debian-like distribution that uses apt, this command +will do that.

    +
    +shell +
    +
    apt update
    +apt install -y libpq-dev
    +
    +

    With that setup out of the way, let’s make a new project for this demo:

    +
    +shell +
    +
    mkdir orville-getting-started
    +cd orville-getting-started
    +stack new orville-getting-started --bare simple --resolver lts-21.19
    +
    +

    Now we need to edit stack.yaml and add orville-postgresql as an extra-dep.

    +
    +stack.yaml : diff +
    +
    42c42,43
    +< # extra-deps: []
    +---
    +> extra-deps:
    +>  - orville-postgresql-1.0.0.0
    +

    Next, edit the orville-getting-started.cabal file to make it depend on +Orville.

    +
    +orville-getting-started.cabal : diff +
    +
    22c22
    +<   build-depends:       base >= 4.7 && < 5
    +---
    +>   build-depends:       base >= 4.7 && < 5, orville-postgresql ^>= 1.0.0.0
    +

    Here is a minimal program that simply computes 1+1 on the database. Replace +the src/Main.hs with it.

    +
    +src/Main.hs : haskell +
    +
    module Main
    +  ( main
    +  ) where
    +
    +import qualified Orville.PostgreSQL as O
    +import qualified Orville.PostgreSQL.Execution as Execution
    +import qualified Orville.PostgreSQL.Raw.Connection as Connection
    +import qualified Orville.PostgreSQL.Raw.RawSql as RawSql
    +import qualified Orville.PostgreSQL.Raw.SqlValue as SqlValue
    +
    +main :: IO ()
    +main = do
    +  pool <-
    +    O.createConnectionPool
    +        O.ConnectionOptions
    +          { O.connectionString = "host=localhost user=postgres password=postgres"
    +          , O.connectionNoticeReporting = O.DisableNoticeReporting
    +          , O.connectionPoolStripes = O.OneStripePerCapability
    +          , O.connectionPoolLingerTime = 10
    +          , O.connectionPoolMaxConnections = O.MaxConnectionsPerStripe 1
    +          }
    +
    +  Connection.withPoolConnection pool $ \connection -> do
    +    result <- RawSql.execute connection (RawSql.fromString "SELECT 1+1")
    +    [[(_, sqlValue)]] <- Execution.readRows result
    +    print (SqlValue.toInt sqlValue)
    +

    All that’s left is to build the executable and run it. When it runs it will +connect to the PostgreSQL server, run the SQL to calculate 1 + 1 and then +print the result out.

    +
    +shell +
    +
    stack build
    +stack exec orville-getting-started
    +
    +

    This is the output you will see in the console if everything went as planned:

    +
    +output : plaintext +
    +
    Right 2
    +
    +
    + +
    + + diff --git a/docs/tutorials/using-json.html b/docs/tutorials/using-json.html new file mode 100644 index 0000000..abd3152 --- /dev/null +++ b/docs/tutorials/using-json.html @@ -0,0 +1,266 @@ + + + + + + + Orville - Using JSON + + + + +
    +
    +

    + + Orville Logo + +

    +
    + + + +
    + Site proudly generated by + Hakyll +
    +
    + +
    +

    Using JSON

    +
    +
    +

    You’ll need a Haskell project named using-json for this tutorial. +The setup is identical to the setup in Getting Started +aside from the package name, so we’ll avoid explaining it again here.

    +

    SQL has a rigid schema. Using JSON inside SQL allows for pockets of schemaless +data, that is still queryable using PostgreSQL’s built-in functionality.

    +

    This document explains how to use Orville with the JSONB data type that +PostgreSQL natively supports.

    +

    Project initialization is similar to previous tutorials, but additional +dependencies like Aeson have been added. Aeson is a JSON library for Haskell.

    +

    Here’s the beginning of our src/Main.hs file.

    +
    +src/Main.hs : haskell +
    +
    module Main
    +  ( main
    +  ) where
    +
    +import qualified Orville.PostgreSQL as O
    +import qualified Orville.PostgreSQL.AutoMigration as AutoMigration
    +import qualified Orville.PostgreSQL.Marshall as Marshall
    +import qualified Orville.PostgreSQL.Raw.RawSql as RawSql
    +
    +import           Control.Monad.IO.Class (MonadIO(liftIO))
    +import           Data.Aeson (Value, eitherDecodeStrict')
    +import           Data.Aeson.Text (encodeToLazyText)
    +import qualified Data.Aeson as Aeson
    +import qualified Data.Int as Int
    +import qualified Data.Text as T
    +import qualified Data.Text.Encoding as Enc
    +import qualified Data.Text.Lazy as LazyText
    +import qualified Data.Vector as Vector
    +
    +

    Let’s suppose we have an example entity with an ID, and some arbitrary JSON +data in a column called ‘tags’.

    +

    Note how fooTagsField below uses the Value type from the Aeson library.

    +

    Remember that the Value contains its own Null constructor, which is +distinct from SQL’s NULL. So we can have JSON nulls in this field, but no SQL +nulls.

    +

    We could also use a custom type with FromJSON/ToJSON instances, since +jsonb allows for that too. Aeson is not the focus of this document though.

    +
    +src/Main.hs : haskell +
    +
    data Foo = Foo
    +  { fooId :: Int.Int32
    +  , fooTags :: Value
    +  }
    +  deriving Show
    +
    +fooIdField :: O.FieldDefinition O.NotNull Int.Int32
    +fooIdField =
    +  O.integerField "id"
    +
    +fooTagsField :: O.FieldDefinition O.NotNull Value
    +fooTagsField =
    +  aesonValueField "tags"
    +
    +

    Before we can define the corresponding SqlMarshaller, we’ll need to define the +aesonValueField helper function. This is done tryConvertSqlType along with +jsonb field to apply Aeson encoding and decode.

    +
    +src/Main.hs : haskell +
    +
    aesonValueField :: String -> O.FieldDefinition O.NotNull Value
    +aesonValueField name =
    +  O.convertField
    +    (O.tryConvertSqlType encodeJSON decodeJSON)
    +    (O.jsonbField name)
    +
    +decodeJSON :: T.Text -> Either String Value
    +decodeJSON =
    +  eitherDecodeStrict' . Enc.encodeUtf8
    +
    +encodeJSON :: Value -> T.Text
    +encodeJSON =
    +  LazyText.toStrict . encodeToLazyText
    +
    +

    Let’s define the SqlMarshaller and the table. This is standard stuff, no +surprises here.

    +
    +src/Main.hs : haskell +
    +
    fooMarshaller :: O.SqlMarshaller Foo Foo
    +fooMarshaller =
    +  Foo
    +    <$> O.marshallField fooId fooIdField
    +    <*> O.marshallField fooTags fooTagsField
    +
    +table :: O.TableDefinition (O.HasKey Int.Int32) Foo Foo
    +table =
    +  O.mkTableDefinition "json_demo" (O.primaryKey fooIdField) fooMarshaller
    +
    +

    With all definitions done, we can write main. Orville will also use the parts +of the SqlType during migration.

    +
    +src/Main.hs : haskell +
    +
    main :: IO ()
    +main = do
    +  pool <-
    +    O.createConnectionPool
    +        O.ConnectionOptions
    +          { O.connectionString = "host=localhost user=postgres password=postgres"
    +          , O.connectionNoticeReporting = O.DisableNoticeReporting
    +          , O.connectionPoolStripes = O.OneStripePerCapability
    +          , O.connectionPoolLingerTime = 10
    +          , O.connectionPoolMaxConnections = O.MaxConnectionsPerStripe 1
    +          }
    +
    +  O.runOrville pool $ do
    +    AutoMigration.autoMigrateSchema AutoMigration.defaultOptions [ AutoMigration.SchemaTable table ]
    +    _ <- O.deleteEntity table 0
    +
    +

    We’ll construct a JSON value using the Aeson library, which makes this look +fairly verbose. But imagine that the Array value below was read from a file, +or received over HTTP from a web browser.

    +
    +src/Main.hs : haskell +
    +
        _ <- O.insertEntity table Foo { fooId = 0
    +                                  , fooTags = Aeson.Array $ Vector.fromList
    +                                      [ Aeson.Number 1
    +                                      , Aeson.Number 2
    +                                      , Aeson.Number 3
    +                                      ]
    +                                  }
    +    liftIO . print =<< O.findEntity table 0
    +
    +

    Using raw SQL, we can use PostgreSQL’s built-in JSONB functions. Let’s suppose +we want a row returned for each of the values in the Array above.

    + + + + + + + + + + + + + + + + + + + + + +
    IDTag
    01
    02
    03
    +

    We can use an SqlMarshaller to produce a result like this, even though there +is no table for the returned schema. The programmer must ensure correspondence +of the SQL and the SqlMarshaller. If they don’t match, an exception will be +thrown.

    +

    We’ll have the SqlMarshaller work with tuples and marshallReadOnlyFields. +These allow for succintly defining a quick one-off SqlMarshaller.

    +
    +src/Main.hs : haskell +
    +
        let
    +      marshaller :: O.SqlMarshaller w (Int.Int32, Value)
    +      marshaller =
    +        (,) <$> O.marshallReadOnlyField fooIdField
    +            <*> O.marshallReadOnlyField (aesonValueField "tag")
    +    readEntities <-
    +      O.executeAndDecode
    +        O.SelectQuery
    +        (RawSql.fromString "SELECT id, jsonb_array_elements(tags) AS tag FROM json_demo")
    +        (Marshall.annotateSqlMarshallerEmptyAnnotation marshaller)
    +    liftIO $ print readEntities
    +
    +

    Program output and test

    +

    This concludes this tutorial. You can build an execute this as usual:

    +
    +shell +
    +
    stack build
    +stack exec using-json
    +
    +

    And you should see the following output:

    +
    +output : plaintext +
    +
    Just (Foo {fooId = 0, fooTags = Array [Number 1.0,Number 2.0,Number 3.0]})
    +[(0,Number 1.0),(0,Number 2.0),(0,Number 3.0)]
    +
    +
    + +
    + + diff --git a/docs/tutorials/using-migrations.html b/docs/tutorials/using-migrations.html new file mode 100644 index 0000000..b3eede8 --- /dev/null +++ b/docs/tutorials/using-migrations.html @@ -0,0 +1,222 @@ + + + + + + + Orville - Using Migrations + + + + +
    +
    +

    + + Orville Logo + +

    +
    + + + +
    + Site proudly generated by + Hakyll +
    +
    + +
    +

    Using Migrations

    +
    +
    +

    Adding a new non-nullable column

    +

    We’ll show how, to add a new non-nullable column:

    +
      +
    1. first, we create the initial version of the table without the ‘new’ column
    2. +
    3. we then add the column, but only as nullable
    4. +
    5. we make sure all values are present on the nullable column
    6. +
    7. we then migrate the column to be non-nullable
    8. +
    +

    You’ll need a Haskell project named using-migrations for this tutorial. +The setup is identical to the setup in Getting Started +aside from the package name, so we’ll avoid explaining it again here. Instead +we’ll get straight on creating our src/Main.hs file.

    +
    +src/Main.hs : haskell +
    +
    module Main
    +  ( main
    +  ) where
    +
    +import qualified Orville.PostgreSQL as O
    +import qualified Orville.PostgreSQL.AutoMigration as AutoMigration
    +import qualified Orville.PostgreSQL.Raw.RawSql as RawSql
    +
    +import           Control.Monad.IO.Class (MonadIO(liftIO))
    +import qualified Data.Int as Int
    +
    +data Foo1 = Foo1
    +  { foo1Id :: Int.Int32
    +  }
    +  deriving Show
    +
    +data Foo2 = Foo2
    +  { foo2Id :: Int.Int32
    +  , foo2Age :: Maybe Int.Int32
    +  }
    +  deriving Show
    +
    +data Foo3 = Foo3
    +  { foo3Id :: Int.Int32
    +  , foo3Age :: Int.Int32
    +  }
    +  deriving Show
    +
    +fooIdField :: O.FieldDefinition O.NotNull Int.Int32
    +fooIdField =
    +  O.integerField "id"
    +
    +fooAgeField :: O.FieldDefinition O.NotNull Int.Int32
    +fooAgeField =
    +  O.integerField "age"
    +
    +foo1Marshaller :: O.SqlMarshaller Foo1 Foo1
    +foo1Marshaller =
    +  Foo1
    +    <$> O.marshallField foo1Id fooIdField
    +
    +foo2Marshaller :: O.SqlMarshaller Foo2 Foo2
    +foo2Marshaller =
    +  Foo2
    +    <$> O.marshallField foo2Id fooIdField
    +    <*> O.marshallField foo2Age (O.nullableField fooAgeField)
    +
    +foo3Marshaller :: O.SqlMarshaller Foo3 Foo3
    +foo3Marshaller =
    +  Foo3
    +    <$> O.marshallField foo3Id fooIdField
    +    <*> O.marshallField foo3Age fooAgeField
    +
    +

    Note how the following tables have the same SQL table names. Imagine that +table1 is the initial version of the table, which then is changed to +table2, and so on. In practice, they can keep their Haskell names, since they +won’t need to co-exist, like they do in this document.

    +

    Orville’s AutoMigration tool sees that the difference between the tables is, +that the second table has an additional column, and it will generate and +execute the DDL to add the column. It needs to be nullable, because the database won’t +have any values for it when it is added.

    +
    +src/Main.hs : haskell +
    +
    table1 :: O.TableDefinition (O.HasKey Int.Int32) Foo1 Foo1
    +table1 =
    +  O.mkTableDefinition "migration_demo1" (O.primaryKey fooIdField) foo1Marshaller
    +
    +table2 :: O.TableDefinition (O.HasKey Int.Int32) Foo2 Foo2
    +table2 =
    +  O.mkTableDefinition "migration_demo1" (O.primaryKey fooIdField) foo2Marshaller
    +
    +table3 :: O.TableDefinition (O.HasKey Int.Int32) Foo3 Foo3
    +table3 =
    +  O.mkTableDefinition "migration_demo1" (O.primaryKey fooIdField) foo3Marshaller
    +
    +

    Now let’s add a main function invokes Orville’s auto-migration tool to +demonstrate making changes to the table.

    +
    +src/Main.hs : haskell +
    +
    main :: IO ()
    +main = do
    +  pool <-
    +    O.createConnectionPool
    +        O.ConnectionOptions
    +          { O.connectionString = "host=localhost user=postgres password=postgres"
    +          , O.connectionNoticeReporting = O.DisableNoticeReporting
    +          , O.connectionPoolStripes = O.OneStripePerCapability
    +          , O.connectionPoolLingerTime = 10
    +          , O.connectionPoolMaxConnections = O.MaxConnectionsPerStripe 1
    +          }
    +
    +  O.runOrville pool $ do
    +    O.executeVoid O.DDLQuery (RawSql.fromString "DROP TABLE IF EXISTS migration_demo1")
    +    AutoMigration.autoMigrateSchema AutoMigration.defaultOptions [ AutoMigration.SchemaTable table1 ]
    +    _ <- O.insertEntity table1 Foo1 { foo1Id = 0 }
    +    AutoMigration.autoMigrateSchema AutoMigration.defaultOptions [ AutoMigration.SchemaTable table2 ]
    +    _ <- O.updateEntity table2 0 Foo2 { foo2Id = 0, foo2Age = Just 91 }
    +    AutoMigration.autoMigrateSchema AutoMigration.defaultOptions [ AutoMigration.SchemaTable table3 ]
    +    liftIO . print =<< O.findEntity table3 0
    +
    +

    Dropping a column

    +

    Orville won’t automatically drop a column in the SQL database that isn’t in the SqlMarshaller. +The column will just be ignored.

    +

    We have to tell Orville explicitly about the columns that are safe to drop. +This is done using the dropColumns combinator. Add this to the bottom of the +main function:

    +
    +src/Main.hs : haskell +
    +
        AutoMigration.autoMigrateSchema AutoMigration.defaultOptions [ AutoMigration.SchemaTable $ O.dropColumns ["age"] table1 ]
    +    liftIO . print =<< O.findEntity table1 0
    +
    +

    Conclusion

    +

    This concludes this tutorial. You can build an execute this as usual:

    +
    +shell +
    +
    stack build
    +stack exec using-migrations
    +
    +

    And you should see the following output:

    +
    +output : plaintext +
    +
    Just (Foo3 {foo3Id = 0, foo3Age = 91})
    +Just (Foo1 {foo1Id = 0})
    +
    +
    + +
    + + diff --git a/docs/tutorials/using-plans.html b/docs/tutorials/using-plans.html new file mode 100644 index 0000000..d4a6485 --- /dev/null +++ b/docs/tutorials/using-plans.html @@ -0,0 +1,372 @@ + + + + + + + Orville - Using Plans + + + + +
    +
    +

    + + Orville Logo + +

    +
    + + + +
    + Site proudly generated by + Hakyll +
    +
    + +
    +

    Using Plans

    +
    +
    +

    You’ll need a Haskell project named using-plans for this tutorial. +The setup is identical to the setup in Getting Started +aside from the package name, so we’ll avoid explaining it again here.

    +

    This example shows Plans. A Plan contains one or more SQL select statements, +and when the first is run, its result is passed into the next.

    +

    The goal of plans is to prevent n+1 +queries, +while still allowing a plan for a single item to be modified to execute against +many items.

    +

    The code contains a detailed description, this document will just focus on +examples.

    +

    This example has a table with students, and a table with classes they can take.

    +

    Because multiple students can be enrolled in multiple classes, it is a +many-to-many relationship, which can be modelled with a separate table with two +foreign keys on it.

    +

    These tables are defined in a manner similar to previous tutorials. Note the +foreign keys on the student_class table. Begin your src/Main.hs like this:

    +
    +src/Main.hs : haskell +
    +
    module Main
    +  ( main
    +  ) where
    +
    +import qualified Orville.PostgreSQL as O
    +import qualified Orville.PostgreSQL.AutoMigration as AutoMigration
    +import qualified Orville.PostgreSQL.Plan as Plan
    +
    +import           Data.List (sort)
    +import           Data.List.NonEmpty (NonEmpty((:|)))
    +import qualified Data.Int as Int
    +import qualified Data.Text as T
    +
    +-------------
    +-- Student --
    +-------------
    +
    +type StudentId = Int.Int32
    +type StudentName = T.Text
    +type StudentAge = Int.Int32
    +
    +data Student = Student
    +  { studentId :: StudentId
    +  , studentName :: StudentName
    +  , studentAge :: StudentAge
    +  }
    +  deriving Show
    +
    +studentIdField :: O.FieldDefinition O.NotNull StudentId
    +studentIdField =
    +  O.integerField "id"
    +
    +studentNameField :: O.FieldDefinition O.NotNull StudentName
    +studentNameField =
    +  O.unboundedTextField "name"
    +
    +studentAgeField :: O.FieldDefinition O.NotNull StudentAge
    +studentAgeField =
    +  O.integerField "age"
    +
    +studentMarshaller :: O.SqlMarshaller Student Student
    +studentMarshaller =
    +  Student
    +    <$> O.marshallField studentId studentIdField
    +    <*> O.marshallField studentName studentNameField
    +    <*> O.marshallField studentAge studentAgeField
    +
    +studentTable :: O.TableDefinition (O.HasKey StudentId) Student Student
    +studentTable =
    +  O.mkTableDefinition "plan_demo_student" (O.primaryKey studentIdField) studentMarshaller
    +
    +----------------------------
    +-- Student to Class Table --
    +----------------------------
    +
    +studentClassIdField :: O.FieldDefinition O.NotNull Int.Int32
    +studentClassIdField =
    +  O.integerField "id"
    +
    +studentClassClassIdField :: O.FieldDefinition O.NotNull Int.Int32
    +studentClassClassIdField =
    +  O.integerField "class_id"
    +
    +studentClassStudentIdField :: O.FieldDefinition O.NotNull Int.Int32
    +studentClassStudentIdField =
    +  O.integerField "student_id"
    +
    +data StudentClass = StudentClass
    +  { studentClassId :: Int.Int32
    +  , studentClassClassId :: Int.Int32
    +  , studentClassStudentId :: Int.Int32
    +  }
    +
    +studentClassMarshaller :: O.SqlMarshaller StudentClass StudentClass
    +studentClassMarshaller =
    +  StudentClass
    +    <$> O.marshallField studentClassId studentClassIdField
    +    <*> O.marshallField studentClassClassId studentClassClassIdField
    +    <*> O.marshallField studentClassStudentId studentClassStudentIdField
    +
    +studentClassTable :: O.TableDefinition (O.HasKey Int.Int32) StudentClass StudentClass
    +studentClassTable =
    +  O.addTableConstraints
    +    [ O.foreignKeyConstraint (O.tableIdentifier classTable) $
    +        O.foreignReference (O.fieldName studentClassClassIdField) (O.fieldName classIdField) :| []
    +    , O.foreignKeyConstraint (O.tableIdentifier studentTable) $
    +        O.foreignReference (O.fieldName studentClassStudentIdField) (O.fieldName studentIdField) :| []
    +    ]
    +  $ O.mkTableDefinition "plan_demo_student_class" (O.primaryKey studentClassIdField) studentClassMarshaller
    +
    +-----------
    +-- Class --
    +-----------
    +
    +classIdField :: O.FieldDefinition O.NotNull Int.Int32
    +classIdField =
    +  O.integerField "id"
    +
    +classSubjectField :: O.FieldDefinition O.NotNull T.Text
    +classSubjectField =
    +  O.unboundedTextField "subject"
    +
    +data Class = Class
    +  { classId :: Int.Int32
    +  , classSubject :: T.Text
    +  }
    +  deriving (Show, Eq, Ord)
    +
    +classMarshaller :: O.SqlMarshaller Class Class
    +classMarshaller =
    +  Class
    +    <$> O.marshallField classId classIdField
    +    <*> O.marshallField classSubject classSubjectField
    +
    +classTable :: O.TableDefinition (O.HasKey Int.Int32) Class Class
    +classTable =
    +  O.mkTableDefinition "plan_demo_class" (O.primaryKey classIdField) classMarshaller
    +
    +

    The three tables are declared, we’ll proceed to the main function, which +ensures some sample data is available, and then queries it in different ways.

    +

    Since we have foreign key constraints, we have to create and delete the data in +an order that doesn’t violate these constraints. Orville will throw a Haskell +runtime exception upon execution of an SQL statement that violates a +constraint.

    +
    +src/Main.hs : haskell +
    +
    main :: IO ()
    +main = do
    +  pool <-
    +    O.createConnectionPool
    +        O.ConnectionOptions
    +          { O.connectionString = "host=localhost user=postgres password=postgres"
    +          , O.connectionNoticeReporting = O.DisableNoticeReporting
    +          , O.connectionPoolStripes = O.OneStripePerCapability
    +          , O.connectionPoolLingerTime = 10
    +          , O.connectionPoolMaxConnections = O.MaxConnectionsPerStripe 1
    +          }
    +
    +  O.runOrville pool $ do
    +    AutoMigration.autoMigrateSchema AutoMigration.defaultOptions [AutoMigration.SchemaTable studentTable, AutoMigration.SchemaTable classTable, AutoMigration.SchemaTable studentClassTable]
    +    _ <- O.deleteEntity studentClassTable 0
    +    _ <- O.deleteEntity studentClassTable 1
    +    _ <- O.deleteEntity studentClassTable 2
    +    _ <- O.deleteEntity classTable 0
    +    _ <- O.deleteEntity classTable 1
    +    _ <- O.deleteEntity classTable 2
    +    _ <- O.deleteEntity studentTable 0
    +    _ <- O.deleteEntity studentTable 1
    +    _ <- O.insertEntity studentTable Student { studentId = 0, studentName = T.pack "Name", studentAge = 91 }
    +    _ <- O.insertEntity studentTable Student { studentId = 1, studentName = T.pack "Other Name", studentAge = 42 }
    +    _ <- O.insertEntity classTable Class { classId = 0, classSubject = T.pack "Painting" }
    +    _ <- O.insertEntity classTable Class { classId = 1, classSubject = T.pack "Cooking" }
    +    _ <- O.insertEntity classTable Class { classId = 2, classSubject = T.pack "Swimming" }
    +    _ <- O.insertEntity studentClassTable $ StudentClass {studentClassId=0, studentClassClassId=0, studentClassStudentId=0}
    +    _ <- O.insertEntity studentClassTable $ StudentClass {studentClassId=1, studentClassClassId=2, studentClassStudentId=0}
    +    _ <- O.insertEntity studentClassTable $ StudentClass {studentClassId=2, studentClassClassId=1, studentClassStudentId=1}
    +    pure ()
    +
    +

    Now that the data is available, let’s first show off a simple plan which is +already more powerful than findEntity. findMaybeOne takes the table, and +the field to filter on, where as findEntity only works using the primary key.

    +

    The plan returned by findMaybeOne is like a parameterized query, it doesn’t +yet contain the actual value to filter for.

    +

    But upon execution, that value has to be provided, and it has to match the type +of the Plan. execute is in MonadOrville just like findEntity, so from here +on out, it is familiar territory.

    +
    +src/Main.hs : haskell +
    +
      print =<< O.runOrville pool (Plan.execute (Plan.findMaybeOne studentTable studentIdField) 0)
    +
    +

    Just to demonstrate that you can filter on other fields too, let’s search for a +specific student using their name. Note that Orville doesn’t have any +type-level checks for whether there is an index on the field.

    +
    +src/Main.hs : haskell +
    +
      print =<< O.runOrville pool (Plan.execute (Plan.findMaybeOne studentTable studentNameField) (T.pack "Other Name"))
    +
    +

    A plan that takes a single argument and returns a single argument can be passed +into planList to make it work on multiple values. Note how execute now +takes a list instead of just a single value.

    +
    +src/Main.hs : haskell +
    +
      print =<< O.runOrville pool (Plan.execute (Plan.planList (Plan.findMaybeOne studentTable studentNameField)) [T.pack "Other Name", T.pack "Name"])
    +
    +

    Remember how a plan is just a list of SQL statements. This can used in a way +similar to how JOIN is used in SQL.

    +

    The function chain is used to chain these statements together. After the +first statement is executed and its result has been sent to the client, Orville +allows for manipulating the value with focusParam before using it in a step.

    +

    For simplicity, we’ll use findOne here which is like findMaybeOne, but +throws exceptions when it fails to find something. In practice, make sure to +only use findOne when there are constraints or there is otherwise certainty +that a row exists.

    +

    The following plan will: +1. find a student, given a name. Since this is the first step of the plan, the +name is the input of the plan. +1. using the ID of the student, find a row in student_class that matches on +the studentClassStudentIdField. Note that Orville doesn’t check that the +fields are actually comparable, or that it makes sense to compare them! +1. using the ID of the StudentClass, find a row in class that matches on the class_id.

    +
    +src/Main.hs : haskell +
    +
      (print =<<) . O.runOrville pool $ Plan.execute
    +    (              Plan.findOne studentTable studentNameField
    +      `Plan.chain` Plan.focusParam studentId (Plan.findOne studentClassTable studentClassStudentIdField)
    +      `Plan.chain` Plan.focusParam studentClassClassId (Plan.findOne classTable classIdField)
    +    )
    +    (T.pack "Other Name")
    +
    +

    Expanding on the previous example, let’s find all the names of the classes they +attend, instead of just one. This also lets us avoid unsafe uses of findOne. +This new version doesn’t throw an exception if a student doesn’t attend any +classes, which would happen when the middle plan would fail. Because of the +constraint, the final plan can’t fail, so that findOne kept.

    +

    Let’s extract the Student -> [Class] part to its own Plan, which we’ll then +use for the final expression. Note how the following definition is similar to +the last two lines of the plan above.

    +
    +src/Main.hs : haskell +
    +
      let
    +    studentToClassesPlan :: Plan.Plan scope Student [Class]
    +    studentToClassesPlan =
    +                   Plan.focusParam studentId (Plan.findAll studentClassTable studentClassStudentIdField)
    +      `Plan.chain` Plan.planList (Plan.focusParam studentClassClassId $ Plan.findOne classTable classIdField)
    +
    +

    Remember how plans solve the n+1 problem by scaling easily from a single item +to multiple items. This means that while studentToClassesPlan executes as two +SQL statements, planList studentToClassesPlan, a version that works on +multiple elements, also executes as two SQL statements.

    +

    You can verify this using explain, which shows the generated SQL. Note how +both of these lists have two SQL statements in them:

    +
    +src/Main.hs : haskell +
    +
      print $ Plan.explain studentToClassesPlan
    +  print $ Plan.explain (Plan.planList studentToClassesPlan)
    +
    +

    With that in mind, let’s use studentToClassesPlan with findAll and +planList to get a list of classes for each matching student.

    +

    (we sort the inner lists below, such that the result is deterministic.)

    +
    +src/Main.hs : haskell +
    +
      (print =<<) . fmap (fmap sort) . O.runOrville pool $ Plan.execute
    +    ( Plan.findAll studentTable studentNameField
    +      `Plan.chain` Plan.planList studentToClassesPlan
    +    )
    +    (T.pack "Name")
    +
    +

    You can build an execute this as usual:

    +
    +shell +
    +
    stack build
    +stack exec using-plans
    +
    +

    And you should see the following output:

    +
    +output : plaintext +
    +
    Just (Student {studentId = 0, studentName = "Name", studentAge = 91})
    +Just (Student {studentId = 1, studentName = "Other Name", studentAge = 42})
    +[Just (Student {studentId = 1, studentName = "Other Name", studentAge = 42}),Just (Student {studentId = 0, studentName = "Name", studentAge = 91})]
    +Class {classId = 1, classSubject = "Cooking"}
    +["SELECT \"student_id\",\"id\",\"class_id\",\"student_id\" FROM \"plan_demo_student_class\" WHERE (\"student_id\") = ($1)","SELECT \"id\",\"id\",\"subject\" FROM \"plan_demo_class\" WHERE (\"id\") IN ($1, $2)"]
    +["SELECT \"student_id\",\"id\",\"class_id\",\"student_id\" FROM \"plan_demo_student_class\" WHERE (\"student_id\") IN ($1, $2)","SELECT \"id\",\"id\",\"subject\" FROM \"plan_demo_class\" WHERE (\"id\") IN ($1, $2)"]
    +[[Class {classId = 0, classSubject = "Painting"},Class {classId = 2, classSubject = "Swimming"}]]
    +
    +
    + +
    + + diff --git a/docs/tutorials/using-sql-marshaller.html b/docs/tutorials/using-sql-marshaller.html new file mode 100644 index 0000000..9102143 --- /dev/null +++ b/docs/tutorials/using-sql-marshaller.html @@ -0,0 +1,206 @@ + + + + + + + Orville - Using SqlMarshaller + + + + +
    +
    +

    + + Orville Logo + +

    +
    + + + +
    + Site proudly generated by + Hakyll +
    +
    + +
    +

    Using SqlMarshaller

    +
    +
    +

    The SQL Marshaller helps with converting from a Haskell record to SQL and back. +This document also shows how the SQL marshaller in table definitions, which can +then be used to generate Data Definition Language (DDL) queries to create +tables in the database.

    +

    You’ll need a Haskell project named using-sql-marshaller for this tutorial. +The setup is identical to the setup in Getting Started +aside from the package name, so we’ll avoid explaining it again here. Instead +we’ll get straight on creating our src/Main.hs file.

    +

    First, let’s import the necessary modules. We use less ‘internal’ imports here +than in the Getting Started guide, because we are using +a higher abstraction level.

    +
    +src/Main.hs : haskell +
    +
    module Main
    +  ( main
    +  ) where
    +
    +import qualified Orville.PostgreSQL as O
    +import qualified Orville.PostgreSQL.AutoMigration as AutoMigration
    +
    +import qualified Data.Int as Int
    +import qualified Data.Text as T
    +
    +

    Next, let’s declare some type aliases and the Haskell record itself. We’ll +enable storing values of this record in the SQL database.

    +
    +src/Main.hs : haskell +
    +
    type FooId = Int.Int32
    +type FooName = T.Text
    +type FooAge = Int.Int32
    +
    +data Foo = Foo
    +  { fooId :: FooId
    +  , fooName :: FooName
    +  , fooAge :: FooAge
    +  }
    +  deriving (Eq, Show)
    +
    +

    To store the record in SQL, we need to define Orville FieldDefinitions for each +of the fields of the record. A FieldDefinition maps to a column in SQL. Also +note how the type is parameterized on whether it is nullable or not.

    +

    The strings passed in here are the actual SQL column names. FieldDefinitions +help avoiding typos, since the Haskell compiler will fail compilation if the +name of a FieldDefinition is misspelt.

    +
    +src/Main.hs : haskell +
    +
    fooIdField :: O.FieldDefinition O.NotNull FooId
    +fooIdField =
    +  O.integerField "id"
    +
    +fooNameField :: O.FieldDefinition O.NotNull FooName
    +fooNameField =
    +  O.unboundedTextField "name"
    +
    +fooAgeField :: O.FieldDefinition O.NotNull FooAge
    +fooAgeField =
    +  O.integerField "age"
    +
    +

    Now that the fields are defined, we can use them, togehter with the record +field selector functions, to define the SqlMarshaller.

    +
    +src/Main.hs : haskell +
    +
    fooMarshaller :: O.SqlMarshaller Foo Foo
    +fooMarshaller =
    +  Foo
    +    <$> O.marshallField fooId fooIdField
    +    <*> O.marshallField fooName fooNameField
    +    <*> O.marshallField fooAge fooAgeField
    +
    +

    We can use the marshaller to define the Orville table definition. This binding +represents a table, but note that it doesn’t necessarily exist in the SQL +database until we start using it.

    +
    +src/Main.hs : haskell +
    +
    table :: O.TableDefinition (O.HasKey FooId) Foo Foo
    +table =
    +  O.mkTableDefinition "foo" (O.primaryKey fooIdField) fooMarshaller
    +
    +

    Now let’s write the main function, which does the following: +1. auto migrates using the table defintion. It will match the Haskell record at +the time of execution of the statement. The details of migration are out of +scope for this article. +1. deletes the Foo with ID 0, if it exists. Necessary to allow the program to +be repeatedly executed, as primary keys can’t be duplicated. +1. inserts an example Foo object with ID 0. +1. reads it back out using its ID 0. If an entity with the given ID doesn’t +exist, we’d get a Nothing here. +1. prints the retrieved entity

    +
    +src/Main.hs : haskell +
    +
    main :: IO ()
    +main = do
    +  pool <-
    +    O.createConnectionPool
    +        O.ConnectionOptions
    +          { O.connectionString = "host=localhost user=postgres password=postgres"
    +          , O.connectionNoticeReporting = O.DisableNoticeReporting
    +          , O.connectionPoolStripes = O.OneStripePerCapability
    +          , O.connectionPoolLingerTime = 10
    +          , O.connectionPoolMaxConnections = O.MaxConnectionsPerStripe 1
    +          }
    +
    +  mbFoo <- O.runOrville pool $ do
    +    AutoMigration.autoMigrateSchema AutoMigration.defaultOptions [AutoMigration.SchemaTable table]
    +    _ <- O.deleteEntity table 0
    +    _ <- O.insertEntity table Foo { fooId = 0, fooName = T.pack "Name", fooAge = 91 }
    +    O.findEntity table 0
    +  print mbFoo
    +
    +

    The program is now complete, let’s compile and run!

    +
    +shell +
    +
    stack build
    +stack exec using-sql-marshaller
    +
    +

    Once it builds and runs successfully you should see the following output:

    +
    +output : plaintext +
    +
    Just (Foo {fooId = 0, fooName = "Name", fooAge = 91})
    +
    +
    + +
    + + diff --git a/images/orville-waving-pennant.svg b/images/orville-waving-pennant.svg new file mode 100644 index 0000000..96ffd5d --- /dev/null +++ b/images/orville-waving-pennant.svg @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/orville-docsite/scripts/build.sh b/orville-docsite/scripts/build.sh index 9527e5d..6990386 100755 --- a/orville-docsite/scripts/build.sh +++ b/orville-docsite/scripts/build.sh @@ -1,5 +1,9 @@ #!/bin/sh +set -e + ./scripts/stack.sh install ./scripts/test-all-samples.sh ./scripts/site.sh rebuild +rm -r ../docs/* +cp -r site-builder/_site/* ../docs/. diff --git a/orville-docsite/site-builder/css/default.css b/orville-docsite/site-builder/css/default.css index 063ebee..8cfc29e 100644 --- a/orville-docsite/site-builder/css/default.css +++ b/orville-docsite/site-builder/css/default.css @@ -3,6 +3,18 @@ html { background-color: #0d0d13; } +::-webkit-scrollbar { + width: 10px; +} + +::-webkit-scrollbar-track { + background-color: #13131e; +} + +::-webkit-scrollbar-thumb { + background-color: #2e2e68; +} + body { font-size: 1.6rem; color: #c7c2c2; @@ -21,6 +33,8 @@ header { width: 200px; padding-left: 20px; padding-right: 20px; + overflow: auto; + scrollbar-width: thin; } nav { diff --git a/orville-docsite/site-builder/images/haskell-logo.png b/orville-docsite/site-builder/images/haskell-logo.png deleted file mode 100644 index 97c0937482e1c82c0e2a778f3ab3c4db99edcc4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5674 zcmW+)3pi7a8$a&%Yp7gD5)EM`B)JSDRKqaJed!=%NT~Tn&9&qhm3==)YA;eY)1JZI-Q=Q-y&@9p>dz3-cJ(ZO0oP*xBC01+D$5)GYupd*c+7yAFN z|CAYY;tn^rapH%5vHX4{=vp8YOS9q$ zYXuulfu=A4n>orr?AK+x7JSs~a@FQ2)nUgZBNYAX&h@iT*Vc<@4ar$(UjSpyd!%aR z$`kkR%~jS&%glK5&<6DK!$ylTDR+dirWO+tA!T@I=a5x z*eVRWhf2!n>*?vaqH?@T!A}yW?Vc0y&>=V^WPP37||sh&eHF7{l-&M!yM7Uf*_r?8FUbiAWCdDbu?8D$Qx5 zbLJ$Fqj8Ac64kAs;vZ=@1$*rj7;&bf59!MCS%d@6Ke{#t$;rxM6{AR5Kl*-(aCV2S z@&1_5_cxTeipS%pE8K(JM#o5~WU%nj;F2TD7KYI02R^f-b!j~FH+pMlOWZxG$GR$H z5N&i1?Y3i3C_cg#ecegHQwI_3%fUUR9aUI*y$>G$li*OZ(p-J4q#A&AG~vhR0#0JG zY$<2M_-vR9}|WE7nw9~I7pQwGMgM4eU+E`Iu&NyF3*p`Y1g zp$|$hXL#8O%2}ZE@$9j!);;GkTDBzTYKS=S!+2d0*E-`wet=(MZx!HEgc9G3aiEw5 znc+>3q*l-8#a|TR1QZk$cEn4t$e*n`G*-Y#6Jce@8_uzaIXNf{c>)yIOxK(UWkO8J zeFQx6YTbmig@uK4q0b=uiqL%EgC|&L0G@?@xgh#b@6?kvGoU?UW{~T*U8fuFyi480 z2u6!Ca+>V+p8mBLw$xgar9pNk0;Y8nQl(fxyDoT}-rUuXV;=!_yS<8ZS{NSMo-)v9 zsd?Ex_77xs&i4zxjo-(XgIN7WH^84fU?N{PA+>H@)pQEq1OdFziiw#fn0|x2gCnVyGl7lTx zAro8N8pi8aLpTrV9Xux03z&VIBCl0d}gXzQeb6e)x0o}A?Zy72usnP zzz?c=gCSoI1efQuUpC=k<~1*_R6ljp;y_NqfCv3JK7d4CLa<|krfwHp-+7ZLbWYHW z_9c4uOW2aZY~F{&H{UMWUN%K;TD5+hsChaOR8`@0d^;k!_sf41eSbxI8VNUHxxMtS ztE)58Q4bcfd)mwhewCOS*S|8{R7@!o^%Se?Q)WhRVyJx9qJmxbYIqOJ%F-k=$W$4` z8Sipz-!zx9qZV-5C_UV2S~=Z16~Y%3DkZ{{-P#fE-nxnJ`ZGSgwXOEZDSKYQ*TX^j z1vHHCpK2UiyeLo$GtGmTtsLbzRZ!k!-4S`KGY?V(+re5U)~yBQi7xGj~P^wnhH z%<#gySd%uN?Tyt7D^f43wn3FYY6*6X*tt7N!BZDH6+Yj5{Ts^C&7w_9Tq{FidwBjQ zmM&w<00PG3)ST)1A98p(2p-y-9DvH=7V@VyWyDf>_uZV?1F)%T>OfTbLSnu8sHzQy zZcDk5v%Wp|k1*>`+WIye?_7CNy+x;>-voe#7>u=)(xK|NrMi<)oint)*cftD6htQn z2pq(WH$Mny+wDS)9RJH)^B^&L@o2E)Gn?gKe`HnN8M_~xiXJ?YvtrO#%UIyPTp!}Z zwHPAzeL?5d*>$`)Gt|>_PQ!>{OTDU>XLkaa3)R#j1q4#i(Nzws)^cEY7k2 z#N;dtm~UR&0j?+c&N+tOdUa*273Qig)!NaAF2^3*YV{n|($4J_;}{Rp8EiSS?>3gM zhJ)Z)SRd^9%-s&@Vv!COI%?;}M5I)*mW|426#F0%JtL!A1X6O?YMV4pv0ih)X)43W3)>g;nB^q^%BB0BB07eKhLpaI@X{E9RInfQU4+xFLWaO>4Cgk!M|$BR#Y>~? z^f-1rBKPAgs4|2=kwqJ06PFZcp?@K^0d#LaNdL%bsL|o&~1pwd>1RH=U~(pd{Xv=Mz-xyL6pO;A}4q%WQ;E6v@$1R zCD>75JP1#y@D!VWTK+~=`cm>KsBD*X*j!;t{NwJ`V=k$wsoz-|P~xin7S~PRzB}ej zH&pouGZE?zQ{>i>j7leb_;0JF9+Xb$T0g){Q{zg6y?}hP%8Y+_w})5YH!J~)Om>bx zeMD<_XZ_Ben0OiX%MG{f97WtL4A;9YG*7XmdVZ6FQ+AU{w@G-O5)$#W zR{DZ*Pv4nO0}`QF?c5KynGO&Gm=NfYMtnr73}dt)zj+?eWD+2VX}Ug#0xZFt>Zllf zP2@YryDya?!VooAar`*o82#{{fUbO`#xI=8EuA%aj%^44DG|=S5i>60%qZmrzn^D- z6E@E0l?3=!$q-!q&1ezeAy%#CO0lvv!vW%E`J~@a(ZHv^(++3)-?!eV0QD2|%; zjM|Cs=c^k(C40VAKpIJk=I9qK#T_Qps~lQ%n%jh`1~KQQcah&AK)(QOV$D>gnE{XM z>e$BtY=gs#`13(itxgS%&<$T;w|`%3UbBsL*F!RFOQZrNA@Sy(?}akRPr+u}e)-b6 zen(8t!GQ`Ya0&2foUB^eJs@$d`Vpd!+PW^bB6CnM@eW7mtJlWf22Un})(ELfA}OjF z5TN>T;R>HyR8}FLyh3xIW-@CeOlS5#HXAVm6|HiO$isfzp2UrT*r=CPm9K&rn99o{ zW(Vg;Uz-)qL>ix1lb5vdBf94NQp4r^H`ElDXNO~44}-YFkWeYSm?v@`&C1X3Jk`_Q z-k$UTvCJd!>)WpBTvPZG=iFwL`QlO$ZBzg{XzqeR@dqtMB_&TW zLzfT5JQA0e31IkIrQzZ0qKk(*Ro&LL4J2l5)Ezzp7J41et`CZMCkmr^@Rm8GQ zA4c{=v~3KYo`tnQoo-gK6xK18asZd~5fRl$ZBIBJqY9zZp6 zvDb3S)F!HCWR&iHkheNYe9y4K99a#|?VVg$sj8~72Nd-WX~=XcHFn$+n*&T&zUY*D zFP^zP_R6B+_P?LHRyh7Py+&DiFZM$jz5u{HOS7 zL1oYq>6^YVO?7X(`R}Jdo%1)Am{t9$&xPF=Z&To-|Wk^=!Y$TPwd>JD|P?Agald|E% z!wHB_`|Osz6dm<#ln?xMmG_8^?}r~heiVO|5)~EICr3+5(y%JBkaujDHN8l%6jQYH zN|5adh3-*5j^W(PZYfrNLX(am{`~n<(;r9g_NwQ?X(wKS+qDS5HwJZi2SiJ;EHDBg zS%Ixl8Xp*N&;@zs!#a`JKcBMKEsFd8!jF;?Du@i>BaOw?vRLu3e@tx@<<_7P#Z{OSmO@~Lo zUmL4a#iP_;#vvK&+dk!(z82Z`wzq{x=2=iqiw&UeAOb}I89S!?%{L55CvQa#veyLu zy-<}X&uE^j)#N)+`8!|tYToC`t#WK|94!gG9IJB6^US6p*M&$tKA`yD8SPYP{;!`^+hVF(~b^|dzWL7s*9!wcK+<_?Bx$Tdk|{HIDbdW9kCaZD0J4& z?b@v$>bglhSTIEzX82^5rXUFL2(hs{v|eceeHSh_C25q@yI&Y5~5=K>Lf#@O0J*R z_x1izfQz&bKBtNFb2*;9W5j5fiJbCLk%e;cr`--@z5o6DcenC>6HBYCgxApgpP519 zZoha52Kn3d02=1ymydx_}D^D>f5l%zBKzxLN7?~`u5 ztULM);u7%QHBvwt8r%%pi=$)Qh32nHSmg^PInjIMRGlk(8mnD3XZ3SM_G7{)G%U+R z<|C3E=_onXci(*O)J2k1{oQ;>aTBgm26TJ5E{$!#eiD3BP;Hg-D zy~DaEsvlKi8MQ$ZwG2S1a7cRWdv?o-uQEzT z_yELW2K2^_FYmExnQlCWvP4ISb-`^tjdTEZAbrV6ZjN#krb>1qDl^DUq zHx__?!T5$IDi!QE^m=m9ATRHzJ^k5}Cr@b5AdlGxjj=eyPWyI50E!64j*bpHuQ&I^ z!M%Kv;c1k9!3?h<7*Vibu=!2q9J>$U4g{Q~w}`~Pu6=ePZ~FE7Y!plH z!O-3K;8KFexKL$S5fKqB4j2w9sX$xGa8cxH$hTq2%KwW3T?_U%n{hIX&c4wMSI)xv z*G=>rq>s?Dv*9kIv2$(mkYHxIokGzt8BBc!*j2x3ty7cb$|;l={S?U(RH&$~UYFuW z!*Lj8*8gdYcan;6e6Dyvtn@)Uyt%o#^OcJUo;U)Y(uF?Xa0?oKX8w3+H}JHx`;QLa zBdux4q!gzkh-li{_U>`umqECE*WHgFKOXE-_!MBiujDE!w{odE$`j7jV+Ge+ z1nXQlv@y04A>jtilnHs1iqU_9^x+_lqENPPj*6`QVKw2tptSUK#UZK!wE6h7-AblP z6L!h0WieQZ2ylD9TXn%lMcvU^6VD7dje2!uPE;A9@Ejd5dvK|m2xFja4=#zM7U;ViH3M7hAx%TWzFFM&1wXm zJUgpSrxh~CpFe*bym62`m_qWQV#~5EP6HIv&Ts?b%-*9Fqq=gc7b}-uD5r=vG*-p5 zK}#acAcA~MxHz{QLszFPzZOL5?hnhJoq67Gc_qp*7gSy8MFW0%DlD2bga^sL0lDp* zIK@{B>1S%gc*yl;n!QHO53v#%_1Lu3)JHHII=QLsqPp?nDACK25N}Ad9|>Cm)SN1@ z^ta_$L>!R>nKk*%U?3O2BA0eoodLDE8;uqT-l3t-C7zi|J;4H_T@G=sGPevce)t}EwsPN)Y|`CH1wW%VG--s3 z-PPfv*C0Mxn|WEy^CJ|RZFbAC^ee2jLX%1}($`FgkpL?T8td5qC8em0>J0yXr}ND8 zS(m*3!w5(K=poEM#C>3{_Wezdm_kDV(%2(psV%eue{G?NUy z>kG~U{cpv@T*xfLAf;^SB-FmB|A7kh_?mqA_^X&r93a+J$OVwMsyEl?_LM(tzk^n6 zHsGmG1_Q+Au3xuyZk2&7eO^93IVkB8G)rXQ<*~S$cX5A}%u%0=Yh2V*p}j6(W9fjb IGWYuDe^AuAqW}N^ diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html new file mode 100644 index 0000000..1ec6bf4 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Conduit.html @@ -0,0 +1,13 @@ +Database.Orville.PostgreSQL.Conduit

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Conduit

    Description

     
    Synopsis

    Documentation

    selectConduit :: (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m) => Select row -> ConduitT () row m () Source #

    selectConduit provides a way to stream the results of a Select query + from the database one by one using the conduit library. You can fuse the + conduit built by this function with your own conduit pipeline to handle rows + individually in whatever fashion you need (e.g. turning them into rows of + CSV). This is useful if you want to be able to process many rows one by one. + You can aggregate the results however you require as part of the conduit + processing and then use runConduit (or runConduitRes) from the conduit + library to execute the processing pipeline. Alternatively, your web server + (wai, servant, etc) may provide support for converting a conduit into a + streaming HTTP response.

    Beware: this function must load all the results into memory before streaming + can begin. For why, see https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html. + If memory use is a concern, try streamPages instead.

    streamPages Source #

    Arguments

    :: (MonadOrville conn m, Bounded orderField, Enum orderField) 
    => TableDefinition readEnt write key 
    -> FieldDefinition NotNull orderField 
    -> (readEnt -> orderField) 
    -> Maybe WhereCondition 
    -> Word

    number of rows fetched per page

    -> ConduitT () readEnt m () 

    Build a conduit source that is fed by querying one page worth of results + at a time. When the last row of the last page is consumed, the stream ends.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html new file mode 100644 index 0000000..bfbc911 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Connection.html @@ -0,0 +1,4 @@ +Database.Orville.PostgreSQL.Connection

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Connection

    Description

     

    Documentation

    createConnectionPool Source #

    Arguments

    :: Int

    Number of stripes in the connection pool

    -> NominalDiffTime

    Linger time before closing an idle connection

    -> Int

    Max number of connections to allocate per stripe

    -> String

    A PostgreSQL connection string

    -> IO (Pool Connection) 

    createConnectionPool allocates a pool of connections to a PosgreSQL + server. The returned pool can be used as the endpoint to + newOrvilleEnv + to construct.

    data Pool a #

    Instances
    Show (Pool a) 
    Instance details

    Defined in Data.Pool

    Methods

    showsPrec :: Int -> Pool a -> ShowS #

    show :: Pool a -> String #

    showList :: [Pool a] -> ShowS #

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html new file mode 100644 index 0000000..f59d65a --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Core.html @@ -0,0 +1,354 @@ +Database.Orville.PostgreSQL.Core

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Core

    Description

    Migration Guide: Although not all exports are identical, most of the items in +this module can now be imported from Orville.PostgreSQL.

    Please note that the new LibPQ-based version of orville represents a complete +re-write of Orville from the ground up. As such many of the APIs have been +re-thought with the goal of providing stability and better experience long +term.

    Major changes:

    • The library no longer allows the connection type to vary. It is intended only + to be used with PostgreSQL. Thus MonadOrville and other types that used to + have a conn type parameter no longer have that parameter.
    • OrvilleT has been removed in favor of simply using ReaderT. For trivial + cases (i.e. ReaderT over IO) a pre-packaged Orville monad is provided.
    • In TableDefinition, the order of the type parameters has changed from + TableDefinition readEnity writeEntity key to TableDefinition key + writeEntity readEntity. This make it more consistent with the order of these + arguments in other types. TableParams has been removed in favor of building + a basic table definition with the require parameters first and adding or + setting other optional items after initial construction.
    • RelationalMap has been replaced by SqlMarshaller. Many functions have + been renamed, but most functions have a direct or nearly direct translation + from the old ones. See the docs on the individual functions such as + attrField to see what has changed.
    • The auto-migration system is significantly improved. Standard indexes no + longer need to be given explicit names. Indexes and constraints are now + attached to TableDefinition rather than being their own schema items. + Indexes and constraints are no longer dropped explicitly -- they are dropped + automatically by Orville when they have been removed from the table + definiton.
    • A number of places that previously accepted [] now require NonEmpty + instead. This is done in places where an empty list would not be valid SQL. + For examples of this change see insertRecordMany and updateFields.
    • whereAnd and whereOr (which took lists) have been replaced + with binary boolean logic functions andExpr and orExpr. These functions + also have operator aliases ((.&&), (.||)).

    The following items exported from this module have migration guide notes +available in their documentation:

    Synopsis

    Documentation

    data TableDefinition readEntity writeEntity key Source #

    Migration Guide: TableDefinition can now be imported from + PostgreSQL. The order of the type parameters has changed from + TableDefinition readEnity writeEntity key to TableDefinition key + writeEntity readEntity. In the new Orville tables without primary keys are + supported, so the key parameter must now be instantiated as either HasKey + keyType or NoKey.

    A TableDefinition is the center of the Orville universe. A TableDefinition + defines the structure of a table in the database and associates it with a Haskell + datatype, usually a Haskell record type. The TableDefinition must specify how + the Haskell type is converted to and from the database schema, as as well as + provide same basic utility functions required by Orville for interacting with + the Haskell datatype.

    Usually you will use TableParams to construct a TableDefinition in a more + concise way. This type is provided as an escape hatch for any situations where + TableParams is too restrictive for the sql mapping required by a type.

    Constructors

    TableDefinition 

    Fields

    • tableName :: String

      The name of the table in the database.

    • tableFields :: [SomeField]

      A list of field definitions defining the table structure

    • tableSafeToDelete :: [String]

      A list of any columns that may be deleted from the table by Orville. + (Orville will never delete a column without being told it is safe)

    • tablePrimaryKey :: PrimaryKey key

      The statically typed field definition that is the primary key. Currently + this field must still by listed in tableFields

    • tableFromSql :: FromSql readEntity

      A definition of how to convert the haskell type from a sql row

    • tableToSql :: ToSql writeEntity ()

      A function to set the key on the entity

    • tableGetKey :: readEntity -> key

      A function to get the key on the entity

    • tableComments :: TableComments ()

      Any comments that might be interesting for developers to see. These + comments will get printed in the log if there is an erro while attempting + to migrate the table.

    primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition Source #

    primaryKeyIn builds a WhereCondition that will match all rows where the + primary key is equal to one of the given values. For single-field primary + keys this is equivalent to whereIn, but primaryKeyIn also handles + composite primary keys.

    primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition Source #

    primaryKeyEquals builds a WhereCondition that will match the row where + the primary key is equal to the given value. For single-field primary keys + this is equivalent to .==, but 'primaryKeyEquals also handles composite + primary keys.

    primaryKeyDescription :: PrimaryKey key -> String Source #

    primaryKeyDescription builds a user-readable representation of the + primary key for use in error messages and such. It is a comma-delimited + list of the names of the fields that make up the primary key.

    primaryKeyToSql :: PrimaryKey key -> key -> [SqlValue] Source #

    primaryKeyToSql converts a Haskell value for a primary key into the + (possibly multiple) sql values that represent the primary key in the + database.

    primaryKey :: FieldDefinition NotNull key -> PrimaryKey key Source #

    primaryKey constructs a single-field primary key from the FieldDefinition + that corresponds to the primary key's column. This is generally used while + building a TableDefinition.

    compositePrimaryKey :: PrimaryKeyPart key -> [PrimaryKeyPart key] -> PrimaryKey key Source #

    compositePrimaryKey constructs a multi-field primary key from the given + parts, each of which corresponds to one field in the primary key. You should + use this while building a TableDefinition for a table that you want to have + a multi-column primary key. See primaryKeyPart for how to build the parts + to be passed as parameters. Note: there is no special significance to the + first argument other than requiring that there is at least one field in the + primary key.

    primaryKeyPart :: (key -> part) -> FieldDefinition NotNull part -> PrimaryKeyPart key Source #

    primaryKeyPart builds on section of a composite primary key based on the + field definition that corresponds to that column of the primary key. The + function given is used to decompose the Haskell value for the composite key + into the individual parts so they can be converted to sql for things like + building WhereCondition

    mkTableDefinition :: TableParams readEntity writeEntity key -> TableDefinition readEntity writeEntity key Source #

    Migration Guide: This function has in the new orville to take the table name, + primary key definition and a SqlMarshaller (formerly RelationalMap). + Other options such as constraints, indexes, and columns to drop can be added + to the TableDefinition after the initial instantiation. The TableParams + type has been dropped for the new orville.

    mkTableDefinition converts a TableParams to TableDefinition. Usually + this is used directly on a record literal of the TableParams. For + example:

     data Foo key = Foo key { fooId :: Record }
    + myTable :: TableDefinition Foo
    + myTable = mkTableDefinition $
    +   TableParams
    +     { tblName = "foo"
    +     , tblMapper = User $ attrField fooId idField
    +     , tableSafeToDelete = []
    +     , tblSetKey = key foo -> foo { fooId = key }
    +     , tblGetKey = fooId
    +     , tblComments = []
    +     }
    +
    +

    data SqlType a Source #

    SqlType defines the mapping of a Haskell type (a) to a SQL column type in the + database. This includes both how to convert the type to and from the raw values + read from the database as well as the schema information required to create + and migrate columns using the type.

    Constructors

    SqlType 

    Fields

    • sqlTypeDDL :: String

      The raw SQL DDL to use when creating/migrating columns of this type + (not including any NULL or NOT NULL declarations)

    • sqlTypeReferenceDDL :: Maybe String

      The raw SQL DDL to use when creating/migrating columns with foreign + keys to this type. This is used foreignRefType to build a new SqlType + when making foreign key fields

    • sqlTypeId :: SqlTypeId

      sqlTypeId will be compared to the colType field found in the + SqlColDesc return by describeTable when determining whether + a column type change is required when migrating the database.

    • sqlTypeSqlSize :: Maybe Int

      'sqlTypeSqlSize will be compared to the colSize field found in the + SqlColDesc return by describeTable when determining whether + a column type change is required when migrating the database.

    • sqlTypeToSql :: a -> SqlValue

      A function for converting Haskell values of this type into values to + be stored in the database.

    • sqlTypeFromSql :: SqlValue -> Either RowDataErrorReason a

      A function for converting values of this are stored in the database + into Haskell values. This function should return 'Left + RowDataErrorReason' to indicate an error if the conversion is + impossible. Otherwise it should return Right the corresponding a + value.

    serial :: SqlType Int32 Source #

    serial defines a 32-bit auto-incrementing column type. This corresponds to + the SERIAL type in PostgreSQL.

    bigserial :: SqlType Int64 Source #

    bigserial defines a 64-bit auto-incrementing column type. This corresponds to + the BIGSERIAL type in PostgresSQL.

    text :: Int -> SqlType Text Source #

    text defines a fixed length text field type. This corresponds to a + "CHAR(len)" type in SQL.

    varText :: Int -> SqlType Text Source #

    varText defines a variable text field type with a max length. This + corresponds to a "VARCHAR(len)" type in SQL.

    unboundedText :: SqlType Text Source #

    unboundedText defines a fixed length text field type. This corresponds to a + TEXT type in PostgreSQL.

    integer :: SqlType Int32 Source #

    integer defines a 32-bit integer type. This corresponds to the INTEGER type in SQL.

    bigInteger :: SqlType Int64 Source #

    bigInteger defines a 64-bit integer type. This corresponds to the BIGINT + type in SQL.

    double :: SqlType Double Source #

    double defines a floating point numeric type. This corresponds to the "DOUBLE + PRECISION" type in SQL.

    boolean :: SqlType Bool Source #

    boolean defines a True/False boolean type. This corresponds to the BOOLEAN + type in SQL.

    date :: SqlType Day Source #

    date defines a type representing a calendar date (without time zone). It corresponds + to the DATE type in SQL.

    timestamp :: SqlType UTCTime Source #

    timestamp defines a type representing a particular point in time (without time zone). + It corresponds to the "TIMESTAMP with time zone" type in SQL.

    Note: This is NOT a typo. The "TIMESTAMP with time zone" type in SQL does not include + any actual time zone information. For an excellent explanation of the complexities + involving this type, please see Chris Clark's blog post about it: + http://blog.untrod.com/2016/08/actually-understanding-timezones-in-postgresql.html

    textSearchVector :: SqlType Text Source #

    textSearchVector defines a type for indexed text searching. It corresponds to the + TSVECTOR type in PostgreSQL.

    convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b Source #

    Migration Guide: convertSqlType retains the same name

    convertSqlType changes the Haskell type used by a SqlType in the same manner + as maybeConvertSqlType in cases where an a can always be converted to a b.

    maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b Source #

    Migration Guide: maybeConvertSqlType has been replaced with + tryConvertSqlType, which allows an error message to be returned when + conversion fails.

    maybeConvertSqlType changes the Haskell type used by a SqlType without + changing the column type that will be used in the database schema. The + functions given will be used to convert the now Haskell type to and from the + original type when reading and writing values from the database. When reading + an a value from the database, the conversion function should produce + Nothing if the value cannot be successfully converted to a b.

    data TableParams readEntity writeEntity key Source #

    MigrationGuide: TableParams no longer exists. See the migration guide + for mkTableDefinition

    TableParams is the simplest way to make a TableDefinition. You + can use mkTableDefinition to make a definition from the simplified + params. Where TableDefinition requires the tableFields, tableFromSql, + and tableToSql to all be defined separately and kept in sync, TableParams + provides a single tblMapper field that specifies all three simultaneously + and ensures they are consistent with one another.

    Constructors

    TableParams 

    Fields

    • tblName :: String

      The name of the table in the database

    • tblMapper :: RelationalMap writeEntity readEntity

      The relational mapping that defines how the Haskell entity type + is converted both to and from sql. The fields utilized in the mapping + are used to automatically build the list of FieldDefinitions that + define the structure of the table in the database.

    • tblSafeToDelete :: [String]

      A list of any columns that may be deleted from the table by Orville. + (Orville will never delete a column without being told it is safe)

    • tblPrimaryKey :: PrimaryKey key

      A function to set the key on the entity

    • tblGetKey :: readEntity -> key

      A function to get the key on the entity

    • tblComments :: TableComments ()

      Any comments that might be interesting for developers to see. These + comments will get printed in the log if there is an erro while attempting + to migrate the table.

    data RelationalMap a b Source #

    Migration guide: This type has been replaced with the SqlMarshaller type in + the new orville. The interface is similar, though the names of the functions + have been updated in many cases. See the migration guides for those functions + to find their new names.

    Instances
    Profunctor RelationalMap Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.RelationalMap

    Methods

    dimap :: (a -> b) -> (c -> d) -> RelationalMap b c -> RelationalMap a d

    lmap :: (a -> b) -> RelationalMap b c -> RelationalMap a c

    rmap :: (b -> c) -> RelationalMap a b -> RelationalMap a c

    (#.) :: Coercible c b => q b c -> RelationalMap a b -> RelationalMap a c

    (.#) :: Coercible b a => RelationalMap b c -> q a b -> RelationalMap a c

    Functor (RelationalMap a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.RelationalMap

    Methods

    fmap :: (a0 -> b) -> RelationalMap a a0 -> RelationalMap a b #

    (<$) :: a0 -> RelationalMap a b -> RelationalMap a a0 #

    Applicative (RelationalMap a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.RelationalMap

    Methods

    pure :: a0 -> RelationalMap a a0 #

    (<*>) :: RelationalMap a (a0 -> b) -> RelationalMap a a0 -> RelationalMap a b #

    liftA2 :: (a0 -> b -> c) -> RelationalMap a a0 -> RelationalMap a b -> RelationalMap a c #

    (*>) :: RelationalMap a a0 -> RelationalMap a b -> RelationalMap a b #

    (<*) :: RelationalMap a a0 -> RelationalMap a b -> RelationalMap a a0 #

    fields :: RelationalMap a b -> [SomeField] Source #

    Migration Guide: The fields in new orville's SqlMarshaller are somewhat + more sophisticated than those of a RelationalMap. The fields function is + no longer offered with this simple interface as a result, but the + foldMarshallerFields function can be used in combination with the + collectFromField helper to collect the desired information from each field.

    mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c Source #

    Migration Guide: mapAttr has been renamed to marshallNested

    mapField :: FieldDefinition nullability a -> RelationalMap a a Source #

    Migration Guide: mapField has been removed, though its functional + equivalent is marshallReadOnlyField

    attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b Source #

    Migration Guide: attrField has been renamed to marshallField

    maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b) Source #

    Migration Guide: maybeMapper has been renamed to marshallMaybe

    prefixMap :: String -> RelationalMap a b -> RelationalMap a b Source #

    Migration Guide: prefixMap has been renamed to prefixMarshaller

    partialMap :: RelationalMap a (Either String a) -> RelationalMap a a Source #

    Migration Guide: partialMap has been renamed to marshallPartial

    readOnlyMap :: RelationalMap a b -> RelationalMap c b Source #

    Migration Guide: readOnlyMap has been renamed to marshallReadOnly

    readOnlyField :: FieldDefinition nullability a -> RelationalMap b a Source #

    Migration Guide: readOnlyField has been renamed to marshallReadOnlyField

    data OrvilleEnv conn Source #

    Migration Guide: OrvilleEnv has been renamed to OrvilleState. It no + longer has any type paremeters. The connection type is fixed and cannot be + changed.

    OrvilleEnv tracks all the environment information required for an + 'OrvilleT conn m' Monad to operate. Use newOrvilleEnv to construct + one.

    newOrvilleEnv :: Pool conn -> OrvilleEnv conn Source #

    Migration Guide: newOrvilleEnv has been renamed to newOrvilleState. The + new function requires a parameter to be passed before the connection pool to + specify the level of detail to be used when Orville reports errors.

    newOrvilleEnv initialized an OrvilleEnv for service. The connection + pool provided will be used to obtain connections to the database ase + required. You can use the createConnectionPool + utility function to create a connection pool to a PosgreSQL server.

    setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn Source #

    Migration Guide: setStartTransactionSQL has been renamed to setBeginTransactionExpr

    aroundRunningQuery :: (forall a. QueryType -> String -> IO a -> IO a) -> OrvilleEnv conn -> OrvilleEnv conn Source #

    Migration Guide: aroundRunningQuery has been renamed to addSqlExecutionCallback

    addTransactionCallBack :: (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn Source #

    Migration Guide: addTransactionCallBack retains the same name

    data TransactionEvent Source #

    Instances
    Enum TransactionEvent Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Eq TransactionEvent Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Ord TransactionEvent Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Read TransactionEvent Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Show TransactionEvent Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    data OrvilleT conn m a Source #

    Migration Guide: OrvilleT has been removed. In its place you can simply use + a ReaderT OrvilleState. If you have another ReaderT layer in your monad + stack you can add the OrvilleState to the reader context for that layer + instead, which is more efficient than having multiple ReaderT layers. If + you have a simple case of OrvilleT conn IO the new Orville offers a simpler + Orville monad (not a transformer) to get you started.

    Instances
    MonadError e m => MonadError e (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    throwError :: e -> OrvilleT conn m a #

    catchError :: OrvilleT conn m a -> (e -> OrvilleT conn m a) -> OrvilleT conn m a #

    MonadBaseControl b m => MonadBaseControl b (OrvilleT conn m)

    Because we recommend using MonadUnliftIO rather than MonadBaseControl, + we do not provide MonadBaseControl instance for OrvilleT by default + along with the definition. If you do need to use MonadBaseControl, + however, this is the canonical instance for OrvilleT.

    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    Associated Types

    type StM (OrvilleT conn m) a :: Type

    Methods

    liftBaseWith :: (RunInBase (OrvilleT conn m) b -> b a) -> OrvilleT conn m a

    restoreM :: StM (OrvilleT conn m) a -> OrvilleT conn m a

    MonadBase b m => MonadBase b (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    liftBase :: b α -> OrvilleT conn m α

    (Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    (IConnection conn, Monad m) => HasOrvilleContext conn (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    getOrvilleEnv :: OrvilleT conn m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleT conn m a -> OrvilleT conn m a Source #

    MonadTrans (OrvilleT conn) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    lift :: Monad m => m a -> OrvilleT conn m a #

    MonadTransControl (OrvilleT conn)

    Because we recommend using MonadUnliftIO rather than MonadTransControl, + we do not provide MonadTransControl instance for OrvilleT by default + along with the definition. If you do need to use MonadTransControl, + however, this is the canonical instance for OrvilleT.

    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    Associated Types

    type StT (OrvilleT conn) a :: Type

    Methods

    liftWith :: Monad m => (Run (OrvilleT conn) -> m a) -> OrvilleT conn m a

    restoreT :: Monad m => m (StT (OrvilleT conn) a) -> OrvilleT conn m a

    Monad m => Monad (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    (>>=) :: OrvilleT conn m a -> (a -> OrvilleT conn m b) -> OrvilleT conn m b #

    (>>) :: OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m b #

    return :: a -> OrvilleT conn m a #

    fail :: String -> OrvilleT conn m a #

    Functor m => Functor (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    fmap :: (a -> b) -> OrvilleT conn m a -> OrvilleT conn m b #

    (<$) :: a -> OrvilleT conn m b -> OrvilleT conn m a #

    MonadFail m => MonadFail (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    fail :: String -> OrvilleT conn m a #

    Applicative m => Applicative (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    pure :: a -> OrvilleT conn m a #

    (<*>) :: OrvilleT conn m (a -> b) -> OrvilleT conn m a -> OrvilleT conn m b #

    liftA2 :: (a -> b -> c) -> OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m c #

    (*>) :: OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m b #

    (<*) :: OrvilleT conn m a -> OrvilleT conn m b -> OrvilleT conn m a #

    MonadIO m => MonadIO (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    liftIO :: IO a -> OrvilleT conn m a #

    Alternative m => Alternative (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    empty :: OrvilleT conn m a #

    (<|>) :: OrvilleT conn m a -> OrvilleT conn m a -> OrvilleT conn m a #

    some :: OrvilleT conn m a -> OrvilleT conn m [a] #

    many :: OrvilleT conn m a -> OrvilleT conn m [a] #

    MonadPlus m => MonadPlus (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    mzero :: OrvilleT conn m a #

    mplus :: OrvilleT conn m a -> OrvilleT conn m a -> OrvilleT conn m a #

    MonadCatch m => MonadCatch (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    catch :: Exception e => OrvilleT conn m a -> (e -> OrvilleT conn m a) -> OrvilleT conn m a

    MonadMask m => MonadMask (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    mask :: ((forall a. OrvilleT conn m a -> OrvilleT conn m a) -> OrvilleT conn m b) -> OrvilleT conn m b

    uninterruptibleMask :: ((forall a. OrvilleT conn m a -> OrvilleT conn m a) -> OrvilleT conn m b) -> OrvilleT conn m b

    generalBracket :: OrvilleT conn m a -> (a -> ExitCase b -> OrvilleT conn m c) -> (a -> OrvilleT conn m b) -> OrvilleT conn m (b, c)

    MonadThrow m => MonadThrow (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    throwM :: Exception e => e -> OrvilleT conn m a

    MonadOrvilleControl m => MonadOrvilleControl (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleT conn m b) -> OrvilleT conn m b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleT conn m c -> OrvilleT conn m d -> OrvilleT conn m c Source #

    MonadUnliftIO m => MonadUnliftIO (OrvilleT conn m) 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadUnliftIO

    Methods

    askUnliftIO :: OrvilleT conn m (UnliftIO (OrvilleT conn m))

    withRunInIO :: ((forall a. OrvilleT conn m a -> IO a) -> IO b) -> OrvilleT conn m b

    type StT (OrvilleT conn) a 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    type StT (OrvilleT conn) a = StT (ReaderT (OrvilleEnv conn)) a
    type StM (OrvilleT conn m) a 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    type StM (OrvilleT conn m) a = ComposeSt (OrvilleT conn) m a

    unOrvilleT :: OrvilleT conn m a -> ReaderT (OrvilleEnv conn) m a Source #

    data SqlValue #

    Instances
    Eq SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Show SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Convertible Bool SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Bool -> ConvertResult SqlValue

    Convertible Char SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Char -> ConvertResult SqlValue

    Convertible Double SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Double -> ConvertResult SqlValue

    Convertible Int SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Int -> ConvertResult SqlValue

    Convertible Int32 SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Int32 -> ConvertResult SqlValue

    Convertible Int64 SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Int64 -> ConvertResult SqlValue

    Convertible Integer SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Integer -> ConvertResult SqlValue

    Convertible Rational SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Rational -> ConvertResult SqlValue

    Convertible Word32 SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Word32 -> ConvertResult SqlValue

    Convertible Word64 SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Word64 -> ConvertResult SqlValue

    Convertible String SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: String -> ConvertResult SqlValue

    Convertible ByteString SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: ByteString -> ConvertResult SqlValue

    Convertible ByteString SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: ByteString -> ConvertResult SqlValue

    Convertible Text SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Text -> ConvertResult SqlValue

    Convertible Text SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Text -> ConvertResult SqlValue

    Convertible ZonedTime SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: ZonedTime -> ConvertResult SqlValue

    Convertible LocalTime SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: LocalTime -> ConvertResult SqlValue

    Convertible TimeOfDay SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: TimeOfDay -> ConvertResult SqlValue

    Convertible UTCTime SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: UTCTime -> ConvertResult SqlValue

    Convertible NominalDiffTime SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: NominalDiffTime -> ConvertResult SqlValue

    Convertible DiffTime SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: DiffTime -> ConvertResult SqlValue

    Convertible Day SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Day -> ConvertResult SqlValue

    Convertible SqlValue Bool 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Bool

    Convertible SqlValue Char 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Char

    Convertible SqlValue Double 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Double

    Convertible SqlValue Int 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Int

    Convertible SqlValue Int32 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Int32

    Convertible SqlValue Int64 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Int64

    Convertible SqlValue Integer 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Integer

    Convertible SqlValue Rational 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Rational

    Convertible SqlValue Word32 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Word32

    Convertible SqlValue Word64 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Word64

    Convertible SqlValue String 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult String

    Convertible SqlValue ByteString 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult ByteString

    Convertible SqlValue ByteString 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult ByteString

    Convertible SqlValue Text 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Text

    Convertible SqlValue Text 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Text

    Convertible SqlValue ZonedTime 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult ZonedTime

    Convertible SqlValue LocalTime 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult LocalTime

    Convertible SqlValue TimeOfDay 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult TimeOfDay

    Convertible SqlValue UTCTime 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult UTCTime

    Convertible SqlValue NominalDiffTime 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult NominalDiffTime

    Convertible SqlValue DiffTime 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult DiffTime

    Convertible SqlValue Day 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult Day

    Convertible SqlValue SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult SqlValue

    Convertible SqlValue CalendarTime 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult CalendarTime

    Convertible SqlValue ClockTime 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult ClockTime

    Convertible SqlValue TimeDiff 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult TimeDiff

    Convertible CalendarTime SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: CalendarTime -> ConvertResult SqlValue

    Convertible ClockTime SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: ClockTime -> ConvertResult SqlValue

    Convertible TimeDiff SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: TimeDiff -> ConvertResult SqlValue

    Convertible SqlValue a => Convertible SqlValue (Maybe a) 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult (Maybe a)

    Convertible SqlValue (TimeOfDay, TimeZone) 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: SqlValue -> ConvertResult (TimeOfDay, TimeZone)

    Convertible a SqlValue => Convertible (Maybe a) SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: Maybe a -> ConvertResult SqlValue

    MonadState [SqlValue] (ToSql a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    get :: ToSql a [SqlValue] #

    put :: [SqlValue] -> ToSql a () #

    state :: ([SqlValue] -> (a0, [SqlValue])) -> ToSql a a0 #

    Convertible (TimeOfDay, TimeZone) SqlValue 
    Instance details

    Defined in Database.HDBC.SqlValue

    Methods

    safeConvert :: (TimeOfDay, TimeZone) -> ConvertResult SqlValue

    class IConnection conn => HasOrvilleContext conn m | m -> conn where Source #

    Migration Guide: HasOrvilleContext has been renamed to HasOrvilleState. + getOrvilleEnv and localOrvilleEnv have been renamed to askOrvilleState + and localOrvilleState.

    HasOrvilleContext defines the operations that must be available in your own + monad for managing the connection pool that Orville functions will use to + access the database and manage transaction state. In most cases you can + include OrvilleT in your Monad stack and then automatically derive an + instance of HasOrvilleContext.

    You could also provide your own implementations of these functions + instead of using OrvilleT, if that is the easiest approach for + your Monad.

    Methods

    getOrvilleEnv :: m (OrvilleEnv conn) Source #

    getOrvilleEnv fetches the Orville environment from the Monad context. + Analogous to ask from the Reader monad.

    localOrvilleEnv Source #

    Arguments

    :: (OrvilleEnv conn -> OrvilleEnv conn) 
    -> m a 
    -> m a

    localOrvilleEnv locally modifies the Orville environment for the + scope of the provided action. This allows Orville to track with + a connection is acquired, open transactions, etc. Analogous to local + from the Reader monad.

    Instances
    (Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (ResourceT m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.ResourceT

    Methods

    getOrvilleEnv :: ResourceT m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> ResourceT m a -> ResourceT m a Source #

    (Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (StateT s m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    getOrvilleEnv :: StateT s m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> StateT s m a -> StateT s m a Source #

    (IConnection conn, Monad m) => HasOrvilleContext conn (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    getOrvilleEnv :: OrvilleT conn m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleT conn m a -> OrvilleT conn m a Source #

    (Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (ReaderT a m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    getOrvilleEnv :: ReaderT a m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> ReaderT a m a0 -> ReaderT a m a0 Source #

    (Monad m, IConnection conn) => HasOrvilleContext conn (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    getOrvilleEnv :: OrvilleTriggerT trigger conn m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a Source #

    class (Monad m, MonadIO m, HasOrvilleContext conn m, MonadThrow m, MonadOrvilleControl m, MonadFail m) => MonadOrville conn m Source #

    Migration Guide: MonadOrville retains the same name, but the conn + parameter has been removed. MonadFail and MonadThrow have been removed as + superclass constraints.

    MonadOrville does not have any methods of its own. Instead it brings all + the typeclass constraints required by Orville functions that need to access + the database into a single typeclass. In some cases you can include + OrvilleT in your Monad stack and then automatically derive an instance of + MonadOrville. However, more likely you are using some third party monad + somewhere in your stack that does not han a MonadOrvilleControl instance. + In this case you won't be able to derive MonadOrville, but providing a + simple empty instance will do:

       instance O.MonadOrville Postgres.Connection MyMonad
    + 
    Instances
    (MonadUnliftIO m, MonadOrville conn m) => MonadOrville conn (ResourceT m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.ResourceT

    (Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    (Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrville conn m) => MonadOrville conn (ReaderT a m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    (Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a Source #

    Migration Guide: runOrville now operates on the concrete Orville monad + becase OrvilleT has been removed. Assuming you are replacing usages of + OrvilleT with ReaderT you will want to replace usages of runOrville + with runReaderT.

    mapOrvilleT :: Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b Source #

    Migration Guide: mapOrvilleT has been removed because OrvilleT has been + removed. If you're replacing OrvilleT with ReaderT then mapOrvilleT + should be replaced with mapReaderT.

    class MonadOrvilleControl m where Source #

    Migration Guide: MonadOrvilleControl retains the same name. The + liftFinally member has been removed. There are new liftCatch and + liftMask members that must be implemented, however. Instances of the new + MonadOrvilleControl are provided for IO and ReaderT. Helper functions + for implmenting the members via UnliftIO can be found in + Orville.PostgreSQL.UnliftIO.

    MonadOrvilleControl provides an interface for the kinds of IO operations + that Orville functions need to lift into the Monad providing the + MonadOrville instance. This typeclass allows users to provide their + own lifting strategies in case the Monad stack in question has special + needs. If you are only using ReaderT and OrvilleT layers in your + monad stack, you can probably implement this for your own Monad wrapper + type using the provided default functions and providing functions to + wrap and unwrapper your Monad layer:

       instance MonadOrvilleControl MyMonad where
    +     liftWithConnection = defaultLiftWithConnection wrapMyMonad unWrapMyMonad
    +     liftFinally = defaultLiftFinally wrapMyMonad unWrapMyMonad
    +  

    If you are using transformers in your monad stack beyond ReaderT, they + probably don't provide MonadOrvilleControl instances (e.g. third party + libraries). In this case, see MonadUnliftIO for more + help. If you're still stuck (because your library doesn't support + MonadTransControl), try MonadBaseControl instead. If + you're *still* stuck after that, please file an issue on Github at + https://github.com/flipstone/orville so we can can help out!

    Methods

    liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c Source #

    Instances
    MonadOrvilleControl IO Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> IO b) -> IO b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> IO c -> IO d -> IO c Source #

    (MonadOrvilleControl m, MonadUnliftIO m) => MonadOrvilleControl (ResourceT m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.ResourceT

    Methods

    liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> ResourceT m b) -> ResourceT m b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> ResourceT m c -> ResourceT m d -> ResourceT m c Source #

    MonadOrvilleControl m => MonadOrvilleControl (ReaderT a m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    liftWithConnection :: (forall a0. (conn -> IO a0) -> IO a0) -> (conn -> ReaderT a m b) -> ReaderT a m b Source #

    liftFinally :: (forall a0 b. IO a0 -> IO b -> IO a0) -> ReaderT a m c -> ReaderT a m d -> ReaderT a m c Source #

    MonadBaseControl IO m => MonadOrvilleControl (StateT a m) Source #

    Because lifting control operations into StateT is fraught with peril, a + MonadOrvilleControl instance for StateT is provided here and implemented + via MonadBaseControl rather than together with the MonadOrvilleControl + definition. We do not recommend using stateful Monad transformer layers in + Monad stacks based on IO. For anyone that must, this is the canonical + instance for StateT

    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    Methods

    liftWithConnection :: (forall a0. (conn -> IO a0) -> IO a0) -> (conn -> StateT a m b) -> StateT a m b Source #

    liftFinally :: (forall a0 b. IO a0 -> IO b -> IO a0) -> StateT a m c -> StateT a m d -> StateT a m c Source #

    MonadOrvilleControl m => MonadOrvilleControl (OrvilleT conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Monad

    Methods

    liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleT conn m b) -> OrvilleT conn m b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleT conn m c -> OrvilleT conn m d -> OrvilleT conn m c Source #

    (Monad m, MonadOrvilleControl m) => MonadOrvilleControl (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleTriggerT trigger conn m c -> OrvilleTriggerT trigger conn m d -> OrvilleTriggerT trigger conn m c Source #

    defaultLiftWithConnection :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a. (conn -> IO a) -> IO a) -> (conn -> n b) -> n b Source #

    Migration Guide: defaultLiftWithConnection has been removed. In its + place you can use either the ReaderT instance of MonadOrvilleControl + or the helpers in Orville.PostgreSQL.UnliftIO.

    defaultLiftWithConnection provides a simple definition of + liftWithConnection for MonadOrvilleControl instances when the Monad in + question is a wrapper around a type that already implements + MonadOrvilleControl

    defaultLiftFinally :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a b. IO a -> IO b -> IO a) -> n c -> n d -> n c Source #

    Migration Guide: defaultLiftWithConnection has been removed (along with + liftFinally)

    defaultLiftFinally provides a simple definition of + liftWithConnection for MonadOrvilleControl instances when the Monad in + question is a wrapper around a type that already implements + MonadOrvilleControl

    data QueryType Source #

    withCachedConnection :: MonadOrville conn m => m a -> m a Source #

    Migration Guide: withCachedConnection has been renamed to withConnection_

    Runs an action with a cached connection. + Without using this, or wrapping calls in a transaction using withTransaction, successive + calls to functions like insertRecord and updateRecord are *not* guaranteed to occur on the + same connection.

    withTransaction :: MonadOrville conn m => m a -> m a Source #

    Migration Guide: withTransaction retains the same name.

    data ColumnFlag Source #

    Migration Guide: ColumnFlag has been removed. Depending on flag constructor + there may or may not be a replacement.

    ColumnDefault - replaced by the setDefaultValue function in new orville + Unique - replaced by the addUniqueConstraint function in new orville + References - replaced by the addForeignKeyConstraint function in new orville + ColumnDescription - removed + AssignedByDatabase - removed, though many cases are handled by marshallReadOnlyField

    Constructors

    ColumnDefault a => Default a 
    Unique 
    References (TableDefinition readEntity writeEntity key) (FieldDefinition nullability key) 
    ColumnDescription String 
    AssignedByDatabase 

    data Now Source #

    Constructors

    Now 

    data FieldDefinition nullability a Source #

    Migration Guide: The signature of the FieldDefinition type has not changed, + but many of the constructors and accessors have. See the migration guides + on individual functions for more info.

    Instances
    ColumnSpecifier (FieldDefinition nullability a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.FromSql

    Methods

    selectForm :: FieldDefinition nullability a -> SelectForm Source #

    data Nullable Source #

    Nullable is a values-less type used to track that a FieldDefinition + represents a field that is marked nullable in the database schema. See the + Nullability type for the value-level representation of field nullability.

    data NotNull Source #

    'NotNull is a values-less type used to track that a FieldDefinition + represents a field that is marked not-null in the database schema. See the + Nullability type for the value-level representation of field nullability.

    data Nullability nullability where Source #

    Nullability represents whether a field will be marked as NULL or 'NOT + NULL' in the database schema. It is a GADT so that the value constructors + can be used to record this knowledge in the type system as well. This allows + functions that work only on Nullable or NotNull fields to indicate this + in their type signatures as appropriate.

    isFieldNullable :: FieldDefinition nullability a -> Bool Source #

    Migration Guide: isFieldNullable has been replaced with + fieldIsNotNullable, which has the same signture but the Bool returned is + the opposite.

    fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a Source #

    Migration Guide: fieldOfType is essentially unchanged in the new orville.

    textField :: String -> Int -> FieldDefinition NotNull Text Source #

    Migration Guide: textField has been renamed to boundedTextField. It now + takes an Int32 rather than an Int

    fixedTextField :: String -> Int -> FieldDefinition NotNull Text Source #

    Migration Guide: fixedTextField retains the same name. It now + takes an Int32 rather than an Int

    unboundedTextField :: String -> FieldDefinition NotNull Text Source #

    Migration Guide: unboundedTextField retains the same name.

    dayField :: String -> FieldDefinition NotNull Day Source #

    Migration Guide: dayField has been renamed to dateField

    utcTimeField :: String -> FieldDefinition NotNull UTCTime Source #

    Migration Guide: utcTimeField has been renamed to utcTimestampField

    int32Field :: String -> FieldDefinition NotNull Int32 Source #

    Migration guide: int32Field has been renamed to integerField

    int64Field :: String -> FieldDefinition NotNull Int64 Source #

    Migration guide: int64Field has been renamed to bigIntegerField

    doubleField :: String -> FieldDefinition NotNull Double Source #

    Migration guide: doubleField retains the same name.

    boolField :: String -> FieldDefinition NotNull Bool Source #

    Migration guide: boolField has been renamed to booleanField

    automaticIdField :: String -> FieldDefinition NotNull Int32 Source #

    Migration guide: automaticIdField has been renamed to serialField

    searchVectorField :: String -> FieldDefinition NotNull Text Source #

    Migration guide: searchVectorField has been renamed to textSearchVectorField

    nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a) Source #

    Migration Guide: nullableField retains the same name

    Makes a NotNull field Nullable by wrapping the Haskell type of the field + in Maybe. The field will be marked as NULL in the database schema and + the value Nothing will be used to represent NULL values when converting + to and from sql.

    foreignKeyField :: String -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> FieldDefinition nullability key Source #

    Migration Guide: foreignKeyField has been removed. It is replaced by + addForeignKeyConstraint which adds a foreign key constraint to an existing + FieldDefinition.

    withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a Source #

    Migration Guide: withFlag has been removed. See the migration guide + on ColumnFlag regarding the new API.

    withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a Source #

    Migration Guide: withName has been removed.

    withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b Source #

    Migration Guide: withConversion has been replaced with convertField, + whose arguments are flipped from those of withConversion. Note there is + also now a coerceField function that can be used with newtype wrappers, + provided the constructor is available where coerceField is used.

    fieldFromSql :: FieldDefinition nullability a -> FromSql a Source #

    Migration Guide: fieldFromSql has been replaced with fieldValueFromSqlValue

    fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue Source #

    Migration Guide: fieldToSqlValue has been renamed to fieldValueToSqlValue

    data SomeField Source #

    Constructors

    SomeField (FieldDefinition nullability a) 

    withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a Source #

    Migration Guide: withPrefix has been replaced by prefixField whose + arguments are flipped relative to withPrefix

    fieldType :: FieldDefinition nullability a -> SqlType a Source #

    fieldFlags :: FieldDefinition nullability a -> [ColumnFlag] Source #

    fieldFlags has been removed. See the new fieldDefaultValue and fieldTableConstraints functions

    uniqueIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition Source #

    Migration Guide: uniqueIndex no longer requires a name to be specified. + Migration will be done automatically by inspecting the structure of the + indexes that exist in the database. It also no longer accepts a + TableDefinition at the time of creating the IndexDefinition. Instead you + should use addTableIndexes to add the IndexDefinition to the + TableDefinition for the table that you wish to index.

    If you wish to specify the index name explicitly, you can use + uniqueNamedIndex instead. If you do so, index migration will be managed by + comparing to the names of existing indexes rather than checking that the + index structure matches the Haskell definition.

    simpleIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition Source #

    Migration Guide: simpleIndex has been renamed to nonUniqueIndex. It no + longer requires a name to be specified. Migration will be done automatically + be inspecting the structure of the indexes that exist in the database. It + also no longer accepts a TableDefinition at the time of creating the + IndexDefinition. Instead you should use addTableIndexes to add the + IndexDefinition to the TableDefinition for the table that you wish to + index.

    If you wish to specify the index name explicitly, you can use + nonUniqueNamedIndex instead. If you do so, index migration will be managed + by comparing to the names of existing indexes rather than checking that the + index structure matches the Haskell definition.

    simplePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition Source #

    Works much the same as simpleIndex but takes a list of strings that are the conditions of a + where clause on index creation for partial indexes

    uniquePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition Source #

    Works much the same as uniqueIndex but takes a list of strings that are the conditions of a + where clause on index creation for partial indexes

    uniqueConstraint :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> ConstraintDefinition Source #

    Migration Guide: uniqueConstraint no longer accepts a name parameter. + Instead the constraint is migrated automatically based on the structure of + existing constraints found in the database. It also no longer accepts a + TableDefinition. Instead you should use addTableConstraints to add the + ConstraintDefinition to the table that you wish to apply the constraint to.

    dropConstraint :: TableDefinition readEntity writeEntity key -> String -> SchemaItem Source #

    Migration Guide: dropConstraint has been removed. Constraints are now + dropped automatically during auto-migration when they are removed from the + TableDefinition.

    data FromSql a Source #

    Instances
    Functor FromSql Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    fmap :: (a -> b) -> FromSql a -> FromSql b #

    (<$) :: a -> FromSql b -> FromSql a #

    Applicative FromSql Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    pure :: a -> FromSql a #

    (<*>) :: FromSql (a -> b) -> FromSql a -> FromSql b #

    liftA2 :: (a -> b -> c) -> FromSql a -> FromSql b -> FromSql c #

    (*>) :: FromSql a -> FromSql b -> FromSql b #

    (<*) :: FromSql a -> FromSql b -> FromSql a #

    data FromSqlError Source #

    Constructors

    RowDataError !RowDataErrorDetails

    Captures a failure in the translation of a SQL value from a particular + field to it's corresponding Haskell values.

    MissingColumn !MissingColumnDetails

    An expected column was not returned by the database

    ConversionError !ConversionErrorDetails

    A conversion between haskell representations failed at a point where + we don't know what column the value came from. This is the case when + using the partialMap combinator.

    data RowDataErrorDetails Source #

    Constructors

    RowDataErrorDetails 

    Fields

    data RowDataErrorReason Source #

    Constructors

    TypeMismatch

    Sql value has a different type than expected

    Fields

    IntegralOutOfBounds

    An integer value was outside the expected bounds.

    Fields

    DecodingFailure !String

    Generic decoding failure

    data ConversionErrorDetails Source #

    Constructors

    ConversionErrorDetails 

    Fields

    showFromSqlErrorMinimal :: FromSqlError -> String Source #

    Shows the error in a way that should not contain any potentially sensitive + data. This is used for the Show instance.

    showFromSqlErrorForLogging :: FromSqlError -> String Source #

    Shows the error in a way appropriate for logging within an application. + The resulting string contains information that is useful for debugging but + is potentially undesirable to expose outside of the application (such as + primary key values).

    showSqlValueType :: SqlValue -> String Source #

    User friendly identifier labels for SqlValues

    col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a Source #

    data ToSql a b Source #

    Instances
    MonadReader a (ToSql a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    ask :: ToSql a a #

    local :: (a -> a) -> ToSql a a0 -> ToSql a a0 #

    reader :: (a -> a0) -> ToSql a a0 #

    Monad (ToSql a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    (>>=) :: ToSql a a0 -> (a0 -> ToSql a b) -> ToSql a b #

    (>>) :: ToSql a a0 -> ToSql a b -> ToSql a b #

    return :: a0 -> ToSql a a0 #

    fail :: String -> ToSql a a0 #

    Functor (ToSql a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    fmap :: (a0 -> b) -> ToSql a a0 -> ToSql a b #

    (<$) :: a0 -> ToSql a b -> ToSql a a0 #

    Applicative (ToSql a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    pure :: a0 -> ToSql a a0 #

    (<*>) :: ToSql a (a0 -> b) -> ToSql a a0 -> ToSql a b #

    liftA2 :: (a0 -> b -> c) -> ToSql a a0 -> ToSql a b -> ToSql a c #

    (*>) :: ToSql a a0 -> ToSql a b -> ToSql a b #

    (<*) :: ToSql a a0 -> ToSql a b -> ToSql a a0 #

    MonadState [SqlValue] (ToSql a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Types

    Methods

    get :: ToSql a [SqlValue] #

    put :: [SqlValue] -> ToSql a () #

    state :: ([SqlValue] -> (a0, [SqlValue])) -> ToSql a a0 #

    getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity () Source #

    getComponent :: (entity -> a) -> ToSql a () -> ToSql entity () Source #

    data SchemaItem Source #

    Migration Guide: SchemaItem retains the same name. The Index, + DropIndex, Constraint and DropConstraint constructors have been + removed. These items are now added to the TableDefinition via + addTableConstraints and addTableIndexes. The remaining constructors have + been prefixed with the word Schema (e.g. Table has been renamed to + SchemaTable). There is no explicit replacement for DropIndex and + DropConstraint. Orville will automatically drop indexes and constraints + that are no longer mentioned on the TableDefinition for any tables that it + migrates.

    type SchemaDefinition = [SchemaItem] Source #

    Migration Guide: SchemaDefinition has been removed. Use [SchemaItem] + instead.

    type Record = Int Source #

    Migration Guide: Record has been removed. It's recommended that you + create a separate record key type for each of your entities instead.

    whereAnd :: [WhereCondition] -> WhereCondition Source #

    Migration Guide: whereAnd has been removed. Use the binary function + andExpr to combine BooleanExpr expressions instead. andExpr is also + available as the operator (.&&)

    whereOr :: [WhereCondition] -> WhereCondition Source #

    Migration Guide: whereOr has been removed. Use the binary function + orExpr to combine BooleanExpr expressions instead. orExpr is also + available as the operator (.||)

    whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition Source #

    Migration Guide: whereIn has been renamed to fieldIn. It now takes a + NonEmpty list of values to reflect this is a requirement in SQL.

    whereLike :: FieldDefinition nullability a -> String -> WhereCondition Source #

    Migration Guide: whereLike has been renamed to fieldLike. It now takes a + T.Text value rather than a String.

    whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition Source #

    Migration Guide: whereLikeInsensitive has been renamed to + fieldLikeInsensitive. It now takes a T.Text value rather than a String.

    whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition Source #

    Migration Guide: whereNotIn has been renamed to fieldNotIn. It now takes a + NonEmpty list of values to reflect this is a requirement in SQL.

    whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition Source #

    Migration Guide: whereQualified has been removed. If you need qualified + column references you can use the SQL building functions found in + Orville.PostgreSQL.Expr to build them. The qualifyColumn function can be + used to qualify column references in that context. BooleanExpr values built + directly this way can be easily used in conjuction with other helpers such as + fieldEquals which also build BooleanExpr values themselves.

    whereRaw :: String -> [SqlValue] -> WhereCondition Source #

    Migration Guide: whereRaw has been removed. In its place you should use the + more general functions such as unsafeSqlExpression or unsafeRawSql in the + Orville.PostgreSQL.Raw.RawSql module to build a BooleanExpr.

    whereToSql :: [WhereCondition] -> (String, [SqlValue]) Source #

    Migration Guide: whereToSql has been removed. It is replaced by the more + general toBytesAndParams function in Orville.PostgreSQL.Raw.RawSql.

    isNull :: FieldDefinition Nullable a -> WhereCondition Source #

    Migration Guide: isNull has been renamed to fieldIsNull

    isNotNull :: FieldDefinition Nullable a -> WhereCondition Source #

    Migration Guide: isNotNull has been renamed to fieldIsNotNull

    (.==) :: FieldDefinition nullability a -> a -> WhereCondition Source #

    (.<>) :: FieldDefinition nullability a -> a -> WhereCondition Source #

    (.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition Source #

    (%==) :: FieldDefinition nullability a -> a -> WhereCondition Source #

    (.>) :: FieldDefinition nullability a -> a -> WhereCondition Source #

    (.>=) :: FieldDefinition nullability a -> a -> WhereCondition Source #

    (.<) :: FieldDefinition nullability a -> a -> WhereCondition Source #

    (.<=) :: FieldDefinition nullability a -> a -> WhereCondition Source #

    order :: ToOrderBy a => a -> SortDirection -> SelectOptions Source #

    groupBy :: ToGroupBy a => a -> SelectOptions Source #

    (<>) :: Semigroup a => a -> a -> a infixr 6 #

    An associative operation.

    (.:=) :: FieldDefinition nullability a -> a -> FieldUpdate Source #

    migrateSchema :: MonadOrville conn m => SchemaDefinition -> m () Source #

    Migration Guide: migrateSchema has been renamed to autoMigrateSchema

    migrateSchema will attempt to make changes to the actual database schema + that it it matches the provided SchemaDefinition. Unsafe migrations such as + dropping tables or columns are never attempted unless the SchemaDefinition + explicitly states that the items are safe to drop. Column types may be changed, + but will fail if the database cannot successfully make the request type change.

    generateMigrationPlan :: MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan) Source #

    Migration Guide: generateMigrationPlan retains the same name. It has + changed to always return a MigrationPlan. You can use check whether + migrationPlanSteps is as empty list if you wish to determine whether any + migrations will be performed by the plan.

    generateMigrationPlan inspects the state of the actual database schema and + constructs a plan describing what changes would be made to make it match the + provided SchemaDefinition. If the actual schema already matches the + definition, Nothing will be returned.

    data MigrationPlan Source #

    Migration Guide: MigrationPlan retains the same name.

    data MigrationItem Source #

    Migration Guide: MigrationItem has been renamed to MigrationStep, which + is now a simple RawSql wrapper. You can use RawSql.toExampleBytes if you + wish to render it to a bytestring for display purposes.

    migrationPlanItems :: MigrationPlan -> [MigrationItem] Source #

    Migration Guide: migrationPlanItems has been renamed to + migrationPlanSteps

    data Pagination m entity Source #

    Constructors

    Pagination 

    Fields

    buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> m (Pagination m readEnt) Source #

    selectAll :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m [readEntity] Source #

    Migration Guide: selectAll has been renamed to findEntitiesBy

    selectFirst :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m (Maybe readEntity) Source #

    Migration Guide: selectFirst has been renamed to findFirstEntityBy

    deleteRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m () Source #

    Migration Guide: deleteRecord has been renamed to deleteEntity. Note + that there are also new variant functions deleteAndReturnEntity and + deleteEntityAndReturnRowCount that return Maybe readEntity and Int + respectively.

    deleteWhere :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [WhereCondition] -> m Integer Source #

    Migration Guide: deleteWhere has been renamed to deleteEntities. It + now takes a Maybe BooleanExpr rather than [WhereCondition]

    findRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m (Maybe readEntity) Source #

    Migration Guide: findRecord has been renamed to findEntity

    findRecords :: (Ord key, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> [key] -> m (Map key readEntity) Source #

    Migration Guide: findRecords has been renamed to findEntities. It now + requires a NonEmpty key rather than simply [key] and returns a + [readEntity] instead of a Map.

    findRecordsBy :: (Ord fieldValue, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> m (Map fieldValue [readEntity]) Source #

    Migration Guide: findRecordsBy has been renamed to findEntitiesBy. It + no longer takes a FieldDefinition to group by. Instead it simply returns + a [readEntity]

    insertRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity Source #

    Migration Guide: insertRecord has been renamed to insertAndReturnEntity. + Note there are also new variant functions insertEntity and + insertEntityAndReturnRowCount that return () and Int respectively.

    insertRecordMany :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m () Source #

    Migration Guide: insertRecordMany has been renamed to insertEntities. It + now requires a NonEmpty writeEntity rather than [writeEntity]. Note that + there are also new variant functions insertAndReturnEntities and + insertEntitiesAndReturnRowCount.

    insertRecordManyReturning :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m [readEntity] Source #

    Migration Guide: insertRecordManyReturning has been renamed to + insertAndReturnEntities.

    updateFields :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [FieldUpdate] -> [WhereCondition] -> m Integer Source #

    Migration Guide: updateFields has been renamed to + updateFieldsAndReturnRowCount, but now takes a NonEmpty SetClause instead + of a [Field Update] and a Maybe BooleanExpr instead of a + [WhereCondition].

    updateFields still exists as a variant of this function, but returns () + rather than Int. updateFieldsAndReturnEntities is now available as well.

    updateRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> writeEntity -> m () Source #

    Migration Guide: updateRecord has been renamed to updateEntity. Note that + there are also new variant functions updateAndReturnEntity and + updateEntityAndReturnRowCount@.

    createIndexesConcurrently :: MonadOrville conn m => [IndexDefinition] -> m () Source #

    Migration Plan: createIndexesConcurrently has been removed. You should now + use setIndexCreationStrategy Asynchronous instead.

    createIndexesConcurrently will create the given indexes, if they do not exist using the + PostgreSQL concurrently feature. However, this does *not* mean the the function happens + concurrently. This will wait for PostgreSQL to return, but other operations to the table will be + allowed during index creation.

    Note: PostgreSQL does not allow CREATE INDEX CONCURRENTLY to appear inside of a transaction. Use + this function with care.

    dropIndexesConcurrently :: MonadOrville conn m => [String] -> m () Source #

    Migration Guide: dropIndexesConcurrently has been removed.

    dropIndexesConcurrently will drop each of the given indexes with the CONCURRENTLY keyword, + allowing for other table operations to continue while the index is dropped. However there are + several caveats that come with this as noted at + https://www.postgresql.org/docs/9.6/sql-dropindex.html . Much like createIndexesConcurrently + this cannot be used in a transaction. But further this cannot drop indexes that support UNIQUE or + PRIMARY KEY constraints.

    Use this with care.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html new file mode 100644 index 0000000..5a0c074 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Expr.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Expr

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Expr

    Description

     

    Documentation

    data Expr a Source #

    Instances
    GenerateSql a => GenerateSql (Expr a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Expr.Expr

    expr :: a -> Expr a Source #

    qualified :: QualifySql form => form -> String -> form Source #

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html new file mode 100644 index 0000000..2701b21 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadBaseControl.html @@ -0,0 +1,31 @@ +Database.Orville.PostgreSQL.MonadBaseControl

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.MonadBaseControl

    Description

    MonadBaseControl provides functions and instances for +using MonadOrville and OrvilleT for situations where you need to use +MonadBaseControl. If you do not know if you need MonadBaseControl, then +you probably don't need to use this module. If you are thinking about +using MonadBaseControl instead of MonadUnliftIO, we recommend +reading Michael Snoyman's excellent "A Tale of Two Brackets" +(https:/www.fpcomplete.comblog201706/tale-of-two-brackets) if you +have not already done so.

    If you're still here after reading above, this module provides +the functions you need to implement MonadOrvilleControl for your +Monad stack using its MonadBaseControl instance. The most common way +to do this is simply to add the following MonadOrvilleControl instance:

     instance MonadOrvilleControl MyMonad where
    +   liftWithConnection = liftWithConnectionViaBaseControl
    +   liftFinally = liftFinallyViaBaseControl
    +

    This module also provides a MonadOrvilleControl for StateT as well as +MonadBaseControl and MonadTransControl instances for OrvilleT and +OrvilleTriggerT.

    Synopsis

    Documentation

    liftWithConnectionViaBaseControl :: MonadBaseControl IO m => (forall b. (conn -> IO b) -> IO b) -> (conn -> m a) -> m a Source #

    liftWithConnectionViaBaseControl can be use as the implementation of + liftWithConnection for MonadOrvilleControl when the Monad + implements MonadBaseControl.

    liftFinallyViaBaseControl :: MonadBaseControl IO m => (forall c d. IO c -> IO d -> IO c) -> m a -> m b -> m a Source #

    liftFinallyViaBaseControl can be use as the implementation of + 'liftFinally for MonadOrvilleControl when the Monad + implements MonadBaseControl.

    Orphan instances

    MonadBaseControl b m => MonadBaseControl b (OrvilleT conn m) Source #

    Because we recommend using MonadUnliftIO rather than MonadBaseControl, + we do not provide MonadBaseControl instance for OrvilleT by default + along with the definition. If you do need to use MonadBaseControl, + however, this is the canonical instance for OrvilleT.

    Instance details

    Associated Types

    type StM (OrvilleT conn m) a :: Type

    Methods

    liftBaseWith :: (RunInBase (OrvilleT conn m) b -> b a) -> OrvilleT conn m a

    restoreM :: StM (OrvilleT conn m) a -> OrvilleT conn m a

    MonadBaseControl b m => MonadBaseControl b (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Associated Types

    type StM (OrvilleTriggerT trigger conn m) a :: Type

    Methods

    liftBaseWith :: (RunInBase (OrvilleTriggerT trigger conn m) b -> b a) -> OrvilleTriggerT trigger conn m a

    restoreM :: StM (OrvilleTriggerT trigger conn m) a -> OrvilleTriggerT trigger conn m a

    MonadTransControl (OrvilleT conn) Source #

    Because we recommend using MonadUnliftIO rather than MonadTransControl, + we do not provide MonadTransControl instance for OrvilleT by default + along with the definition. If you do need to use MonadTransControl, + however, this is the canonical instance for OrvilleT.

    Instance details

    Associated Types

    type StT (OrvilleT conn) a :: Type

    Methods

    liftWith :: Monad m => (Run (OrvilleT conn) -> m a) -> OrvilleT conn m a

    restoreT :: Monad m => m (StT (OrvilleT conn) a) -> OrvilleT conn m a

    MonadTransControl (OrvilleTriggerT trigger conn) Source # 
    Instance details

    Associated Types

    type StT (OrvilleTriggerT trigger conn) a :: Type

    Methods

    liftWith :: Monad m => (Run (OrvilleTriggerT trigger conn) -> m a) -> OrvilleTriggerT trigger conn m a

    restoreT :: Monad m => m (StT (OrvilleTriggerT trigger conn) a) -> OrvilleTriggerT trigger conn m a

    MonadBaseControl IO m => MonadOrvilleControl (StateT a m) Source #

    Because lifting control operations into StateT is fraught with peril, a + MonadOrvilleControl instance for StateT is provided here and implemented + via MonadBaseControl rather than together with the MonadOrvilleControl + definition. We do not recommend using stateful Monad transformer layers in + Monad stacks based on IO. For anyone that must, this is the canonical + instance for StateT

    Instance details

    Methods

    liftWithConnection :: (forall a0. (conn -> IO a0) -> IO a0) -> (conn -> StateT a m b) -> StateT a m b Source #

    liftFinally :: (forall a0 b. IO a0 -> IO b -> IO a0) -> StateT a m c -> StateT a m d -> StateT a m c Source #

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html new file mode 100644 index 0000000..12fcd88 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-MonadUnliftIO.html @@ -0,0 +1,14 @@ +Database.Orville.PostgreSQL.MonadUnliftIO

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.MonadUnliftIO

    Description

    MonadUnliftIO provides functions and instances for using +MonadOrville and OrvilleT for Monad transformer stacks that are using +MonadUnliftIO. The most common way to do this is simply to add the +following MonadOrvilleControl instance:

     instance MonadOrvilleControl MyMonad where
    +   liftWithConnection = liftWithConnectionViaUnliftIO
    +   liftFinally = liftFinallyViaUnliftIO
    +

    This module also provides a MonadUnliftIO instance for OrvilleT and OrvilleTrigger. +|

    Synopsis

    Documentation

    liftWithConnectionViaUnliftIO :: MonadUnliftIO m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b Source #

    liftWithConnectionViaUnliftIO can be use as the implementation of + liftWithConnection for MonadOrvilleControl when the Monad + implements MonadUnliftIO. + |

    liftFinallyViaUnliftIO :: MonadUnliftIO m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c Source #

    liftFinallyViaUnliftIO can be use as the implementation of + liftFinally for MonadOrvilleControl when the Monad + implements MonadUnliftIO. + |

    Orphan instances

    MonadUnliftIO m => MonadUnliftIO (OrvilleT conn m) Source # 
    Instance details

    Methods

    askUnliftIO :: OrvilleT conn m (UnliftIO (OrvilleT conn m))

    withRunInIO :: ((forall a. OrvilleT conn m a -> IO a) -> IO b) -> OrvilleT conn m b

    MonadUnliftIO m => MonadUnliftIO (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Methods

    askUnliftIO :: OrvilleTriggerT trigger conn m (UnliftIO (OrvilleTriggerT trigger conn m))

    withRunInIO :: ((forall a. OrvilleTriggerT trigger conn m a -> IO a) -> IO b) -> OrvilleTriggerT trigger conn m b

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html new file mode 100644 index 0000000..d6d9d7e --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Explanation.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Plan.Explanation

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html new file mode 100644 index 0000000..8540c84 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Many.html @@ -0,0 +1,30 @@ +Database.Orville.PostgreSQL.Plan.Many

    orville-postgresql-legacy-0.9.0.1: ORM

    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Plan.Many

    Synopsis

    Documentation

    data Many k a Source #

    A 'Many k a' represents a group of values keyed by list of parameters and + is used to return the results of executing an Orville Plan with a list of + input parameters. If you need to find the result of the query associated + with a particular input parameter, you can use lookup to find it. If you + don't care about the association with particular inputs, you can simply + use elems to get a list of all the results.

    Instances
    Functor (Many k) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Plan.Many

    Methods

    fmap :: (a -> b) -> Many k a -> Many k b #

    (<$) :: a -> Many k b -> Many k a #

    data NotAKey Source #

    NotAKey is returned from various Many related functions when presented + with an input parameter that was not one of the original inputs that the + Many was constructed with.

    Constructors

    NotAKey 

    fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a Source #

    fromKeys constructs a Many value from a list of keys and a function that + maps them to their values. The order and duplication of keys in the list will + be preserved by the Many type in the relevant functions. The mapping + function provided should be a total function -- i.e. it should not produce a + runtime error. If it is not possible to map every k (even those not in the + input list provided to fromKeys), the values should be wrapped in an + appropriate type such as Maybe so that an empty or default value can be + returned.

    lookup :: k -> Many k a -> Either NotAKey a Source #

    lookup returns the value for the given parameter. If the given k is + not one of the original input values that the Many was constructed with, + the mapping function given at the contructor will determine what value to + return. Often this will be whatever a reasonable empty or default value for + the type a is.

    keys :: Many k a -> [k] Source #

    keys fetches the list of keys from a Many. Note that is a list and not + a set. Many preserves the order and duplication of any key values that were + in the key list at the time of construction.

    elems :: Many k a -> [a] Source #

    elems returns all the values that correspond the keys of the Many. The + values will be returned in the same order that the keys were present at the + time of creation, though if you truly care about this it's probably better to + use lookup to make that correspondence explicit.

    map :: (a -> b) -> Many k a -> Many k b Source #

    map calls a function on all the values found in a Many collection.

    toMap :: Ord k => Many k a -> Map k a Source #

    toMap converts the Many into a Map value. If all you wanted to do was + find the value for a specific key, you should probably use lookup instead.

    apply :: Many param (a -> b) -> Many param a -> Many param b Source #

    apply allows you to apply many functions to many values. The function + associated with each parameter is applied to the value associated with the + same paremeter.

    (If you're looking for pure or an Applicative instance for Many, this + is as good as it gets. Many cannot be an Applicative because there is no + correct implementation of pure that we can reasonably provide).

    compose :: Many b c -> Many a b -> Many a c Source #

    compose uses the values of a Many value as keys to a second Many to + create a Many mapping from the original keys to the final values.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html new file mode 100644 index 0000000..f5a83ff --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Operation.html @@ -0,0 +1,67 @@ +Database.Orville.PostgreSQL.Plan.Operation

    orville-postgresql-legacy-0.9.0.1: ORM

    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Plan.Operation

    Synopsis

    Documentation

    data Operation param result Source #

    Operation provides a stucture for building primitive operations that can be + incorporated into a Plan. An Operation + provides base case implementations of the various plan execution functions. + You only need to care about this type if you want to create new custom + operations to include in a Plan beyond + those already provided in the Plan + api.

    Constructors

    Operation 

    Fields

    data AssertionFailed Source #

    AssertionFailed may be returned from the execute functions of an + Operation to indicate that some expected invariant has failed. For example, + following a foreign key that is enforced by the database only to find that no + record exists. When an Operation returns an AssertionFailed value during + plan execution the error is thrown as an exception using the + MonadThrow instance for whatever monad the plan is + executing in.

    findOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue (Maybe readEntity) Source #

    findOne builds a planning primitive that finds (at most) one row from the + given table where the column value for the provided FieldDefinition matches + the plan's input parameter. When executed on multiple parameters it fetches + all rows where the field matches the inputs and arbitrarily picks at most one + of those rows to use as the result for each input.

    findOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue (Maybe readEntity) Source #

    findOneWhere is similar to findOne but allows a WhereCondition to be + specified that is added to the database query to restrict which rows are + returned.

    findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue [readEntity] Source #

    findAll builds a planning primitive that finds all the rows from the + given table where the column value for the provided field matches the + plan's input parameter. Where executed on multiple parameters all rows + are fetch in a single query and then associated with their respective + inputs after being fetched.

    findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue [readEntity] Source #

    findAllWhere is similar to findAll but allows a WhereCondition to be + specified that is added to the database query to restrict which rows are + returned.

    findSelect :: Select row -> Operation param [row] Source #

    findSelect builds a plan Operation where the select that is run does not + use the input parameters for the plan in any way. If the + executeOperationMany function of the resulting Operation will run the + query once and use the entire result set as the result each of the input + parameters in turn.

    askParam :: Operation param param Source #

    askParam simply returns the paremeter given from the plan.

    assertRight :: Operation (Either String a) a Source #

    assertRight returns the value on the Right side of an Either. If + the Either is a Left, it raises AssertionFailed with the message + from the left side of the either.

    data SelectOperation param row result Source #

    SelectOperation is a helper type for building Operation primitives that + run Select queries. Specifying the fields of SelectOperation and then + using the selectOperation function to build an Operation is more + convenient that building functions to execute the queries thate are required + by the Operation type.

    Constructors

    SelectOperation 

    Fields

    • selectOne :: param -> Select row

      selectOne will be called to build the Select query that should + be run when there is a single input parameter while executing a plan. + Note that the "One-ness" here refers to the single input parameter + rather than result. See produceResult below for more information + about returning one values vs. many from a SelectOperation.

    • selectMany :: [param] -> Select row

      selectMany will be called to build the Select query that should + be run when there are multiple parameters while executing a plan. + Note that the "Many-ness" here refers to the multiple input parameters + rather than result. See produceResult below for more information + about returning one values vs. many from a SelectOperation.

    • explainSelectOne :: Select row

      explainSelectOne should show a representative query of what will + be returned when selectOne is used. No input parameter is available + here to build the query, however, because this value is used to + explain a plan without actually running it.

    • explainSelectMany :: Select row

      explainSelectMany should show a representative query of what will + be returned when 'selectMany is used. No input parameters are available + here to build the query, however, because this value is used to + explain a plan without actually running it.

    • categorizeRow :: row -> param

      categorizeRow will be used when a plan is executed with multiple + parameters to determine which input parameter the row should be + associated with.

    • produceResult :: [row] -> result

      produceResult will be used convert the row type returned by the + Select queries for the operation input the result type that is + present as the output of the operation. The input rows will be all the + inputs associated with a single parameter. The result type + constructed here need not be a single value. For instance, findAll + uses the list type as the result type and findOne uses Maybe.

    selectOperation :: Ord param => SelectOperation param row result -> Operation param result Source #

    selectOperation builds a primitive planning Operation using the functions + given by a SelectOperation. If you are implementing a custom operation that + runs a select statement, it is probably easier to use this function rather + than building the Operation functions directly.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html new file mode 100644 index 0000000..95b7e1a --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan-Syntax.html @@ -0,0 +1,24 @@ +Database.Orville.PostgreSQL.Plan.Syntax

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2021
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Plan.Syntax

    Description

    This module exports the bind function as >>= so that it can be used in +conjuction with the QualifiedDo language extension to write plans using do +syntax like so:

    +module MyModule where
    +
    +import qualified Orville.PostgreSQL.Plan.Syntax as PlanSyntax
    +
    +data FooFamily =
    +  FooFamily
    +    { foo :: Foo
    +    , children :: [FooChildren]
    +    , pets :: [FooPets]
    +    }
    +
    +findFooFamily = PlanSyntax.do $
    +  fooHeader <- Plan.findOne fooTable fooIdField
    +  fooChildren <- Plan.findAll fooChildTable fooIdField
    +  fooPets <- Plan.findAll fooPetTable fooIdField
    +
    +  FooFamily
    +    $ Plan.use fooHeader
    +    * Plan.use fooChildren
    +    * Plan.use fooPets
    +
    Synopsis

    Documentation

    (>>=) :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result Source #

    An operator alias of bind so that it can be used with QualifiedDo.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html new file mode 100644 index 0000000..4796b95 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Plan.html @@ -0,0 +1,105 @@ +Database.Orville.PostgreSQL.Plan

    orville-postgresql-legacy-0.9.0.1: ORM

    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Plan

    Synopsis

    Documentation

    data Plan scope param result Source #

    A Plan is an executable set of queries that can be executed to load data + from the database, using the results of prior queries as input parameters to + following queries in controlled ways. In particular, the "controlled" aspect + of this allows plans that take a single input to be adapted to take multiple + input parameters in a list without the resulting plan executing N+1 queries. + This restriction means that while query results can be used as input + parameters to later queries, they cannot be used to decide to run completely + different queries based on other query results. Allowing this would prevent + the Plan structure from eliminating N+1 query loops.

    Note that during execution queries are never combined across tables to form + joins or subqueries. Queries are still executed in the same sequence as + specified in the plan, just on all the inputs at once rather than in a loop. + If you need to do a join with a plan, you can always construction your + own custom Operation and use planOperation to incorporate into a plan.

    The param type variable indicates what type of value is expected as input + when the plan is executed.

    The result type for a plan indicates what Haskell type is produced + when the plan is executed.

    The scope type is used internally by Orville to track the plan is currently + executed against a single input or multiple inputs. This type parameter + should never specified as a concrete type in user code, but must be exposed + as a variable to ensure that execute scope is tracked correctly through + usages of bind.

    Instances
    Functor (Plan scope param) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Plan

    Methods

    fmap :: (a -> b) -> Plan scope param a -> Plan scope param b #

    (<$) :: a -> Plan scope param b -> Plan scope param a #

    Applicative (Plan scope param) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Plan

    Methods

    pure :: a -> Plan scope param a #

    (<*>) :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b #

    liftA2 :: (a -> b -> c) -> Plan scope param a -> Plan scope param b -> Plan scope param c #

    (*>) :: Plan scope param a -> Plan scope param b -> Plan scope param b #

    (<*) :: Plan scope param a -> Plan scope param b -> Plan scope param a #

    data Planned scope param a Source #

    A Planned value is a wrapper around the results of previous run queries + when using the bind function. At the time that you are writing a plan you + do not know whether the Plan will be run with a single input or multiple + inputs. A Planned value may end up being either an individual item or a + list of items. Due to this, your ability to interact with the value is + limited to the use of fmap to extract (or build) other values from the + results. Planned values can be used together with the use function to + make a Plan that produces the extracted value.

    Note that while Planned could provide an Applicative instance as well, it + does not to avoid confusion with Applicative instance for Plan itself. + If you need to build a value from several Planned values using + Applicative, you should call use on each of the values and use the + Applicative instance for Plan.

    Instances
    Functor (Planned scope param) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Plan

    Methods

    fmap :: (a -> b) -> Planned scope param a -> Planned scope param b #

    (<$) :: a -> Planned scope param b -> Planned scope param a #

    data Execute Source #

    Execute is a tag type used by as the scope variable for + Plan values when executing them via the execute function.

    data Explain Source #

    Explain is an tag type used as the scope variable when explaining a + Plan via the explain function.

    askParam :: Plan scope param param Source #

    askParam allows the input parameter for the plan to be retrieved as the + result of the plan. Together with bind you can use this to get access to + the input parameter as a Planned value.

    Using a Plan after it is constructed

    execute :: MonadOrville conn m => Plan Execute param result -> param -> m result Source #

    execute accepts the input parameter (or parameters) expected by a Plan + and runs the plan to completion, either throwing an AssertionFailed + exception in the monad m or producing the expected result.

    If you have a plan that takes one input and want to provide a list of + input, use planMany to adapt it to a multple-input plan before calling + execute.

    explain :: Plan Explain param result -> [String] Source #

    explain produces a textual description of the steps outlined by + a Plan -- in most cases example SQL queries. If you want to see + the explanation of how the plan will run with multiple input parameters, + you can use planMany to adapt it before calling explain.

    Making a Plan to find rows in the database

    findMaybeOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue (Maybe readEntity) Source #

    findMaybeOne constructs a Plan that will find at most one row from + the given table where the plan's input value matches the given database + field.

    findMaybeOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue (Maybe readEntity) Source #

    findMaybeOneWhere is similar to findMaybeOne, but allows a + WhereCondition to be specified to restrict which rows are matched by the + database query.

    findOne :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity Source #

    findOne is an alias to findOneShowVia that uses the Show instance of + fieldValue when producing a failure message in the result the entity cannot + be found.

    findOneShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity Source #

    findOneShowVia is similar to 'findMaybeOne, but it expects that there will + always be a row found matching the plan's input value. If no row is found an + AssertionFailed exception will be thrown. This is a useful convenience + when looking up foreign-key associations that are expected to be enforced by + the database itself.

    findOneWhere :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity Source #

    findOneWhere is an alias to findOneWhereShowVia that uses the Show instance of + fieldValue when producing a failure message in the result the entity cannot + be found.

    findOneWhereShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity Source #

    findOneWhereShowVia is similar to findOneShowVia, but allows a WhereCondition to be + specified to restrict which rows are matched by the database query.

    findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue [readEntity] Source #

    findAll constructs a Plan that will find all the rows from the given + table there the plan's input value matches the given database field.

    findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue [readEntity] Source #

    findAllWhere is similar to findAll, but allows a WhereCondition to be + specified to restrict which rows are matched by the database query.

    Creating a multi-step Plan from other Plan values

    bind :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result Source #

    bind gives access to the results of a plan to use as input values to future + plans. The plan result is given the input parameter to the provided function, + which must produce the remaining Plan to be executed. The value will be + wrapped in the Planned type, which may represent either a result or + multiple results, depending on whether one plan is currently be executed with + one and multiple input parameters. This ensures that the caller produces only + a single remaining Plan to be used for all inputs when there are multiple + to eliminate the need to possibly run different queries for different inputs + (which would an introduce N+1 query execution).

    The Planned value (or values) provided by bind have actually been + retrieved from the database, so the value can be used multiple times when + constructing the remaining Plan without fear of causing the query to run + multiple times.

    Also see use for how to lift a Planned value back into a Plan.

    use :: Planned scope param a -> Plan scope param a Source #

    use constructs a Plan that always produces the Planned value + as its result, regardless of the parameter given as input to the plan.

    using :: Planned scope param a -> Plan scope a b -> Plan scope param b Source #

    using uses a Planned value in the input to another Plan. The + resulting plan will ignore its input and use the Planned value as + the input to produce its result instead.

    chain :: Plan scope a b -> Plan scope b c -> Plan scope a c Source #

    chain connects the output of one plan to the input of another to form a + larger plan that will execute the first followed by the second.

    apply :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b Source #

    apply applies a function produced by a plan to the value produced + by another plan. This is usually used via the <*> operator through + the Applicative instance for Plan.

    planMany :: (forall manyScope. Plan manyScope param result) -> Plan scope [param] (Many param result) Source #

    planMany adapts a plan that takes a single input parameter to work on + multiple input parameters. When the new plan is executed each query will + execute in the same basic order, but with adjusted conditions to find all the + rows for all inputs at once rather than running the planned queries once for + each input.

    planList :: (forall scope. Plan scope param result) -> Plan listScope [param] [result] Source #

    planList lifts a plan so both its param and result become lists. + This saves you from having to fmap in elems when all you want back + from a Many is the list of results inside it.

    focusParam :: (a -> b) -> Plan scope b result -> Plan scope a result Source #

    focusParam builds a plan from a function and an existing plan taking the + result of that function as input. This is especially useful when there is some + structure, and a plan that only needs a part of that structure as input. The + function argument can access part of the structure for the plan argument to use, + so the final returned plan can take the entire structure as input.

    planEither :: Plan scope leftParam leftResult -> Plan scope rightParam rightResult -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult) Source #

    planEither lets you construct a plan that branches by executing a different + plan for the Left and Right sides of an Either value. When used with a + single input parameter only one of the two plans will be used, based on the + input parameter. When used on multiple input parameters, each of the two + plans will be executed only once with all the Left and Right values + provided as input parameters respectively.

    planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b) Source #

    planMaybe lifts a plan so both its param and result become Maybes. This is + useful when modifying an existing plan to deal with optionality. Writing just + one plan can then easily produce both the required and optional versions.

    Bridges from other types into Plan

    data AssertionFailed Source #

    AssertionFailed may be returned from the execute functions of an + Operation to indicate that some expected invariant has failed. For example, + following a foreign key that is enforced by the database only to find that no + record exists. When an Operation returns an AssertionFailed value during + plan execution the error is thrown as an exception using the + MonadThrow instance for whatever monad the plan is + executing in.

    assert :: (param -> a -> Either String b) -> Plan scope param a -> Plan scope param b Source #

    assert allows you to make an assertion about a plans result that will throw + an AssertionFailed failed exception during execution if it proves to be + false. The first parameter is the assertion function, which should return + either an error message to be given in the exception or the value to be used + as the plan's result.

    planSelect :: Select row -> Plan scope () [row] Source #

    planSelect allows any Orville Select query to be incorporated into a + plan. Note that the Select cannot depend on the plan's input parameters in + this case. If the plan is executed with multiple inputs the same set of all + the results will be used as the results for each of the input parameters.

    planOperation :: Operation param result -> Plan scope param result Source #

    planOperation allows any primitive Operation to be used as an atomic step + in a plan. When the plan is executed, the appropriate Operation functions + will be used depending on the execution context.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html new file mode 100644 index 0000000..4736a5d --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Popper.html @@ -0,0 +1,4 @@ +Database.Orville.PostgreSQL.Popper

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Popper

    Description

     
    Synopsis

    Documentation

    data PopError Source #

    Constructors

    MissingRecord (TableDefinition readEntity writeEntity key) (PrimaryKey key) key 
    MissingRecordBy (TableDefinition readEntity writeEntity key) (FieldDefinition nullability fieldValue) fieldValue 
    Unpoppable String 

    data Popper a b Source #

    Instances
    Arrow Popper Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Popper

    Methods

    arr :: (b -> c) -> Popper b c #

    first :: Popper b c -> Popper (b, d) (c, d) #

    second :: Popper b c -> Popper (d, b) (d, c) #

    (***) :: Popper b c -> Popper b' c' -> Popper (b, b') (c, c') #

    (&&&) :: Popper b c -> Popper b c' -> Popper b (c, c') #

    ArrowChoice Popper Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Popper

    Methods

    left :: Popper b c -> Popper (Either b d) (Either c d) #

    right :: Popper b c -> Popper (Either d b) (Either d c) #

    (+++) :: Popper b c -> Popper b' c' -> Popper (Either b b') (Either c c') #

    (|||) :: Popper b d -> Popper c d -> Popper (Either b c) d #

    Functor (Popper a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Popper

    Methods

    fmap :: (a0 -> b) -> Popper a a0 -> Popper a b #

    (<$) :: a0 -> Popper a b -> Popper a a0 #

    Applicative (Popper a) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Popper

    Methods

    pure :: a0 -> Popper a a0 #

    (<*>) :: Popper a (a0 -> b) -> Popper a a0 -> Popper a b #

    liftA2 :: (a0 -> b -> c) -> Popper a a0 -> Popper a b -> Popper a c #

    (*>) :: Popper a a0 -> Popper a b -> Popper a b #

    (<*) :: Popper a a0 -> Popper a b -> Popper a a0 #

    Category Popper Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Popper

    Methods

    id :: Popper a a #

    (.) :: Popper b c -> Popper a b -> Popper a c #

    data Popped a Source #

    Instances
    Functor Popped Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Popper

    Methods

    fmap :: (a -> b) -> Popped a -> Popped b #

    (<$) :: a -> Popped b -> Popped a #

    Applicative Popped Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Popper

    Methods

    pure :: a -> Popped a #

    (<*>) :: Popped (a -> b) -> Popped a -> Popped b #

    liftA2 :: (a -> b -> c) -> Popped a -> Popped b -> Popped c #

    (*>) :: Popped a -> Popped b -> Popped b #

    (<*) :: Popped a -> Popped b -> Popped a #

    (>>>) :: Category cat => cat a b -> cat b c -> cat a c infixr 1 #

    Left-to-right composition

    (<<<) :: Category cat => cat b c -> cat a b -> cat a c infixr 1 #

    Right-to-left composition

    fromKern :: (a -> b) -> Popper a b Source #

    hasMany :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue [readEntity] Source #

    hasManyIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue [readEntity]) Source #

    hasOneIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue readEntity) Source #

    hasManyInWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper [fieldValue] (Map fieldValue [readEntity]) Source #

    hasManyWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue [readEntity] Source #

    hasOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue (Maybe readEntity) Source #

    hasOne' :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue readEntity Source #

    hasOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue (Maybe readEntity) Source #

    popMissingRecord :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue PopError Source #

    onKern :: (a -> b -> c) -> Popper b a -> Popper b c Source #

    pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b) Source #

    popThrow :: MonadOrville conn m => Popper a b -> a -> m b Source #

    popFirst :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a (Maybe readEntity) Source #

    popMany :: Popper a b -> Popper [a] [b] Source #

    onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b Source #

    popQuery :: String -> (forall conn m. MonadOrville conn m => m b) -> Popper a b Source #

    popQuery embeds an Orville operation in a popper. It is left up to the + programmer to ensure that the Orville operation does not do any updates + to the database, but only does queries.

    The initial string argument is a description of the query to put into + the results of explain

    popRecord :: TableDefinition readEntity writeEntity key -> key -> Popper a (Maybe readEntity) Source #

    popRecord' :: TableDefinition readEntity writeEntity key -> key -> Popper a readEntity Source #

    popTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a [readEntity] Source #

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html new file mode 100644 index 0000000..2ceb12c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Raw.html @@ -0,0 +1,4 @@ +Database.Orville.PostgreSQL.Raw

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Raw

    Description

     
    Synopsis

    Documentation

    selectSql :: MonadOrville conn m => String -> [SqlValue] -> FromSql result -> m [result] Source #

    decodeSqlRows :: MonadOrville conn m => FromSql result -> ResultSet -> m [result] Source #

    withConnection :: MonadOrville conn m => (conn -> m a) -> m a Source #

    withTransaction :: MonadOrville conn m => m a -> m a Source #

    Migration Guide: withTransaction retains the same name.

    withCachedConnection :: MonadOrville conn m => m a -> m a Source #

    Migration Guide: withCachedConnection has been renamed to withConnection_

    Runs an action with a cached connection. + Without using this, or wrapping calls in a transaction using withTransaction, successive + calls to functions like insertRecord and updateRecord are *not* guaranteed to occur on the + same connection.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html new file mode 100644 index 0000000..7dec2a6 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-ResourceT.html @@ -0,0 +1,12 @@ +Database.Orville.PostgreSQL.ResourceT

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.ResourceT

    Description

    ResourceT provides ResourceT instance of the Orville typeclasses for situations +where you might need it. In particular, if you are using the conduit library, you +may want to wrap ResourceT around your normal monad stack, in which case you'll need +the MonadOrville instance provided here to use selectConduit.

    These instances are not included in the default exports for Orville because the required +either a MonadUnliftIO or MonadBaseControl instance of the monad underlying ResourceT, +depending on the version of ResourceT you are using. For resource-1.1.10 and above you +must provide MonadUnliftIO instance. For versions prior to 1.1.10 you must provide a +MonadBaseControl instance.

    This is required by MonadOrville requires an instance to MonadBaseControl to be defined. +The instance provided here can only use one lifting strategy, one we choose MonadUnliftIO +wherever possible (both by our own opinion and because later versions of ResourceT have +removed MonadBaseControl support). MonadBaseControl is used for versions of ResourceT +before ResourceT supported MonadUnliftIO.

    Orphan instances

    (MonadUnliftIO m, MonadOrville conn m) => MonadOrville conn (ResourceT m) Source # 
    Instance details

    (Monad m, HasOrvilleContext conn m) => HasOrvilleContext conn (ResourceT m) Source # 
    Instance details

    Methods

    getOrvilleEnv :: ResourceT m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> ResourceT m a -> ResourceT m a Source #

    (MonadOrvilleControl m, MonadUnliftIO m) => MonadOrvilleControl (ResourceT m) Source # 
    Instance details

    Methods

    liftWithConnection :: (forall a. (conn -> IO a) -> IO a) -> (conn -> ResourceT m b) -> ResourceT m b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> ResourceT m c -> ResourceT m d -> ResourceT m c Source #

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html new file mode 100644 index 0000000..fa2f633 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Select.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Select

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Select

    Description

     
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html new file mode 100644 index 0000000..9046aff --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL-Trigger.html @@ -0,0 +1 @@ +Database.Orville.PostgreSQL.Trigger

    orville-postgresql-legacy-0.9.0.1: ORM

    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL.Trigger

    Documentation

    insertTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, InsertTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity Source #

    class InsertTrigger trigger readEntity where Source #

    Methods

    insertTriggers :: readEntity -> [trigger] Source #

    updateTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, UpdateTrigger trigger readEntity writeEntity) => TableDefinition readEntity writeEntity key -> readEntity -> writeEntity -> m () Source #

    class UpdateTrigger trigger readEntity writeEntity where Source #

    Methods

    updateTriggers :: readEntity -> writeEntity -> [trigger] Source #

    deleteTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, DeleteTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> readEntity -> m () Source #

    class DeleteTrigger trigger readEntity where Source #

    Methods

    deleteTriggers :: readEntity -> [trigger] Source #

    class MonadTrigger trigger m | m -> trigger where Source #

    Methods

    runTriggers :: [trigger] -> m () Source #

    Instances
    MonadIO m => MonadTrigger trigger (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    runTriggers :: [trigger] -> OrvilleTriggerT trigger conn m () Source #

    data OrvilleTriggerT trigger conn m a Source #

    Instances
    MonadError e m => MonadError e (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    throwError :: e -> OrvilleTriggerT trigger conn m a #

    catchError :: OrvilleTriggerT trigger conn m a -> (e -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m a #

    MonadBaseControl b m => MonadBaseControl b (OrvilleTriggerT trigger conn m) 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    Associated Types

    type StM (OrvilleTriggerT trigger conn m) a :: Type

    Methods

    liftBaseWith :: (RunInBase (OrvilleTriggerT trigger conn m) b -> b a) -> OrvilleTriggerT trigger conn m a

    restoreM :: StM (OrvilleTriggerT trigger conn m) a -> OrvilleTriggerT trigger conn m a

    MonadBase b m => MonadBase b (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    liftBase :: b α -> OrvilleTriggerT trigger conn m α

    (Monad m, MonadThrow m, MonadIO m, IConnection conn, MonadOrvilleControl m, MonadFail m) => MonadOrville conn (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    (Monad m, IConnection conn) => HasOrvilleContext conn (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    getOrvilleEnv :: OrvilleTriggerT trigger conn m (OrvilleEnv conn) Source #

    localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a Source #

    MonadIO m => MonadTrigger trigger (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    runTriggers :: [trigger] -> OrvilleTriggerT trigger conn m () Source #

    MonadTrans (OrvilleTriggerT trigger conn) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    lift :: Monad m => m a -> OrvilleTriggerT trigger conn m a #

    MonadTransControl (OrvilleTriggerT trigger conn) 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    Associated Types

    type StT (OrvilleTriggerT trigger conn) a :: Type

    Methods

    liftWith :: Monad m => (Run (OrvilleTriggerT trigger conn) -> m a) -> OrvilleTriggerT trigger conn m a

    restoreT :: Monad m => m (StT (OrvilleTriggerT trigger conn) a) -> OrvilleTriggerT trigger conn m a

    Monad m => Monad (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    (>>=) :: OrvilleTriggerT trigger conn m a -> (a -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b #

    (>>) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m b #

    return :: a -> OrvilleTriggerT trigger conn m a #

    fail :: String -> OrvilleTriggerT trigger conn m a #

    Functor m => Functor (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    fmap :: (a -> b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b #

    (<$) :: a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m a #

    MonadFail m => MonadFail (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    fail :: String -> OrvilleTriggerT trigger conn m a #

    Applicative m => Applicative (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    pure :: a -> OrvilleTriggerT trigger conn m a #

    (<*>) :: OrvilleTriggerT trigger conn m (a -> b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b #

    liftA2 :: (a -> b -> c) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m c #

    (*>) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m b #

    (<*) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m b -> OrvilleTriggerT trigger conn m a #

    MonadIO m => MonadIO (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    liftIO :: IO a -> OrvilleTriggerT trigger conn m a #

    Alternative m => Alternative (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    empty :: OrvilleTriggerT trigger conn m a #

    (<|>) :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a #

    some :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m [a] #

    many :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m [a] #

    MonadPlus m => MonadPlus (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    mzero :: OrvilleTriggerT trigger conn m a #

    mplus :: OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a #

    MonadCatch m => MonadCatch (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    catch :: Exception e => OrvilleTriggerT trigger conn m a -> (e -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m a

    MonadMask m => MonadMask (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    mask :: ((forall a. OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b

    uninterruptibleMask :: ((forall a. OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn m a) -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b

    generalBracket :: OrvilleTriggerT trigger conn m a -> (a -> ExitCase b -> OrvilleTriggerT trigger conn m c) -> (a -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m (b, c)

    MonadThrow m => MonadThrow (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    throwM :: Exception e => e -> OrvilleTriggerT trigger conn m a

    (Monad m, MonadOrvilleControl m) => MonadOrvilleControl (OrvilleTriggerT trigger conn m) Source # 
    Instance details

    Defined in Database.Orville.PostgreSQL.Internal.Trigger

    Methods

    liftWithConnection :: (forall a. (conn0 -> IO a) -> IO a) -> (conn0 -> OrvilleTriggerT trigger conn m b) -> OrvilleTriggerT trigger conn m b Source #

    liftFinally :: (forall a b. IO a -> IO b -> IO a) -> OrvilleTriggerT trigger conn m c -> OrvilleTriggerT trigger conn m d -> OrvilleTriggerT trigger conn m c Source #

    MonadUnliftIO m => MonadUnliftIO (OrvilleTriggerT trigger conn m) 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadUnliftIO

    Methods

    askUnliftIO :: OrvilleTriggerT trigger conn m (UnliftIO (OrvilleTriggerT trigger conn m))

    withRunInIO :: ((forall a. OrvilleTriggerT trigger conn m a -> IO a) -> IO b) -> OrvilleTriggerT trigger conn m b

    type StT (OrvilleTriggerT trigger conn) a 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    type StT (OrvilleTriggerT trigger conn) a
    type StM (OrvilleTriggerT trigger conn m) a 
    Instance details

    Defined in Database.Orville.PostgreSQL.MonadBaseControl

    type StM (OrvilleTriggerT trigger conn m) a

    committedTriggers :: RecordedTriggers trigger -> [trigger] Source #

    runOrvilleTriggerT :: MonadIO m => OrvilleTriggerT trigger conn m a -> Pool conn -> m (a, [trigger]) Source #

    mapOrvilleTriggerT :: Monad n => (m a -> n b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn n b Source #

    liftOrville :: Monad m => OrvilleT conn m a -> OrvilleTriggerT trigger conn m a Source #

    askTriggers :: MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger) Source #

    clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m () Source #

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html new file mode 100644 index 0000000..c30cb78 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/Database-Orville-PostgreSQL.html @@ -0,0 +1,2 @@ +Database.Orville.PostgreSQL

    orville-postgresql-legacy-0.9.0.1: ORM

    CopyrightFlipstone Technology Partners 2016-2018
    LicenseMIT
    Safe HaskellNone
    LanguageHaskell2010

    Database.Orville.PostgreSQL

    Description

    See Database.Orville.PostgreSQL.Core for information about migrating to the +new LibPQ-based Orville.

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-37.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-37.html new file mode 100644 index 0000000..6d70956 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-37.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - %)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - %

    %==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-46.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-46.html new file mode 100644 index 0000000..03da229 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-46.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - .)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - .

    .:=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<-Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .>=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-60.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-60.html new file mode 100644 index 0000000..6f58944 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-60.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - <)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - <

    <<<Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    <>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-62.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-62.html new file mode 100644 index 0000000..d952e0e --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-62.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - >)

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-A.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-A.html new file mode 100644 index 0000000..91d8635 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-A.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - A)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - A

    abortPopDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    actualColumnsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    addTransactionCallBackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    aliasedDatabase.Orville.PostgreSQL.Expr
    apply 
    1 (Function)Database.Orville.PostgreSQL.Plan.Many
    2 (Function)Database.Orville.PostgreSQL.Plan
    aroundRunningQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    AscendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    askParam 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    askTriggersDatabase.Orville.PostgreSQL.Trigger
    assertDatabase.Orville.PostgreSQL.Plan
    AssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation, Database.Orville.PostgreSQL.Plan
    assertRightDatabase.Orville.PostgreSQL.Plan.Operation
    AssignedByDatabaseDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    attrFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    automaticIdFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-All.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-All.html new file mode 100644 index 0000000..a72f74b --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-All.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index

    %==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .:=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<-Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .<>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .==Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    .>=Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    <<<Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    <>Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    >>=Database.Orville.PostgreSQL.Plan.Syntax
    >>>Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    abortPopDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    actualColumnsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    addTransactionCallBackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    aliasedDatabase.Orville.PostgreSQL.Expr
    apply 
    1 (Function)Database.Orville.PostgreSQL.Plan.Many
    2 (Function)Database.Orville.PostgreSQL.Plan
    aroundRunningQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    AscendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    askParam 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    askTriggersDatabase.Orville.PostgreSQL.Trigger
    assertDatabase.Orville.PostgreSQL.Plan
    AssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation, Database.Orville.PostgreSQL.Plan
    assertRightDatabase.Orville.PostgreSQL.Plan.Operation
    AssignedByDatabaseDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    attrFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    automaticIdFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    bigIntegerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    bigserialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    bindDatabase.Orville.PostgreSQL.Plan
    booleanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    boolFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    buildPaginationDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    categorizeRowDatabase.Orville.PostgreSQL.Plan.Operation
    certainlyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    certainly'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    chainDatabase.Orville.PostgreSQL.Plan
    clearTriggersDatabase.Orville.PostgreSQL.Trigger
    colDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnDefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnSpecifierDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    committedTriggersDatabase.Orville.PostgreSQL.Trigger
    composeDatabase.Orville.PostgreSQL.Plan.Many
    compositePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConnectionDatabase.Orville.PostgreSQL.Connection
    ConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    constraintBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConstraintDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    constraintNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    constraintTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    convErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    convErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConversionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConversionErrorDetails 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    convertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    createConnectionPoolDatabase.Orville.PostgreSQL.Connection
    CreatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    createIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    dateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    dayFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DDLQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    decodeSqlRowsDatabase.Orville.PostgreSQL.Raw
    DecodingFailureDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    defaultLiftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    defaultLiftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DeleteQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    deleteRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DeleteTriggerDatabase.Orville.PostgreSQL.Trigger
    deleteTriggeredDatabase.Orville.PostgreSQL.Trigger
    deleteTriggersDatabase.Orville.PostgreSQL.Trigger
    deleteWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DescendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    distinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    doubleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    doubleFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    dropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    dropIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropSequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    elemsDatabase.Orville.PostgreSQL.Plan.Many
    ExecuteDatabase.Orville.PostgreSQL.Plan
    executeDatabase.Orville.PostgreSQL.Plan
    executeOperationManyDatabase.Orville.PostgreSQL.Plan.Operation
    executeOperationOneDatabase.Orville.PostgreSQL.Plan.Operation
    ExplainDatabase.Orville.PostgreSQL.Plan
    explain 
    1 (Function)Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    2 (Function)Database.Orville.PostgreSQL.Plan
    explainLinesDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    explainOperationManyDatabase.Orville.PostgreSQL.Plan.Operation
    explainOperationOneDatabase.Orville.PostgreSQL.Plan.Operation
    explainSelectManyDatabase.Orville.PostgreSQL.Plan.Operation
    explainSelectOneDatabase.Orville.PostgreSQL.Plan.Operation
    explainStepDatabase.Orville.PostgreSQL.Plan.Explanation
    ExplanationDatabase.Orville.PostgreSQL.Plan.Explanation
    explanationStepsDatabase.Orville.PostgreSQL.Plan.Explanation
    ExprDatabase.Orville.PostgreSQL.Expr
    exprDatabase.Orville.PostgreSQL.Expr
    FieldDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldFlagsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldOfTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldToSqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    FieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findAll 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findAllWhere 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findMaybeOneDatabase.Orville.PostgreSQL.Plan
    findMaybeOneWhereDatabase.Orville.PostgreSQL.Plan
    findOne 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findOneShowViaDatabase.Orville.PostgreSQL.Plan
    findOneWhere 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findOneWhereShowViaDatabase.Orville.PostgreSQL.Plan
    findRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findRecordsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findRecordsByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findSelectDatabase.Orville.PostgreSQL.Plan.Operation
    fixedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    focusParamDatabase.Orville.PostgreSQL.Plan
    foreignKeyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    FromClauseDatabase.Orville.PostgreSQL.Select
    fromClauseRawDatabase.Orville.PostgreSQL.Select
    fromClauseTableDatabase.Orville.PostgreSQL.Select
    fromClauseTableNameDatabase.Orville.PostgreSQL.Select
    fromKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    fromKeysDatabase.Orville.PostgreSQL.Plan.Many
    FromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    FromSqlErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    generateMigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    GenerateSqlDatabase.Orville.PostgreSQL.Expr
    generateSqlDatabase.Orville.PostgreSQL.Expr
    getComponentDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    getFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    getOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    groupByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    hasManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasManyInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasManyInWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasManyWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOneDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOne'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOneInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOneWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    HasOrvilleContextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    IndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    IndexDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexUniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    InsertQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    insertRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    insertRecordManyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    insertRecordManyReturningDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    InsertTriggerDatabase.Orville.PostgreSQL.Trigger
    insertTriggeredDatabase.Orville.PostgreSQL.Trigger
    insertTriggersDatabase.Orville.PostgreSQL.Trigger
    int32FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    int64FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    integerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    IntegralOutOfBoundsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    isFieldNullableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    isNotNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    isNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    kernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    keysDatabase.Orville.PostgreSQL.Plan.Many
    liftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    liftFinallyViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
    liftFinallyViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
    liftOrvilleDatabase.Orville.PostgreSQL.Trigger
    liftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    liftWithConnectionViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
    liftWithConnectionViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
    limitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    localOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    lookupDatabase.Orville.PostgreSQL.Plan.Many
    ManyDatabase.Orville.PostgreSQL.Plan.Many
    mapDatabase.Orville.PostgreSQL.Plan.Many
    mapAttrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    mapFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    mapOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    mapOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
    maybeConvertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    maybeMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrateSchemaDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationExecutionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationItem 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrationItemDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrationItemSchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationLockExcessiveRetryErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrationPlanItemsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MissingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    missingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MissingColumnDetails 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    MissingRecordByDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    mkAssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation
    mkTableDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MonadOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MonadOrvilleControlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MonadTriggerDatabase.Orville.PostgreSQL.Trigger
    NameExprDatabase.Orville.PostgreSQL.Expr
    NameFormDatabase.Orville.PostgreSQL.Expr
    newOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    noCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    noExplanationDatabase.Orville.PostgreSQL.Plan.Explanation
    NotAKey 
    1 (Type/Class)Database.Orville.PostgreSQL.Plan.Many
    2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Many
    NotNull 
    1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    Now 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    NullabilityDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    Nullable 
    1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    nullableFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OccurredAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    offsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    onKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    onPopManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    Operation 
    1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
    2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
    orderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrderByClause 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ormEnvPoolDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
    pageNextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    pageRowsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    Pagination 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    partialMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    PlanDatabase.Orville.PostgreSQL.Plan
    planEitherDatabase.Orville.PostgreSQL.Plan
    planListDatabase.Orville.PostgreSQL.Plan
    planManyDatabase.Orville.PostgreSQL.Plan
    planMaybeDatabase.Orville.PostgreSQL.Plan
    PlannedDatabase.Orville.PostgreSQL.Plan
    planOperationDatabase.Orville.PostgreSQL.Plan
    planSelectDatabase.Orville.PostgreSQL.Plan
    PoolDatabase.Orville.PostgreSQL.Connection
    popDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PopErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popFirstDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popMaybeDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popMissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PoppedDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PoppedErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PoppedValueDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PopperDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popQueryDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popRecord'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popTableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popThrowDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    prefixMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    PrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyEqualsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyPartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    produceResultDatabase.Orville.PostgreSQL.Plan.Operation
    qualifiedDatabase.Orville.PostgreSQL.Expr
    QueryTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RawExprDatabase.Orville.PostgreSQL.Expr
    rawSqlDatabase.Orville.PostgreSQL.Expr
    rawSqlExprDatabase.Orville.PostgreSQL.Expr
    readOnlyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    readOnlyMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RecordedTriggersDatabase.Orville.PostgreSQL.Trigger
    ReferencesDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RelationalMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ResultSetDatabase.Orville.PostgreSQL.Raw
    RowDataErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RowDataErrorDetails 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RowDataErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    rowErrorColumnNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    rowErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    rowErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    runOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    runOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
    runSelectDatabase.Orville.PostgreSQL.Select
    runTriggersDatabase.Orville.PostgreSQL.Trigger
    sayDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SchemaDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    searchVectorFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectDatabase.Orville.PostgreSQL.Select
    selectAllDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectColumnDatabase.Orville.PostgreSQL.Expr
    selectConduitDatabase.Orville.PostgreSQL.Conduit
    selectDistinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectExprDatabase.Orville.PostgreSQL.Expr
    selectFieldDatabase.Orville.PostgreSQL.Select
    selectFirstDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectForm 
    1 (Type/Class)Database.Orville.PostgreSQL.Expr
    2 (Data Constructor)Database.Orville.PostgreSQL.Expr
    selectFormDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectFormAliasDatabase.Orville.PostgreSQL.Expr
    selectFormColumnDatabase.Orville.PostgreSQL.Expr
    selectManyDatabase.Orville.PostgreSQL.Plan.Operation
    selectOneDatabase.Orville.PostgreSQL.Plan.Operation
    SelectOperation 
    1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
    2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
    selectOperationDatabase.Orville.PostgreSQL.Plan.Operation
    selectOptGroupDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectOptions 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptionsToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptLimitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptOffsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptOrderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectQueryDatabase.Orville.PostgreSQL.Select
    selectQueryColumnsDatabase.Orville.PostgreSQL.Select
    selectQueryRawDatabase.Orville.PostgreSQL.Select
    selectQueryRawRowsDatabase.Orville.PostgreSQL.Select
    selectQueryRowsDatabase.Orville.PostgreSQL.Select
    selectQueryTableDatabase.Orville.PostgreSQL.Select
    selectSqlDatabase.Orville.PostgreSQL.Raw
    selectSqlRowsDatabase.Orville.PostgreSQL.Raw
    SequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceCacheDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceCurrValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceCycleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SequenceDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceIncrementDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceMaxValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceMinValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceNextValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceSetValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    serialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    setStartTransactionSQLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    showFromSqlErrorForLoggingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    showFromSqlErrorMinimalDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    showSqlValueTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    simpleIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    simplePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SomeField 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SortDirectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SqlType 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeIdDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeReferenceDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeSqlSizeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    streamPagesDatabase.Orville.PostgreSQL.Conduit
    TableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TableDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TableParams 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tablePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblPrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    textDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    textFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    textSearchVectorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    timestampDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    toColumnDefaultSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    toMapDatabase.Orville.PostgreSQL.Plan.Many
    ToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionCommitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionEventDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionRollbackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TypeMismatchDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    unboundedTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    unboundedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uncommittedTriggersDatabase.Orville.PostgreSQL.Trigger
    unescapedNameDatabase.Orville.PostgreSQL.Expr
    UniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uniqueConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uniqueIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uniquePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    unOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    UnpoppableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    UpdatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    updateFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    UpdateQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    updateRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    updateSqlDatabase.Orville.PostgreSQL.Raw
    UpdateTriggerDatabase.Orville.PostgreSQL.Trigger
    updateTriggeredDatabase.Orville.PostgreSQL.Trigger
    updateTriggersDatabase.Orville.PostgreSQL.Trigger
    useDatabase.Orville.PostgreSQL.Plan
    usingDatabase.Orville.PostgreSQL.Plan
    utcTimeFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    varTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereAndDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    WhereConditionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereLikeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereLikeInsensitiveDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereNotInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereOrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereQualifiedDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereRawDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    where_Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withCachedConnectionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withConnectionDatabase.Orville.PostgreSQL.Raw
    withConversionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withPrefixDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withTransactionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-B.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-B.html new file mode 100644 index 0000000..51df001 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-B.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - B)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - B

    bigIntegerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    bigserialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    bindDatabase.Orville.PostgreSQL.Plan
    booleanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    boolFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    buildPaginationDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-C.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-C.html new file mode 100644 index 0000000..8b97bd1 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-C.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - C)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - C

    categorizeRowDatabase.Orville.PostgreSQL.Plan.Operation
    certainlyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    certainly'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    chainDatabase.Orville.PostgreSQL.Plan
    clearTriggersDatabase.Orville.PostgreSQL.Trigger
    colDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnDefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ColumnSpecifierDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    committedTriggersDatabase.Orville.PostgreSQL.Trigger
    composeDatabase.Orville.PostgreSQL.Plan.Many
    compositePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConnectionDatabase.Orville.PostgreSQL.Connection
    ConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    constraintBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConstraintDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    constraintNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    constraintTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    convErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    convErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConversionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ConversionErrorDetails 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    convertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    createConnectionPoolDatabase.Orville.PostgreSQL.Connection
    CreatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    createIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-D.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-D.html new file mode 100644 index 0000000..5d4bbac --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-D.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - D)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - D

    dateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    dayFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DDLQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    decodeSqlRowsDatabase.Orville.PostgreSQL.Raw
    DecodingFailureDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DefaultDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    defaultLiftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    defaultLiftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DeleteQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    deleteRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DeleteTriggerDatabase.Orville.PostgreSQL.Trigger
    deleteTriggeredDatabase.Orville.PostgreSQL.Trigger
    deleteTriggersDatabase.Orville.PostgreSQL.Trigger
    deleteWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DescendingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    distinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    doubleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    doubleFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    dropConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    dropIndexesConcurrentlyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropSequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    DropTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-E.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-E.html new file mode 100644 index 0000000..3f3e781 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-E.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - E)

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-F.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-F.html new file mode 100644 index 0000000..af713f9 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-F.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - F)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - F

    FieldDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldFlagsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldOfTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldToSqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    FieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    fieldUpdateDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findAll 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findAllWhere 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findMaybeOneDatabase.Orville.PostgreSQL.Plan
    findMaybeOneWhereDatabase.Orville.PostgreSQL.Plan
    findOne 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findOneShowViaDatabase.Orville.PostgreSQL.Plan
    findOneWhere 
    1 (Function)Database.Orville.PostgreSQL.Plan.Operation
    2 (Function)Database.Orville.PostgreSQL.Plan
    findOneWhereShowViaDatabase.Orville.PostgreSQL.Plan
    findRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findRecordsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findRecordsByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    findSelectDatabase.Orville.PostgreSQL.Plan.Operation
    fixedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    focusParamDatabase.Orville.PostgreSQL.Plan
    foreignKeyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    FromClauseDatabase.Orville.PostgreSQL.Select
    fromClauseRawDatabase.Orville.PostgreSQL.Select
    fromClauseTableDatabase.Orville.PostgreSQL.Select
    fromClauseTableNameDatabase.Orville.PostgreSQL.Select
    fromKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    fromKeysDatabase.Orville.PostgreSQL.Plan.Many
    FromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    FromSqlErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-G.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-G.html new file mode 100644 index 0000000..f67a8c8 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-G.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - G)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - G

    generateMigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    GenerateSqlDatabase.Orville.PostgreSQL.Expr
    generateSqlDatabase.Orville.PostgreSQL.Expr
    getComponentDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    getFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    getOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    groupByDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-H.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-H.html new file mode 100644 index 0000000..20b854a --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-H.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - H)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - H

    hasManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasManyInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasManyInWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasManyWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOneDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOne'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOneInDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    hasOneWhereDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    HasOrvilleContextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-I.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-I.html new file mode 100644 index 0000000..f6776e6 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-I.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - I)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - I

    IndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexBodyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    IndexDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexTableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    indexUniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    InsertQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    insertRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    insertRecordManyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    insertRecordManyReturningDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    InsertTriggerDatabase.Orville.PostgreSQL.Trigger
    insertTriggeredDatabase.Orville.PostgreSQL.Trigger
    insertTriggersDatabase.Orville.PostgreSQL.Trigger
    int32FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    int64FieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    integerDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    IntegralOutOfBoundsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    isFieldNullableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    isNotNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    isNullDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-K.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-K.html new file mode 100644 index 0000000..fef96c5 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-K.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - K)

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-L.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-L.html new file mode 100644 index 0000000..ada9a49 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-L.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - L)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - L

    liftFinallyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    liftFinallyViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
    liftFinallyViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
    liftOrvilleDatabase.Orville.PostgreSQL.Trigger
    liftWithConnectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    liftWithConnectionViaBaseControlDatabase.Orville.PostgreSQL.MonadBaseControl
    liftWithConnectionViaUnliftIODatabase.Orville.PostgreSQL.MonadUnliftIO
    limitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    localOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    lookupDatabase.Orville.PostgreSQL.Plan.Many
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-M.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-M.html new file mode 100644 index 0000000..c3e5444 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-M.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - M)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - M

    ManyDatabase.Orville.PostgreSQL.Plan.Many
    mapDatabase.Orville.PostgreSQL.Plan.Many
    mapAttrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    mapFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    mapOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    mapOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
    maybeConvertSqlTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    maybeMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrateSchemaDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationExecutionErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationItem 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrationItemDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrationItemSchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationLockExcessiveRetryErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MigrationPlanDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    migrationPlanItemsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MissingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    missingColumnDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MissingColumnDetails 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    MissingRecordByDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    mkAssertionFailedDatabase.Orville.PostgreSQL.Plan.Operation
    mkTableDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MonadOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MonadOrvilleControlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    MonadTriggerDatabase.Orville.PostgreSQL.Trigger
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-N.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-N.html new file mode 100644 index 0000000..ee38adf --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-N.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - N)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - N

    NameExprDatabase.Orville.PostgreSQL.Expr
    NameFormDatabase.Orville.PostgreSQL.Expr
    newOrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    noCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    noExplanationDatabase.Orville.PostgreSQL.Plan.Explanation
    NotAKey 
    1 (Type/Class)Database.Orville.PostgreSQL.Plan.Many
    2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Many
    NotNull 
    1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    Now 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    NullabilityDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    Nullable 
    1 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    nullableFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-O.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-O.html new file mode 100644 index 0000000..d9364db --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-O.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - O)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - O

    OccurredAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    offsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    onKernDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    onPopManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    Operation 
    1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
    2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
    orderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrderByClause 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ormEnvPoolDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrvilleEnvDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    OrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-P.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-P.html new file mode 100644 index 0000000..ecdb78b --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-P.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - P)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - P

    pageNextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    pageRowsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    Pagination 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    partialMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    PlanDatabase.Orville.PostgreSQL.Plan
    planEitherDatabase.Orville.PostgreSQL.Plan
    planListDatabase.Orville.PostgreSQL.Plan
    planManyDatabase.Orville.PostgreSQL.Plan
    planMaybeDatabase.Orville.PostgreSQL.Plan
    PlannedDatabase.Orville.PostgreSQL.Plan
    planOperationDatabase.Orville.PostgreSQL.Plan
    planSelectDatabase.Orville.PostgreSQL.Plan
    PoolDatabase.Orville.PostgreSQL.Connection
    popDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PopErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popFirstDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popManyDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popMaybeDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popMissingRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PoppedDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PoppedErrorDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PoppedValueDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    PopperDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popQueryDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popRecordDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popRecord'Database.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popTableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    popThrowDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    prefixMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    PrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyDescriptionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyEqualsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyPartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    primaryKeyToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    produceResultDatabase.Orville.PostgreSQL.Plan.Operation
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-Q.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-Q.html new file mode 100644 index 0000000..3d58f71 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-Q.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - Q)

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-R.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-R.html new file mode 100644 index 0000000..97864f8 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-R.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - R)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - R

    RawExprDatabase.Orville.PostgreSQL.Expr
    rawSqlDatabase.Orville.PostgreSQL.Expr
    rawSqlExprDatabase.Orville.PostgreSQL.Expr
    readOnlyFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    readOnlyMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RecordedTriggersDatabase.Orville.PostgreSQL.Trigger
    ReferencesDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RelationalMapDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    ResultSetDatabase.Orville.PostgreSQL.Raw
    RowDataErrorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RowDataErrorDetails 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    RowDataErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    rowErrorColumnNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    rowErrorPrimaryKeysDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    rowErrorReasonDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    runOrvilleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    runOrvilleTriggerTDatabase.Orville.PostgreSQL.Trigger
    runSelectDatabase.Orville.PostgreSQL.Select
    runTriggersDatabase.Orville.PostgreSQL.Trigger
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-S.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-S.html new file mode 100644 index 0000000..37028c3 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-S.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - S)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - S

    sayDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SchemaDefinitionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SchemaItemDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    searchVectorFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectDatabase.Orville.PostgreSQL.Select
    selectAllDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectColumnDatabase.Orville.PostgreSQL.Expr
    selectConduitDatabase.Orville.PostgreSQL.Conduit
    selectDistinctDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectExprDatabase.Orville.PostgreSQL.Expr
    selectFieldDatabase.Orville.PostgreSQL.Select
    selectFirstDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectForm 
    1 (Type/Class)Database.Orville.PostgreSQL.Expr
    2 (Data Constructor)Database.Orville.PostgreSQL.Expr
    selectFormDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectFormAliasDatabase.Orville.PostgreSQL.Expr
    selectFormColumnDatabase.Orville.PostgreSQL.Expr
    selectManyDatabase.Orville.PostgreSQL.Plan.Operation
    selectOneDatabase.Orville.PostgreSQL.Plan.Operation
    SelectOperation 
    1 (Type/Class)Database.Orville.PostgreSQL.Plan.Operation
    2 (Data Constructor)Database.Orville.PostgreSQL.Plan.Operation
    selectOperationDatabase.Orville.PostgreSQL.Plan.Operation
    selectOptGroupDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectOptions 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptionsToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptLimitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptOffsetDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptOrderDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectOptWhereDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SelectQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    selectQueryDatabase.Orville.PostgreSQL.Select
    selectQueryColumnsDatabase.Orville.PostgreSQL.Select
    selectQueryRawDatabase.Orville.PostgreSQL.Select
    selectQueryRawRowsDatabase.Orville.PostgreSQL.Select
    selectQueryRowsDatabase.Orville.PostgreSQL.Select
    selectQueryTableDatabase.Orville.PostgreSQL.Select
    selectSqlDatabase.Orville.PostgreSQL.Raw
    selectSqlRowsDatabase.Orville.PostgreSQL.Raw
    SequenceDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceCacheDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceCurrValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceCycleDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SequenceDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceIncrementDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceMaxValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceMinValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceNextValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceSetValDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sequenceStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    serialDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    setStartTransactionSQLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    showFromSqlErrorForLoggingDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    showFromSqlErrorMinimalDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    showSqlValueTypeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    simpleIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    simplePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SomeField 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SortDirectionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SqlType 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeIdDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeReferenceDDLDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeSqlSizeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    sqlTypeToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    SqlValueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    streamPagesDatabase.Orville.PostgreSQL.Conduit
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-T.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-T.html new file mode 100644 index 0000000..90ba74d --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-T.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - T)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - T

    TableDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TableDefinition 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableFromSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TableParams 
    1 (Type/Class)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    2 (Data Constructor)Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tablePrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tableToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblCommentsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblGetKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblMapperDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblPrimaryKeyDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    tblSafeToDeleteDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    textDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    textFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    textSearchVectorDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    timestampDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    toColumnDefaultSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    toMapDatabase.Orville.PostgreSQL.Plan.Many
    ToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionCommitDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionEventDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionRollbackDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TransactionStartDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    TypeMismatchDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-U.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-U.html new file mode 100644 index 0000000..b8a16d2 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-U.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - U)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - U

    unboundedTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    unboundedTextFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uncommittedTriggersDatabase.Orville.PostgreSQL.Trigger
    unescapedNameDatabase.Orville.PostgreSQL.Expr
    UniqueDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uniqueConstraintDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uniqueIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    uniquePartialIndexDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    unOrvilleTDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    UnpoppableDatabase.Orville.PostgreSQL.Popper, Database.Orville.PostgreSQL
    UpdatedAtDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    updateFieldsDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    UpdateQueryDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    updateRecordDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    updateSqlDatabase.Orville.PostgreSQL.Raw
    UpdateTriggerDatabase.Orville.PostgreSQL.Trigger
    updateTriggeredDatabase.Orville.PostgreSQL.Trigger
    updateTriggersDatabase.Orville.PostgreSQL.Trigger
    useDatabase.Orville.PostgreSQL.Plan
    usingDatabase.Orville.PostgreSQL.Plan
    utcTimeFieldDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-V.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-V.html new file mode 100644 index 0000000..f47c6bf --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-V.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - V)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - V

    varTextDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-W.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-W.html new file mode 100644 index 0000000..5beac7c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index-W.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index - W)

    orville-postgresql-legacy-0.9.0.1: ORM

    Index - W

    whereAndDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    WhereConditionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereLikeDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereLikeInsensitiveDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereNotInDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereOrDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereQualifiedDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereRawDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    whereToSqlDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    where_Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withCachedConnectionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withConnectionDatabase.Orville.PostgreSQL.Raw
    withConversionDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withFlagDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withNameDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withPrefixDatabase.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    withTransactionDatabase.Orville.PostgreSQL.Raw, Database.Orville.PostgreSQL.Core, Database.Orville.PostgreSQL
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.html new file mode 100644 index 0000000..fd53e3a --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.html @@ -0,0 +1 @@ +orville-postgresql-legacy-0.9.0.1: ORM (Index)

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.json b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.json new file mode 100644 index 0000000..47befa5 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/doc-index.json @@ -0,0 +1 @@ +[{"display_html":"createConnectionPool :: Int -> NominalDiffTime -> Int -> String -> IO (Pool Connection)","name":"createConnectionPool","module":"Database.Orville.PostgreSQL.Connection","link":"Database-Orville-PostgreSQL-Connection.html#v:createConnectionPool"},{"display_html":"data Pool a","name":"Pool","module":"Database.Orville.PostgreSQL.Connection","link":"Database-Orville-PostgreSQL-Connection.html#t:Pool"},{"display_html":"data Connection","name":"Connection","module":"Database.Orville.PostgreSQL.Connection","link":"Database-Orville-PostgreSQL-Connection.html#t:Connection"},{"display_html":"data RawExpr","name":"RawExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:RawExpr"},{"display_html":"rawSql :: String -> RawExpr","name":"rawSql","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:rawSql"},{"display_html":"class GenerateSql expr where","name":"GenerateSql generateSql","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:GenerateSql"},{"display_html":"data Expr a","name":"Expr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:Expr"},{"display_html":"rawSqlExpr :: String -> Expr a","name":"rawSqlExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:rawSqlExpr"},{"display_html":"expr :: a -> Expr a","name":"expr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:expr"},{"display_html":"type NameExpr = Expr NameForm","name":"NameExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:NameExpr"},{"display_html":"data NameForm","name":"NameForm","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:NameForm"},{"display_html":"unescapedName :: NameForm -> String","name":"unescapedName","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:unescapedName"},{"display_html":"type SelectExpr = Expr SelectForm","name":"SelectExpr","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:SelectExpr"},{"display_html":"data SelectForm = SelectForm {}","name":"SelectForm SelectForm selectFormColumn selectFormAlias","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#t:SelectForm"},{"display_html":"selectColumn :: NameForm -> SelectForm","name":"selectColumn","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:selectColumn"},{"display_html":"qualified :: QualifySql form => form -> String -> form","name":"qualified","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:qualified"},{"display_html":"aliased :: SelectForm -> NameForm -> SelectForm","name":"aliased","module":"Database.Orville.PostgreSQL.Expr","link":"Database-Orville-PostgreSQL-Expr.html#v:aliased"},{"display_html":"data Explanation","name":"Explanation","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#t:Explanation"},{"display_html":"noExplanation :: Explanation","name":"noExplanation","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#v:noExplanation"},{"display_html":"explainStep :: String -> Explanation","name":"explainStep","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#v:explainStep"},{"display_html":"explanationSteps :: Explanation -> [String]","name":"explanationSteps","module":"Database.Orville.PostgreSQL.Plan.Explanation","link":"Database-Orville-PostgreSQL-Plan-Explanation.html#v:explanationSteps"},{"display_html":"data Many k a","name":"Many","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#t:Many"},{"display_html":"data NotAKey = NotAKey","name":"NotAKey NotAKey","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#t:NotAKey"},{"display_html":"fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a","name":"fromKeys","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:fromKeys"},{"display_html":"lookup :: k -> Many k a -> Either NotAKey a","name":"lookup","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:lookup"},{"display_html":"keys :: Many k a -> [k]","name":"keys","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:keys"},{"display_html":"elems :: Many k a -> [a]","name":"elems","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:elems"},{"display_html":"map :: (a -> b) -> Many k a -> Many k b","name":"map","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:map"},{"display_html":"toMap :: Ord k => Many k a -> Map k a","name":"toMap","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:toMap"},{"display_html":"apply :: Many param (a -> b) -> Many param a -> Many param b","name":"apply","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:apply"},{"display_html":"compose :: Many b c -> Many a b -> Many a c","name":"compose","module":"Database.Orville.PostgreSQL.Plan.Many","link":"Database-Orville-PostgreSQL-Plan-Many.html#v:compose"},{"display_html":"data Select row","name":"Select","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#t:Select"},{"display_html":"selectQuery :: FromSql row -> FromClause -> SelectOptions -> Select row","name":"selectQuery","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQuery"},{"display_html":"selectQueryTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Select readEntity","name":"selectQueryTable","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryTable"},{"display_html":"selectQueryRows :: [SelectExpr] -> FromClause -> SelectOptions -> Select [(String, SqlValue)]","name":"selectQueryRows","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryRows"},{"display_html":"selectQueryRaw :: FromSql row -> String -> [SqlValue] -> Select row","name":"selectQueryRaw","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryRaw"},{"display_html":"selectQueryRawRows :: String -> [SqlValue] -> Select [(String, SqlValue)]","name":"selectQueryRawRows","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryRawRows"},{"display_html":"selectQueryColumns :: [SelectExpr] -> FromSql row -> FromClause -> SelectOptions -> Select row","name":"selectQueryColumns","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectQueryColumns"},{"display_html":"selectField :: FieldDefinition nulability a -> SelectForm","name":"selectField","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:selectField"},{"display_html":"data FromClause","name":"FromClause","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#t:FromClause"},{"display_html":"fromClauseRaw :: String -> FromClause","name":"fromClauseRaw","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:fromClauseRaw"},{"display_html":"fromClauseTableName :: String -> FromClause","name":"fromClauseTableName","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:fromClauseTableName"},{"display_html":"fromClauseTable :: TableDefinition readEntity writeEntity key -> FromClause","name":"fromClauseTable","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:fromClauseTable"},{"display_html":"runSelect :: MonadOrville conn m => Select row -> m [row]","name":"runSelect","module":"Database.Orville.PostgreSQL.Select","link":"Database-Orville-PostgreSQL-Select.html#v:runSelect"},{"display_html":"selectSql :: MonadOrville conn m => String -> [SqlValue] -> FromSql result -> m [result]","name":"selectSql","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:selectSql"},{"display_html":"selectSqlRows :: MonadOrville conn m => String -> [SqlValue] -> m ResultSet","name":"selectSqlRows","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:selectSqlRows"},{"display_html":"decodeSqlRows :: MonadOrville conn m => FromSql result -> ResultSet -> m [result]","name":"decodeSqlRows","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:decodeSqlRows"},{"display_html":"type ResultSet = [[(String, SqlValue)]]","name":"ResultSet","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#t:ResultSet"},{"display_html":"updateSql :: MonadOrville conn m => String -> [SqlValue] -> m Integer","name":"updateSql","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:updateSql"},{"display_html":"withConnection :: MonadOrville conn m => (conn -> m a) -> m a","name":"withConnection","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:withConnection"},{"display_html":"withTransaction :: MonadOrville conn m => m a -> m a","name":"withTransaction","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:withTransaction"},{"display_html":"withCachedConnection :: MonadOrville conn m => m a -> m a","name":"withCachedConnection","module":"Database.Orville.PostgreSQL.Raw","link":"Database-Orville-PostgreSQL-Raw.html#v:withCachedConnection"},{"display_html":"selectConduit :: (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m) => Select row -> ConduitT () row m ()","name":"selectConduit","module":"Database.Orville.PostgreSQL.Conduit","link":"Database-Orville-PostgreSQL-Conduit.html#v:selectConduit"},{"display_html":"streamPages :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> ConduitT () readEnt m ()","name":"streamPages","module":"Database.Orville.PostgreSQL.Conduit","link":"Database-Orville-PostgreSQL-Conduit.html#v:streamPages"},{"display_html":"data TableDefinition readEntity writeEntity key = TableDefinition {}","name":"TableDefinition TableDefinition tableName tableFields tableSafeToDelete tablePrimaryKey tableFromSql tableToSql tableGetKey tableComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TableDefinition"},{"display_html":"data PrimaryKey key","name":"PrimaryKey","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:PrimaryKey"},{"display_html":"primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition","name":"primaryKeyIn","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyIn"},{"display_html":"primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition","name":"primaryKeyEquals","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyEquals"},{"display_html":"primaryKeyDescription :: PrimaryKey key -> String","name":"primaryKeyDescription","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyDescription"},{"display_html":"primaryKeyToSql :: PrimaryKey key -> key -> [SqlValue]","name":"primaryKeyToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyToSql"},{"display_html":"primaryKey :: FieldDefinition NotNull key -> PrimaryKey key","name":"primaryKey","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKey"},{"display_html":"compositePrimaryKey :: PrimaryKeyPart key -> [PrimaryKeyPart key] -> PrimaryKey key","name":"compositePrimaryKey","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:compositePrimaryKey"},{"display_html":"primaryKeyPart :: (key -> part) -> FieldDefinition NotNull part -> PrimaryKeyPart key","name":"primaryKeyPart","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:primaryKeyPart"},{"display_html":"mkTableDefinition :: TableParams readEntity writeEntity key -> TableDefinition readEntity writeEntity key","name":"mkTableDefinition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mkTableDefinition"},{"display_html":"data SqlType a = SqlType {}","name":"SqlType SqlType sqlTypeDDL sqlTypeReferenceDDL sqlTypeId sqlTypeSqlSize sqlTypeToSql sqlTypeFromSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SqlType"},{"display_html":"serial :: SqlType Int32","name":"serial","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:serial"},{"display_html":"bigserial :: SqlType Int64","name":"bigserial","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:bigserial"},{"display_html":"text :: Int -> SqlType Text","name":"text","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:text"},{"display_html":"varText :: Int -> SqlType Text","name":"varText","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:varText"},{"display_html":"unboundedText :: SqlType Text","name":"unboundedText","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:unboundedText"},{"display_html":"integer :: SqlType Int32","name":"integer","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:integer"},{"display_html":"bigInteger :: SqlType Int64","name":"bigInteger","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:bigInteger"},{"display_html":"double :: SqlType Double","name":"double","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:double"},{"display_html":"boolean :: SqlType Bool","name":"boolean","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:boolean"},{"display_html":"date :: SqlType Day","name":"date","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:date"},{"display_html":"timestamp :: SqlType UTCTime","name":"timestamp","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:timestamp"},{"display_html":"textSearchVector :: SqlType Text","name":"textSearchVector","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:textSearchVector"},{"display_html":"convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b","name":"convertSqlType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:convertSqlType"},{"display_html":"maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b","name":"maybeConvertSqlType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:maybeConvertSqlType"},{"display_html":"data TableParams readEntity writeEntity key = TableParams {}","name":"TableParams TableParams tblName tblMapper tblSafeToDelete tblPrimaryKey tblGetKey tblComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TableParams"},{"display_html":"data RelationalMap a b","name":"RelationalMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:RelationalMap"},{"display_html":"fields :: RelationalMap a b -> [SomeField]","name":"fields","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fields"},{"display_html":"mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c","name":"mapAttr","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mapAttr"},{"display_html":"mapField :: FieldDefinition nullability a -> RelationalMap a a","name":"mapField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mapField"},{"display_html":"attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b","name":"attrField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:attrField"},{"display_html":"maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b)","name":"maybeMapper","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:maybeMapper"},{"display_html":"prefixMap :: String -> RelationalMap a b -> RelationalMap a b","name":"prefixMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:prefixMap"},{"display_html":"partialMap :: RelationalMap a (Either String a) -> RelationalMap a a","name":"partialMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:partialMap"},{"display_html":"readOnlyMap :: RelationalMap a b -> RelationalMap c b","name":"readOnlyMap","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:readOnlyMap"},{"display_html":"readOnlyField :: FieldDefinition nullability a -> RelationalMap b a","name":"readOnlyField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:readOnlyField"},{"display_html":"data OrvilleEnv conn","name":"OrvilleEnv","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OrvilleEnv"},{"display_html":"newOrvilleEnv :: Pool conn -> OrvilleEnv conn","name":"newOrvilleEnv","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:newOrvilleEnv"},{"display_html":"setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn","name":"setStartTransactionSQL","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:setStartTransactionSQL"},{"display_html":"aroundRunningQuery :: (forall a. QueryType -> String -> IO a -> IO a) -> OrvilleEnv conn -> OrvilleEnv conn","name":"aroundRunningQuery","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:aroundRunningQuery"},{"display_html":"addTransactionCallBack :: (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn","name":"addTransactionCallBack","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:addTransactionCallBack"},{"display_html":"ormEnvPool :: OrvilleEnv conn -> Pool conn","name":"ormEnvPool","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:ormEnvPool"},{"display_html":"data TransactionEvent","name":"TransactionEvent TransactionStart TransactionCommit TransactionRollback","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TransactionEvent"},{"display_html":"data OrvilleT conn m a","name":"OrvilleT","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OrvilleT"},{"display_html":"unOrvilleT :: OrvilleT conn m a -> ReaderT (OrvilleEnv conn) m a","name":"unOrvilleT","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:unOrvilleT"},{"display_html":"data SqlValue","name":"SqlValue","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SqlValue"},{"display_html":"class IConnection conn => HasOrvilleContext conn m | m -> conn where","name":"HasOrvilleContext getOrvilleEnv localOrvilleEnv","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:HasOrvilleContext"},{"display_html":"class (Monad m, MonadIO m, HasOrvilleContext conn m, MonadThrow m, MonadOrvilleControl m, MonadFail m) => MonadOrville conn m","name":"MonadOrville","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MonadOrville"},{"display_html":"runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a","name":"runOrville","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:runOrville"},{"display_html":"mapOrvilleT :: Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b","name":"mapOrvilleT","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:mapOrvilleT"},{"display_html":"class MonadOrvilleControl m where","name":"MonadOrvilleControl liftWithConnection liftFinally","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MonadOrvilleControl"},{"display_html":"defaultLiftWithConnection :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a. (conn -> IO a) -> IO a) -> (conn -> n b) -> n b","name":"defaultLiftWithConnection","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:defaultLiftWithConnection"},{"display_html":"defaultLiftFinally :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a b. IO a -> IO b -> IO a) -> n c -> n d -> n c","name":"defaultLiftFinally","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:defaultLiftFinally"},{"display_html":"data QueryType","name":"QueryType SelectQuery InsertQuery UpdateQuery DeleteQuery DDLQuery","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:QueryType"},{"display_html":"withCachedConnection :: MonadOrville conn m => m a -> m a","name":"withCachedConnection","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withCachedConnection"},{"display_html":"withTransaction :: MonadOrville conn m => m a -> m a","name":"withTransaction","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withTransaction"},{"display_html":"data ColumnFlag","name":"ColumnFlag Unique Default References ColumnDescription AssignedByDatabase","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ColumnFlag"},{"display_html":"class ColumnDefault a where","name":"ColumnDefault toColumnDefaultSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ColumnDefault"},{"display_html":"data Now = Now","name":"Now Now","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Now"},{"display_html":"data FieldDefinition nullability a","name":"FieldDefinition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FieldDefinition"},{"display_html":"data Nullable","name":"Nullable","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Nullable"},{"display_html":"data NotNull","name":"NotNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:NotNull"},{"display_html":"data Nullability nullability where","name":"Nullability Nullable NotNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Nullability"},{"display_html":"isFieldNullable :: FieldDefinition nullability a -> Bool","name":"isFieldNullable","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:isFieldNullable"},{"display_html":"fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a","name":"fieldOfType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldOfType"},{"display_html":"textField :: String -> Int -> FieldDefinition NotNull Text","name":"textField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:textField"},{"display_html":"fixedTextField :: String -> Int -> FieldDefinition NotNull Text","name":"fixedTextField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fixedTextField"},{"display_html":"unboundedTextField :: String -> FieldDefinition NotNull Text","name":"unboundedTextField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:unboundedTextField"},{"display_html":"dayField :: String -> FieldDefinition NotNull Day","name":"dayField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:dayField"},{"display_html":"utcTimeField :: String -> FieldDefinition NotNull UTCTime","name":"utcTimeField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:utcTimeField"},{"display_html":"int32Field :: String -> FieldDefinition NotNull Int32","name":"int32Field","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:int32Field"},{"display_html":"int64Field :: String -> FieldDefinition NotNull Int64","name":"int64Field","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:int64Field"},{"display_html":"doubleField :: String -> FieldDefinition NotNull Double","name":"doubleField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:doubleField"},{"display_html":"boolField :: String -> FieldDefinition NotNull Bool","name":"boolField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:boolField"},{"display_html":"automaticIdField :: String -> FieldDefinition NotNull Int32","name":"automaticIdField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:automaticIdField"},{"display_html":"searchVectorField :: String -> FieldDefinition NotNull Text","name":"searchVectorField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:searchVectorField"},{"display_html":"nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a)","name":"nullableField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:nullableField"},{"display_html":"foreignKeyField :: String -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> FieldDefinition nullability key","name":"foreignKeyField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:foreignKeyField"},{"display_html":"withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a","name":"withFlag","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withFlag"},{"display_html":"withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a","name":"withName","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withName"},{"display_html":"withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b","name":"withConversion","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withConversion"},{"display_html":"fieldFromSql :: FieldDefinition nullability a -> FromSql a","name":"fieldFromSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldFromSql"},{"display_html":"fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue","name":"fieldToSqlValue","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldToSqlValue"},{"display_html":"data SomeField = SomeField (FieldDefinition nullability a)","name":"SomeField SomeField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SomeField"},{"display_html":"withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a","name":"withPrefix","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:withPrefix"},{"display_html":"fieldName :: FieldDefinition nullability a -> String","name":"fieldName","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldName"},{"display_html":"fieldType :: FieldDefinition nullability a -> SqlType a","name":"fieldType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldType"},{"display_html":"fieldFlags :: FieldDefinition nullability a -> [ColumnFlag]","name":"fieldFlags","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldFlags"},{"display_html":"data IndexDefinition = IndexDefinition {}","name":"IndexDefinition IndexDefinition indexName indexUnique indexTable indexBody","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:IndexDefinition"},{"display_html":"uniqueIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition","name":"uniqueIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:uniqueIndex"},{"display_html":"simpleIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition","name":"simpleIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:simpleIndex"},{"display_html":"simplePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition","name":"simplePartialIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:simplePartialIndex"},{"display_html":"uniquePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition","name":"uniquePartialIndex","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:uniquePartialIndex"},{"display_html":"data ConstraintDefinition = ConstraintDefinition {}","name":"ConstraintDefinition ConstraintDefinition constraintName constraintTable constraintBody","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ConstraintDefinition"},{"display_html":"data SequenceDefinition = SequenceDefinition {}","name":"SequenceDefinition SequenceDefinition sequenceName sequenceIncrement sequenceMinValue sequenceMaxValue sequenceStart sequenceCache sequenceCycle","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SequenceDefinition"},{"display_html":"uniqueConstraint :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> ConstraintDefinition","name":"uniqueConstraint","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:uniqueConstraint"},{"display_html":"dropConstraint :: TableDefinition readEntity writeEntity key -> String -> SchemaItem","name":"dropConstraint","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:dropConstraint"},{"display_html":"data FromSql a","name":"FromSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FromSql"},{"display_html":"data FromSqlError","name":"FromSqlError RowDataError MissingColumn ConversionError","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FromSqlError"},{"display_html":"data RowDataErrorDetails = RowDataErrorDetails {}","name":"RowDataErrorDetails RowDataErrorDetails rowErrorReason rowErrorColumnName rowErrorPrimaryKeys","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:RowDataErrorDetails"},{"display_html":"data RowDataErrorReason","name":"RowDataErrorReason DecodingFailure IntegralOutOfBounds TypeMismatch","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:RowDataErrorReason"},{"display_html":"data MissingColumnDetails = MissingColumnDetails {}","name":"MissingColumnDetails MissingColumnDetails missingColumn actualColumns","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MissingColumnDetails"},{"display_html":"data ConversionErrorDetails = ConversionErrorDetails {}","name":"ConversionErrorDetails ConversionErrorDetails convErrorReason convErrorPrimaryKeys","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ConversionErrorDetails"},{"display_html":"showFromSqlErrorMinimal :: FromSqlError -> String","name":"showFromSqlErrorMinimal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:showFromSqlErrorMinimal"},{"display_html":"showFromSqlErrorForLogging :: FromSqlError -> String","name":"showFromSqlErrorForLogging","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:showFromSqlErrorForLogging"},{"display_html":"showSqlValueType :: SqlValue -> String","name":"showSqlValueType","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:showSqlValueType"},{"display_html":"class ColumnSpecifier col where","name":"ColumnSpecifier selectForm","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ColumnSpecifier"},{"display_html":"col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a","name":"col","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:col"},{"display_html":"data ToSql a b","name":"ToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:ToSql"},{"display_html":"getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity ()","name":"getField","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:getField"},{"display_html":"getComponent :: (entity -> a) -> ToSql a () -> ToSql entity ()","name":"getComponent","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:getComponent"},{"display_html":"data SchemaItem","name":"SchemaItem Constraint Table DropTable Index DropIndex DropConstraint Sequence DropSequence","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SchemaItem"},{"display_html":"type SchemaDefinition = [SchemaItem]","name":"SchemaDefinition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SchemaDefinition"},{"display_html":"type Record = Int","name":"Record","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Record"},{"display_html":"type CreatedAt = UTCTime","name":"CreatedAt","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:CreatedAt"},{"display_html":"type UpdatedAt = UTCTime","name":"UpdatedAt","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:UpdatedAt"},{"display_html":"type OccurredAt = UTCTime","name":"OccurredAt","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OccurredAt"},{"display_html":"data TableComments a","name":"TableComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:TableComments"},{"display_html":"noComments :: TableComments ()","name":"noComments","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:noComments"},{"display_html":"say :: String -> (Int, Int, Int) -> String -> TableComments ()","name":"say","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:say"},{"display_html":"data WhereCondition","name":"WhereCondition","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:WhereCondition"},{"display_html":"whereAnd :: [WhereCondition] -> WhereCondition","name":"whereAnd","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereAnd"},{"display_html":"whereOr :: [WhereCondition] -> WhereCondition","name":"whereOr","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereOr"},{"display_html":"whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition","name":"whereIn","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereIn"},{"display_html":"whereLike :: FieldDefinition nullability a -> String -> WhereCondition","name":"whereLike","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereLike"},{"display_html":"whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition","name":"whereLikeInsensitive","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereLikeInsensitive"},{"display_html":"whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition","name":"whereNotIn","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereNotIn"},{"display_html":"whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition","name":"whereQualified","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereQualified"},{"display_html":"whereRaw :: String -> [SqlValue] -> WhereCondition","name":"whereRaw","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereRaw"},{"display_html":"whereToSql :: [WhereCondition] -> (String, [SqlValue])","name":"whereToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:whereToSql"},{"display_html":"isNull :: FieldDefinition Nullable a -> WhereCondition","name":"isNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:isNull"},{"display_html":"isNotNull :: FieldDefinition Nullable a -> WhereCondition","name":"isNotNull","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:isNotNull"},{"display_html":"(.==) :: FieldDefinition nullability a -> a -> WhereCondition","name":".==","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-61--61-"},{"display_html":"(.<>) :: FieldDefinition nullability a -> a -> WhereCondition","name":".<>","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60--62-"},{"display_html":"(.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition","name":".<-","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60--45-"},{"display_html":"(%==) :: FieldDefinition nullability a -> a -> WhereCondition","name":"%==","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:-37--61--61-"},{"display_html":"(.>) :: FieldDefinition nullability a -> a -> WhereCondition","name":".>","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-62-"},{"display_html":"(.>=) :: FieldDefinition nullability a -> a -> WhereCondition","name":".>=","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-62--61-"},{"display_html":"(.<) :: FieldDefinition nullability a -> a -> WhereCondition","name":".<","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60-"},{"display_html":"(.<=) :: FieldDefinition nullability a -> a -> WhereCondition","name":".<=","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.-60--61-"},{"display_html":"data SelectOptions = SelectOptions {}","name":"SelectOptions SelectOptions selectDistinct selectOptWhere selectOptOrder selectOptLimit selectOptOffset selectOptGroup","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SelectOptions"},{"display_html":"where_ :: WhereCondition -> SelectOptions","name":"where_","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:where_"},{"display_html":"distinct :: SelectOptions","name":"distinct","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:distinct"},{"display_html":"order :: ToOrderBy a => a -> SortDirection -> SelectOptions","name":"order","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:order"},{"display_html":"limit :: Int -> SelectOptions","name":"limit","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:limit"},{"display_html":"offset :: Int -> SelectOptions","name":"offset","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:offset"},{"display_html":"groupBy :: ToGroupBy a => a -> SelectOptions","name":"groupBy","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:groupBy"},{"display_html":"selectOptionsToSql :: SelectOptions -> (String, [SqlValue])","name":"selectOptionsToSql","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:selectOptionsToSql"},{"display_html":"(<>) :: Semigroup a => a -> a -> a","name":"<>","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:-60--62-"},{"display_html":"data FieldUpdate","name":"FieldUpdate","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:FieldUpdate"},{"display_html":"fieldUpdate :: FieldDefinition nullability a -> a -> FieldUpdate","name":"fieldUpdate","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:fieldUpdate"},{"display_html":"(.:=) :: FieldDefinition nullability a -> a -> FieldUpdate","name":".:=","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:.:-61-"},{"display_html":"data OrderByClause = OrderByClause String [SqlValue] SortDirection","name":"OrderByClause OrderByClause","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:OrderByClause"},{"display_html":"data SortDirection","name":"SortDirection Ascending Descending","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:SortDirection"},{"display_html":"migrateSchema :: MonadOrville conn m => SchemaDefinition -> m ()","name":"migrateSchema","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:migrateSchema"},{"display_html":"data MigrationError","name":"MigrationError MigrationLockExcessiveRetryError MigrationExecutionError","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MigrationError"},{"display_html":"generateMigrationPlan :: MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan)","name":"generateMigrationPlan","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:generateMigrationPlan"},{"display_html":"data MigrationPlan","name":"MigrationPlan","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MigrationPlan"},{"display_html":"data MigrationItem = MigrationItem {}","name":"MigrationItem MigrationItem migrationItemSchemaItem migrationItemDDL","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:MigrationItem"},{"display_html":"migrationPlanItems :: MigrationPlan -> [MigrationItem]","name":"migrationPlanItems","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:migrationPlanItems"},{"display_html":"data Pagination m entity = Pagination {}","name":"Pagination Pagination pageRows pageNext","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#t:Pagination"},{"display_html":"buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> m (Pagination m readEnt)","name":"buildPagination","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:buildPagination"},{"display_html":"selectAll :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m [readEntity]","name":"selectAll","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:selectAll"},{"display_html":"selectFirst :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m (Maybe readEntity)","name":"selectFirst","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:selectFirst"},{"display_html":"deleteRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m ()","name":"deleteRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:deleteRecord"},{"display_html":"deleteWhere :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [WhereCondition] -> m Integer","name":"deleteWhere","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:deleteWhere"},{"display_html":"findRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m (Maybe readEntity)","name":"findRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:findRecord"},{"display_html":"findRecords :: (Ord key, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> [key] -> m (Map key readEntity)","name":"findRecords","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:findRecords"},{"display_html":"findRecordsBy :: (Ord fieldValue, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> m (Map fieldValue [readEntity])","name":"findRecordsBy","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:findRecordsBy"},{"display_html":"insertRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity","name":"insertRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:insertRecord"},{"display_html":"insertRecordMany :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m ()","name":"insertRecordMany","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:insertRecordMany"},{"display_html":"insertRecordManyReturning :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m [readEntity]","name":"insertRecordManyReturning","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:insertRecordManyReturning"},{"display_html":"updateFields :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [FieldUpdate] -> [WhereCondition] -> m Integer","name":"updateFields","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:updateFields"},{"display_html":"updateRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> writeEntity -> m ()","name":"updateRecord","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:updateRecord"},{"display_html":"sequenceNextVal :: MonadOrville conn m => SequenceDefinition -> m Int","name":"sequenceNextVal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:sequenceNextVal"},{"display_html":"sequenceSetVal :: MonadOrville conn m => SequenceDefinition -> Int -> m Int","name":"sequenceSetVal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:sequenceSetVal"},{"display_html":"sequenceCurrVal :: MonadOrville conn m => SequenceDefinition -> m Int","name":"sequenceCurrVal","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:sequenceCurrVal"},{"display_html":"createIndexesConcurrently :: MonadOrville conn m => [IndexDefinition] -> m ()","name":"createIndexesConcurrently","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:createIndexesConcurrently"},{"display_html":"dropIndexesConcurrently :: MonadOrville conn m => [String] -> m ()","name":"dropIndexesConcurrently","module":"Database.Orville.PostgreSQL.Core","link":"Database-Orville-PostgreSQL-Core.html#v:dropIndexesConcurrently"},{"display_html":"data PopError","name":"PopError MissingRecord MissingRecordBy Unpoppable","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#t:PopError"},{"display_html":"data Popper a b","name":"Popper","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#t:Popper"},{"display_html":"data Popped a","name":"Popped PoppedError PoppedValue","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#t:Popped"},{"display_html":"(>>>) :: Category cat => cat a b -> cat b c -> cat a c","name":">>>","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:-62--62--62-"},{"display_html":"(<<<) :: Category cat => cat b c -> cat a b -> cat a c","name":"<<<","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:-60--60--60-"},{"display_html":"abortPop :: PopError -> Popper a b","name":"abortPop","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:abortPop"},{"display_html":"certainly :: PopError -> Popper (Maybe b) b","name":"certainly","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:certainly"},{"display_html":"certainly' :: Popper a PopError -> Popper a (Maybe b) -> Popper a b","name":"certainly'","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:certainly-39-"},{"display_html":"fromKern :: (a -> b) -> Popper a b","name":"fromKern","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:fromKern"},{"display_html":"hasMany :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue [readEntity]","name":"hasMany","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasMany"},{"display_html":"hasManyIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue [readEntity])","name":"hasManyIn","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasManyIn"},{"display_html":"hasOneIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue readEntity)","name":"hasOneIn","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOneIn"},{"display_html":"hasManyInWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper [fieldValue] (Map fieldValue [readEntity])","name":"hasManyInWhere","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasManyInWhere"},{"display_html":"hasManyWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue [readEntity]","name":"hasManyWhere","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasManyWhere"},{"display_html":"hasOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue (Maybe readEntity)","name":"hasOne","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOne"},{"display_html":"hasOne' :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue readEntity","name":"hasOne'","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOne-39-"},{"display_html":"hasOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue (Maybe readEntity)","name":"hasOneWhere","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:hasOneWhere"},{"display_html":"kern :: Popper a a","name":"kern","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:kern"},{"display_html":"popMissingRecord :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue PopError","name":"popMissingRecord","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popMissingRecord"},{"display_html":"onKern :: (a -> b -> c) -> Popper b a -> Popper b c","name":"onKern","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:onKern"},{"display_html":"pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b)","name":"pop","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:pop"},{"display_html":"popThrow :: MonadOrville conn m => Popper a b -> a -> m b","name":"popThrow","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popThrow"},{"display_html":"popFirst :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a (Maybe readEntity)","name":"popFirst","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popFirst"},{"display_html":"popMany :: Popper a b -> Popper [a] [b]","name":"popMany","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popMany"},{"display_html":"onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b","name":"onPopMany","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:onPopMany"},{"display_html":"popMaybe :: Popper a b -> Popper (Maybe a) (Maybe b)","name":"popMaybe","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popMaybe"},{"display_html":"popQuery :: String -> (forall conn m. MonadOrville conn m => m b) -> Popper a b","name":"popQuery","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popQuery"},{"display_html":"popRecord :: TableDefinition readEntity writeEntity key -> key -> Popper a (Maybe readEntity)","name":"popRecord","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popRecord"},{"display_html":"popRecord' :: TableDefinition readEntity writeEntity key -> key -> Popper a readEntity","name":"popRecord'","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popRecord-39-"},{"display_html":"popTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a [readEntity]","name":"popTable","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:popTable"},{"display_html":"explain :: Popper a b -> String","name":"explain","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:explain"},{"display_html":"explainLines :: Popper a b -> [String]","name":"explainLines","module":"Database.Orville.PostgreSQL.Popper","link":"Database-Orville-PostgreSQL-Popper.html#v:explainLines"},{"display_html":"data Operation param result = Operation {}","name":"Operation Operation executeOperationOne executeOperationMany explainOperationOne explainOperationMany","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#t:Operation"},{"display_html":"data AssertionFailed","name":"AssertionFailed","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#t:AssertionFailed"},{"display_html":"mkAssertionFailed :: String -> AssertionFailed","name":"mkAssertionFailed","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:mkAssertionFailed"},{"display_html":"findOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue (Maybe readEntity)","name":"findOne","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findOne"},{"display_html":"findOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue (Maybe readEntity)","name":"findOneWhere","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findOneWhere"},{"display_html":"findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue [readEntity]","name":"findAll","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findAll"},{"display_html":"findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue [readEntity]","name":"findAllWhere","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findAllWhere"},{"display_html":"findSelect :: Select row -> Operation param [row]","name":"findSelect","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:findSelect"},{"display_html":"askParam :: Operation param param","name":"askParam","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:askParam"},{"display_html":"assertRight :: Operation (Either String a) a","name":"assertRight","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:assertRight"},{"display_html":"data SelectOperation param row result = SelectOperation {}","name":"SelectOperation SelectOperation selectOne selectMany explainSelectOne explainSelectMany categorizeRow produceResult","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#t:SelectOperation"},{"display_html":"selectOperation :: Ord param => SelectOperation param row result -> Operation param result","name":"selectOperation","module":"Database.Orville.PostgreSQL.Plan.Operation","link":"Database-Orville-PostgreSQL-Plan-Operation.html#v:selectOperation"},{"display_html":"data Plan scope param result","name":"Plan","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Plan"},{"display_html":"data Planned scope param a","name":"Planned","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Planned"},{"display_html":"data Execute","name":"Execute","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Execute"},{"display_html":"data Explain","name":"Explain","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:Explain"},{"display_html":"askParam :: Plan scope param param","name":"askParam","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:askParam"},{"display_html":"execute :: MonadOrville conn m => Plan Execute param result -> param -> m result","name":"execute","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:execute"},{"display_html":"explain :: Plan Explain param result -> [String]","name":"explain","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:explain"},{"display_html":"findMaybeOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue (Maybe readEntity)","name":"findMaybeOne","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findMaybeOne"},{"display_html":"findMaybeOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue (Maybe readEntity)","name":"findMaybeOneWhere","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findMaybeOneWhere"},{"display_html":"findOne :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity","name":"findOne","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOne"},{"display_html":"findOneShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity","name":"findOneShowVia","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOneShowVia"},{"display_html":"findOneWhere :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity","name":"findOneWhere","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOneWhere"},{"display_html":"findOneWhereShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity","name":"findOneWhereShowVia","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findOneWhereShowVia"},{"display_html":"findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue [readEntity]","name":"findAll","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findAll"},{"display_html":"findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue [readEntity]","name":"findAllWhere","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:findAllWhere"},{"display_html":"bind :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result","name":"bind","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:bind"},{"display_html":"use :: Planned scope param a -> Plan scope param a","name":"use","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:use"},{"display_html":"using :: Planned scope param a -> Plan scope a b -> Plan scope param b","name":"using","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:using"},{"display_html":"chain :: Plan scope a b -> Plan scope b c -> Plan scope a c","name":"chain","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:chain"},{"display_html":"apply :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b","name":"apply","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:apply"},{"display_html":"planMany :: (forall manyScope. Plan manyScope param result) -> Plan scope [param] (Many param result)","name":"planMany","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planMany"},{"display_html":"planList :: (forall scope. Plan scope param result) -> Plan listScope [param] [result]","name":"planList","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planList"},{"display_html":"focusParam :: (a -> b) -> Plan scope b result -> Plan scope a result","name":"focusParam","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:focusParam"},{"display_html":"planEither :: Plan scope leftParam leftResult -> Plan scope rightParam rightResult -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult)","name":"planEither","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planEither"},{"display_html":"planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b)","name":"planMaybe","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planMaybe"},{"display_html":"data AssertionFailed","name":"AssertionFailed","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#t:AssertionFailed"},{"display_html":"assert :: (param -> a -> Either String b) -> Plan scope param a -> Plan scope param b","name":"assert","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:assert"},{"display_html":"planSelect :: Select row -> Plan scope () [row]","name":"planSelect","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planSelect"},{"display_html":"planOperation :: Operation param result -> Plan scope param result","name":"planOperation","module":"Database.Orville.PostgreSQL.Plan","link":"Database-Orville-PostgreSQL-Plan.html#v:planOperation"},{"display_html":"(>>=) :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result","name":">>=","module":"Database.Orville.PostgreSQL.Plan.Syntax","link":"Database-Orville-PostgreSQL-Plan-Syntax.html#v:-62--62--61-"},{"display_html":"module Database.Orville.PostgreSQL.Core","name":"","module":"Database.Orville.PostgreSQL","link":""},{"display_html":"module Database.Orville.PostgreSQL.Popper","name":"","module":"Database.Orville.PostgreSQL","link":""},{"display_html":"insertTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, InsertTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity","name":"insertTriggered","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:insertTriggered"},{"display_html":"class InsertTrigger trigger readEntity where","name":"InsertTrigger insertTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:InsertTrigger"},{"display_html":"updateTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, UpdateTrigger trigger readEntity writeEntity) => TableDefinition readEntity writeEntity key -> readEntity -> writeEntity -> m ()","name":"updateTriggered","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:updateTriggered"},{"display_html":"class UpdateTrigger trigger readEntity writeEntity where","name":"UpdateTrigger updateTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:UpdateTrigger"},{"display_html":"deleteTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, DeleteTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> readEntity -> m ()","name":"deleteTriggered","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:deleteTriggered"},{"display_html":"class DeleteTrigger trigger readEntity where","name":"DeleteTrigger deleteTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:DeleteTrigger"},{"display_html":"class MonadTrigger trigger m | m -> trigger where","name":"MonadTrigger runTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:MonadTrigger"},{"display_html":"data OrvilleTriggerT trigger conn m a","name":"OrvilleTriggerT","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:OrvilleTriggerT"},{"display_html":"data RecordedTriggers trigger","name":"RecordedTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#t:RecordedTriggers"},{"display_html":"committedTriggers :: RecordedTriggers trigger -> [trigger]","name":"committedTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:committedTriggers"},{"display_html":"uncommittedTriggers :: RecordedTriggers trigger -> Maybe [trigger]","name":"uncommittedTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:uncommittedTriggers"},{"display_html":"runOrvilleTriggerT :: MonadIO m => OrvilleTriggerT trigger conn m a -> Pool conn -> m (a, [trigger])","name":"runOrvilleTriggerT","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:runOrvilleTriggerT"},{"display_html":"mapOrvilleTriggerT :: Monad n => (m a -> n b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn n b","name":"mapOrvilleTriggerT","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:mapOrvilleTriggerT"},{"display_html":"liftOrville :: Monad m => OrvilleT conn m a -> OrvilleTriggerT trigger conn m a","name":"liftOrville","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:liftOrville"},{"display_html":"askTriggers :: MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger)","name":"askTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:askTriggers"},{"display_html":"clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m ()","name":"clearTriggers","module":"Database.Orville.PostgreSQL.Trigger","link":"Database-Orville-PostgreSQL-Trigger.html#v:clearTriggers"},{"display_html":"liftWithConnectionViaUnliftIO :: MonadUnliftIO m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b","name":"liftWithConnectionViaUnliftIO","module":"Database.Orville.PostgreSQL.MonadUnliftIO","link":"Database-Orville-PostgreSQL-MonadUnliftIO.html#v:liftWithConnectionViaUnliftIO"},{"display_html":"liftFinallyViaUnliftIO :: MonadUnliftIO m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c","name":"liftFinallyViaUnliftIO","module":"Database.Orville.PostgreSQL.MonadUnliftIO","link":"Database-Orville-PostgreSQL-MonadUnliftIO.html#v:liftFinallyViaUnliftIO"},{"display_html":"liftWithConnectionViaBaseControl :: MonadBaseControl IO m => (forall b. (conn -> IO b) -> IO b) -> (conn -> m a) -> m a","name":"liftWithConnectionViaBaseControl","module":"Database.Orville.PostgreSQL.MonadBaseControl","link":"Database-Orville-PostgreSQL-MonadBaseControl.html#v:liftWithConnectionViaBaseControl"},{"display_html":"liftFinallyViaBaseControl :: MonadBaseControl IO m => (forall c d. IO c -> IO d -> IO c) -> m a -> m b -> m a","name":"liftFinallyViaBaseControl","module":"Database.Orville.PostgreSQL.MonadBaseControl","link":"Database-Orville-PostgreSQL-MonadBaseControl.html#v:liftFinallyViaBaseControl"}] \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/haddock-bundle.min.js b/orville-docsite/site-builder/orville-postgresql-legacy-docs/haddock-bundle.min.js new file mode 100644 index 0000000..1061714 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/haddock-bundle.min.js @@ -0,0 +1,2 @@ +!function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s element with id '"+e+"'");return t}function r(e){for(var t=e.target,n=t.id,r=o(n),i=r.element.open,s=0,l=r.toggles;s0&&(d[n.id]={element:n,openByDefault:!!n.open,toggles:[]},n.addEventListener("toggle",r))}}function s(e){var t=o(e).element;t.open=!t.open}function a(){var e=Object.keys(p);document.cookie="toggled="+encodeURIComponent(e.join("+"))}function l(){var e=h.getCookie("toggled");if(e)for(var t=0,n=e.split("+");t=0&&e.followActiveLink()),"s"===t.key&&"input"!==t.target.tagName.toLowerCase()&&(t.preventDefault(),e.show())})},t.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},t.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},t.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},t.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t={};this.state.fuse.search(e).forEach(function(e){var n=e.item.module;(t[n]||(t[n]=[])).push(e)});var n=[];for(var o in t)!function(e){var o=t[e],r=0;o.forEach(function(e){r+=1/e.score}),n.push({module:e,totalScore:1/r,items:o})}(o);n.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:n})},t.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.top=0}function s(e,t){var n=o(e.className||"");n.indexOf(" "+t+" ")<0&&(e.className=r(n+" "+t))}function a(e,t){var n=o(e.className||"");n=n.replace(" "+t+" "," "),e.className=r(n)}function l(e,t,n,o){return null==o&&(o=!i(e,t)),o?(a(e,n),s(e,t)):(a(e,t),s(e,n)),o}function c(e){var t=document.getElementById("page-menu");if(t&&t.firstChild){var n=t.firstChild.cloneNode(!1);n.innerHTML=e,t.appendChild(n)}}function u(){return Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(e){return-1!=e.rel.indexOf("style")&&e.title})}function h(){var e=u(),t="";e.forEach(function(e){t+="
  • "+e.title+"
  • "}),e.length>1&&c("")}function d(e){for(var t=u(),n=null,o=0;on)return i(e,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},function(e,t,n){"use strict";var o=n(0),r=function e(t,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i=t&&n.push([o,r]),o=-1)}return e[i-1]&&i-o>=t&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(o,"\\$&").replace(n,"|")),i=e.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=E;P-=1){var R=P-1,U=n[e.charAt(R)];if(U&&(b[R]=1),j[P]=(j[P+1]<<1|1)&U,0!==I&&(j[P]|=(L[P+1]|L[P])<<1|1|L[P+1]),j[P]&N&&(C=o(t,{errors:I,currentLocation:R,expectedLocation:g,distance:c}))<=y){if(y=C,(_=R)<=g)break;E=Math.max(1,2*g-_)}}if(o(t,{errors:I+1,currentLocation:g,expectedLocation:g,distance:c})>y)break;L=j}return{isMatch:_>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(u,p),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,h=t.fullSearcher,d=void 0===h?[]:h,p=t.resultMap,f=void 0===p?{}:p,v=t.results,g=void 0===v?[]:v;if(void 0!==i&&null!==i){var m=!1,y=-1,_=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=d.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],w=0;w-1&&(E=(E+y)/2),this._log("Score average:",E);var T=!this.options.tokenize||!this.options.matchAllTokens||_>=u.length;if(this._log("\nCheck Matches: "+T),(m||k.isMatch)&&T){var j=f[l];j?j.output.push({key:n,arrayIndex:r,value:i,score:E,matchedIndices:k.matchedIndices}):(f[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:E,matchedIndices:k.matchedIndices}]},g.push(f[l]))}}else if(a(i))for(var P=0,R=i.length;P-1&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===O?a=[r]:a.push(r),o=i;var l=new e;return l.nodeName=t,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==j.push(e)&&(I.debounceRendering||E)(i)}function i(){var e,t=j;for(j=[];e=t.pop();)e.__d&&L(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===T.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,p,s):e.removeEventListener(t,p,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)d(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function d(e,t,n){try{e[t]=n}catch(e){}}function p(e){return this.__l[e.type](I.event&&I.event(e)||e)}function f(){for(var e;e=P.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function v(e,t,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=e&&!("__preactattr_"in e));var s=g(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||f()),s}function g(e,t,n,o,r){var i=e,s=U;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0))),i.__preactattr_=!0,i;var l=t.nodeName;if("function"==typeof l)return C(e,t,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!e||!a(e,l))&&(i=c(l,U),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0)}var u=i.firstChild,h=i.__preactattr_,d=t.children;if(null==h){h=i.__preactattr_={};for(var p=i.attributes,f=p.length;f--;)h[p[f].name]=p[f].value}return!D&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&m(i,d,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,t.attributes,h),U=s,i}function m(e,t,n,o,r){var i,a,l,c,h,d=e.childNodes,p=[],f={},v=0,m=0,_=d.length,k=0,b=t?t.length:0;if(0!==_)for(L=0;L<_;L++){var x=d[L],w=x.__preactattr_;null!=(S=b&&w?x._component?x._component.__k:w.key:null)?(v++,f[S]=x):(w||(void 0!==x.splitText?!r||x.nodeValue.trim():r))&&(p[k++]=x)}if(0!==b)for(L=0;L2?[].slice.call(arguments,2):e.children)},Component:N,render:function(e,t,n){return v(n,e,{},!1,t,!1)},rerender:i,options:I};void 0!==t?t.exports=F:self.preact=F}()},{}]},{},[3]); +//# sourceMappingURL=haddock-bundle.min.js.map diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/hslogo-16.png b/orville-docsite/site-builder/orville-postgresql-legacy-docs/hslogo-16.png new file mode 100644 index 0000000000000000000000000000000000000000..0ff8579fbd897417b0d6dad6e920f8882138a7c0 GIT binary patch literal 1684 zcmV;F25b3=P)4Tx0C)j~RL^S@K@|QrZmG~B2wH0nvUrdpNm;9CMbtL^5n^i$+aIn^?(HA4aZWV5ov6ELTdbo0FI&wK{O>*+w4vx20?>!`FrQsdJlnHR>OPy zcd~b_n$otK2Za4V;76L-DzNVtaSB-y0*E}{p()372;bw_^6ZZ}PI-92wGS&j#91PI zKs7DSe@(bk%_Y-7gGe}(^>I=@oY#w#*Bu9GZf3^F5WP>3rn}7Ut74&?PWBFvy`A)a zPP5)V!Xd&78LdA?xQ(9mjMYElVd13a#D+Z_7&Y|xU=_C-srWU*6kiZcC!$nw*)9$7 zn6CX+@=AhmkT}X@VSsa5NKe;HZuq)~1$`#h6R+ZTR#D-3j}vF!)ZOnz+5)dI4jl{{ z44Mr{P!L4~VVJN`K!!XTF*LGrKO?IK8z<8w`3e3jI8lUGNUta*C8 zn(P`s>{pjD=7Kek#B;Fw@hxAK%$F&Q6vg9J^Xf~4by_hu-=A!MJ3Znq&n~srbFGPs zH&&aMXZ>nO`|hf|ljc?VPhR!${AbO?W8x_>CU%PFA&Hm8F7cAsOREdwU~R_;ot1_u z(ruCYB-LPGn!NQdT|ZlRy+(fw^-+`=%+gee_kY4FWHg<*4sZI8+sFJD270UUORdLHO0nA4V) z%{fwsET5CQ>B?eK%uw4yQc~9?*JVo2}ze(;aRcp*ceL#HUJSllrgm5wQKR zQu+C;QrUh^8rFfA`ftFz{YAidi-`aL010qNS#tmY4c7nw4c7reD4Tcy00T@(L_t(I z5sj2vNEA^R$7gqDc6T=2^@fUA2(c`MltuL5<|KW>RWz$&YbU@|M|{$E*8Tu-Ux!w z1Y*Dr&Ubfr&v-nZaaB{3ilRumrjPmk{sZvQEWlW+{o~IH|8)=s6c#X9S5s5d%J z4@)&QH5|xQY-)^L1n0pTRu0Lx9`08YTjTwn^6 z0;b1+aQ@)n;Em$q;=7BBi)v0zj&o^g>0Whp^_^5IbxIUP8C@y9;R?*Ouu}rmfxbU= zwtWVNke-m!=`7bYEhWpcI5#)9qp`8E0lr6IQ)ARL3Ui}Af@grj8aN1=r>Cb+prlzO zNfJs*N_tUm2ZL%5* zPmL2??da$TR904gL(VDAQ-Fv_Dk}Pdw*4T(%*f4MKLRg=4ekMjhe2mW zMFsBwg%ftWT}0kxRaIk1k7qJ8*#cKB;Ft{i`zVIs-Nqge;!!Ld7#O&Qqu7e0sJmP) z$MW*>L$vSB&dxp@iA3U9fo)-7!Czlr{|o7Hv{1oyg3xsu%gn@(b1>$;SM-ZaQ`HV=V0s;lr%d8bd;xY zGwNvm3=Iu=tyXIgtJnf@A(2S@M140N ew{UA~tMxaJq;$xaSSi*30000orville-postgresql-legacy-0.9.0.1: ORM

    orville-postgresql-legacy-0.9.0.1: ORM

    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/meta.json b/orville-docsite/site-builder/orville-postgresql-legacy-docs/meta.json new file mode 100644 index 0000000..a655a0f --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/meta.json @@ -0,0 +1 @@ +{"haddock_version":"2.22.0","quickjump_version":1} \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/minus.gif b/orville-docsite/site-builder/orville-postgresql-legacy-docs/minus.gif new file mode 100644 index 0000000000000000000000000000000000000000..1deac2fe1a42e35b994f1b855488f392c50f6a89 GIT binary patch literal 56 zcmZ?wbhEHb summary { + list-style-image: url(minus.gif); +} + +pre { + padding: 0.25em; + margin: 0.8em 0; + background: rgb(229,237,244); + overflow: auto; + border-bottom: 0.25em solid white; + /* white border adds some space below the box to compensate + for visual extra space that paragraphs have between baseline + and the bounding box */ +} + +.src { + background: #f0f0f0; + padding: 0.2em 0.5em; +} + +.keyword { font-weight: normal; } +.def { font-weight: bold; } + +@media print { + #footer { display: none; } +} + +/* @end */ + +/* @group Page Structure */ + +#content { + margin: 0 auto; + padding: 0 2em 6em; +} + +#package-header { + background: rgb(41,56,69); + border-top: 5px solid rgb(78,98,114); + color: #ddd; + padding: 0.2em; + position: relative; + text-align: left; +} + +#package-header .caption { + background: url(hslogo-16.png) no-repeat 0em; + color: white; + margin: 0 2em; + font-weight: normal; + font-style: normal; + padding-left: 2em; +} + +#package-header a:link, #package-header a:visited { color: white; } +#package-header a:hover { background: rgb(78,98,114); } + +#module-header .caption { + color: rgb(78,98,114); + font-weight: bold; + border-bottom: 1px solid #ddd; +} + +table.info { + float: right; + padding: 0.5em 1em; + border: 1px solid #ddd; + color: rgb(78,98,114); + background-color: #fff; + max-width: 40%; + border-spacing: 0; + position: relative; + top: -0.5em; + margin: 0 0 0 2em; +} + +.info th { + padding: 0 1em 0 0; +} + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background: #374c5e; + margin: 0; + text-align: center; + right: 0; + padding: 0; + top: 1.25em; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 0; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + +#style-menu a { + width: 6em; + padding: 3px; + display: block; +} + +#footer { + background: #ddd; + border-top: 1px solid #aaa; + padding: 0.5em 0; + color: #666; + text-align: center; + position: absolute; + bottom: 0; + width: 100%; + height: 3em; +} + +/* @end */ + +/* @group Front Matter */ + +#table-of-contents { + float: right; + clear: right; + background: #faf9dc; + border: 1px solid #d8d7ad; + padding: 0.5em 1em; + max-width: 20em; + margin: 0.5em 0 1em 1em; +} + +#table-of-contents .caption { + text-align: center; + margin: 0; +} + +#table-of-contents ul { + list-style: none; + margin: 0; +} + +#table-of-contents ul ul { + margin-left: 2em; +} + +#description .caption { + display: none; +} + +#synopsis { + display: block; + position: fixed; + right: 0; + height: 80%; + top: 10%; + padding: 0; + max-width: 75%; + /* Ensure that synopsis covers everything (including MathJAX markup) */ + z-index: 1; +} + +#synopsis summary { + display: block; + float: left; + width: 29px; + color: rgba(255,255,255,0); + height: 110px; + margin: 0; + font-size: 1px; + padding: 0; + background: url(synopsis.png) no-repeat 0px -8px; +} + +#synopsis details[open] > summary { + background: url(synopsis.png) no-repeat -64px -8px; +} + +#synopsis ul { + height: 100%; + overflow: auto; + padding: 0.5em; + margin: 0; +} + +#synopsis ul ul { + overflow: hidden; +} + +#synopsis ul, +#synopsis ul li.src { + background-color: #faf9dc; + white-space: nowrap; + list-style: none; + margin-left: 0; +} + +/* @end */ + +/* @group Main Content */ + +#interface div.top { margin: 2em 0; } +#interface h1 + div.top, +#interface h2 + div.top, +#interface h3 + div.top, +#interface h4 + div.top, +#interface h5 + div.top { + margin-top: 1em; +} +#interface .src .selflink, +#interface .src .link { + float: right; + color: #919191; + background: #f0f0f0; + padding: 0 0.5em 0.2em; + margin: 0 -0.5em 0 0; + -moz-user-select: none; +} +#interface .src .selflink { + border-left: 1px solid #919191; + margin: 0 -0.5em 0 0.5em; +} + +#interface span.fixity { + color: #919191; + border-left: 1px solid #919191; + padding: 0.2em 0.5em 0.2em 0.5em; + margin: 0 -1em 0 1em; +} + +#interface span.rightedge { + border-left: 1px solid #919191; + padding: 0.2em 0 0.2em 0; + margin: 0 0 0 1em; +} + +#interface table { border-spacing: 2px; } +#interface td { + vertical-align: top; + padding-left: 0.5em; +} + +#interface td.doc p { + margin: 0; +} +#interface td.doc p + p { + margin-top: 0.8em; +} + +.doc table { + border-collapse: collapse; + border-spacing: 0px; +} + +.doc th, +.doc td { + padding: 5px; + border: 1px solid #ddd; +} + +.doc th { + background-color: #f0f0f0; +} + +.clearfix:after { + clear: both; + content: " "; + display: block; + height: 0; + visibility: hidden; +} + +.subs ul { + list-style: none; + display: table; + margin: 0; +} + +.subs ul li { + display: table-row; +} + +.subs ul li dfn { + display: table-cell; + font-style: normal; + font-weight: bold; + margin: 1px 0; + white-space: nowrap; +} + +.subs ul li > .doc { + display: table-cell; + padding-left: 0.5em; + margin-bottom: 0.5em; +} + +.subs ul li > .doc p { + margin: 0; +} + +/* Render short-style data instances */ +.inst ul { + height: 100%; + padding: 0.5em; + margin: 0; +} + +.inst, .inst li { + list-style: none; + margin-left: 1em; +} + +/* Workaround for bug in Firefox (issue #384) */ +.inst-left { + float: left; +} + +.top p.src { + border-top: 1px solid #ccc; +} + +.subs, .doc { + /* use this selector for one level of indent */ + padding-left: 2em; +} + +.warning { + color: red; +} + +.arguments { + margin-top: -0.4em; +} +.arguments .caption { + display: none; +} + +.fields { padding-left: 1em; } + +.fields .caption { display: none; } + +.fields p { margin: 0 0; } + +/* this seems bulky to me +.methods, .constructors { + background: #f8f8f8; + border: 1px solid #eee; +} +*/ + +/* @end */ + +/* @group Auxillary Pages */ + + +.extension-list { + list-style-type: none; + margin-left: 0; +} + +#mini { + margin: 0 auto; + padding: 0 1em 1em; +} + +#mini > * { + font-size: 93%; /* 12pt */ +} + +#mini #module-list .caption, +#mini #module-header .caption { + font-size: 125%; /* 15pt */ +} + +#mini #interface h1, +#mini #interface h2, +#mini #interface h3, +#mini #interface h4 { + font-size: 109%; /* 13pt */ + margin: 1em 0 0; +} + +#mini #interface .top, +#mini #interface .src { + margin: 0; +} + +#mini #module-list ul { + list-style: none; + margin: 0; +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; + text-align: center; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + font-weight: bold; +} + +#index .caption, +#module-list .caption { font-size: 131%; /* 17pt */ } + +#index table { + margin-left: 2em; +} + +#index .src { + font-weight: bold; +} +#index .alt { + font-size: 77%; /* 10pt */ + font-style: italic; + padding-left: 2em; +} + +#index td + td { + padding-left: 1em; +} + +#module-list ul { + list-style: none; + margin: 0 0 0 2em; +} + +#module-list li { + clear: right; +} + +#module-list span.collapser, +#module-list span.expander { + background-position: 0 0.3em; +} + +#module-list .package { + float: right; +} + +:target { + background-color: #ffff00; +} + +/* @end */ diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt b/orville-docsite/site-builder/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt new file mode 100644 index 0000000..210ab24 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/orville-postgresql-legacy.txt @@ -0,0 +1,2005 @@ +-- Hoogle documentation, generated by Haddock +-- See Hoogle, http://www.haskell.org/hoogle/ + + +-- | ORM +-- +-- ORM library for PostgreSQL +@package orville-postgresql-legacy +@version 0.9.0.1 + + +module Database.Orville.PostgreSQL.Connection + +-- | createConnectionPool allocates a pool of connections to a +-- PosgreSQL server. The returned pool can be used as the endpoint to +-- newOrvilleEnv to construct. +createConnectionPool :: Int -> NominalDiffTime -> Int -> String -> IO (Pool Connection) +data Pool a +data Connection + + +module Database.Orville.PostgreSQL.Expr +data RawExpr +rawSql :: String -> RawExpr +class GenerateSql expr +generateSql :: GenerateSql expr => expr -> RawExpr +data Expr a +rawSqlExpr :: String -> Expr a +expr :: a -> Expr a +type NameExpr = Expr NameForm +data NameForm +unescapedName :: NameForm -> String +type SelectExpr = Expr SelectForm +data SelectForm +SelectForm :: NameForm -> Maybe NameForm -> SelectForm +[selectFormColumn] :: SelectForm -> NameForm +[selectFormAlias] :: SelectForm -> Maybe NameForm +selectColumn :: NameForm -> SelectForm +qualified :: QualifySql form => form -> String -> form +aliased :: SelectForm -> NameForm -> SelectForm + +module Database.Orville.PostgreSQL.Plan.Explanation +data Explanation +noExplanation :: Explanation +explainStep :: String -> Explanation +explanationSteps :: Explanation -> [String] +instance GHC.Base.Semigroup Database.Orville.PostgreSQL.Plan.Explanation.Explanation +instance GHC.Base.Monoid Database.Orville.PostgreSQL.Plan.Explanation.Explanation + +module Database.Orville.PostgreSQL.Plan.Many + +-- | A 'Many k a' represents a group of values keyed by list of parameters +-- and is used to return the results of executing an Orville Plan with a +-- list of input parameters. If you need to find the result of the query +-- associated with a particular input parameter, you can use +-- lookup to find it. If you don't care about the association with +-- particular inputs, you can simply use elems to get a list of +-- all the results. +data Many k a + +-- | NotAKey is returned from various Many related functions +-- when presented with an input parameter that was not one of the +-- original inputs that the Many was constructed with. +data NotAKey +NotAKey :: NotAKey + +-- | fromKeys constructs a Many value from a list of keys and +-- a function that maps them to their values. The order and duplication +-- of keys in the list will be preserved by the Many type in the +-- relevant functions. The mapping function provided should be a total +-- function -- i.e. it should not produce a runtime error. If it is not +-- possible to map every k (even those not in the input list +-- provided to fromKeys), the values should be wrapped in an +-- appropriate type such as Maybe so that an empty or default +-- value can be returned. +fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a + +-- | lookup returns the value for the given parameter. If the given +-- k is not one of the original input values that the +-- Many was constructed with, the mapping function given at the +-- contructor will determine what value to return. Often this will be +-- whatever a reasonable empty or default value for the type a +-- is. +lookup :: k -> Many k a -> Either NotAKey a + +-- | keys fetches the list of keys from a Many. Note that is +-- a list and not a set. Many preserves the order and duplication +-- of any key values that were in the key list at the time of +-- construction. +keys :: Many k a -> [k] + +-- | elems returns all the values that correspond the keys of the +-- Many. The values will be returned in the same order that the +-- keys were present at the time of creation, though if you truly care +-- about this it's probably better to use lookup to make that +-- correspondence explicit. +elems :: Many k a -> [a] + +-- | map calls a function on all the values found in a Many +-- collection. +map :: (a -> b) -> Many k a -> Many k b + +-- | toMap converts the Many into a Map value. If +-- all you wanted to do was find the value for a specific key, you should +-- probably use lookup instead. +toMap :: Ord k => Many k a -> Map k a + +-- | apply allows you to apply many functions to many values. The +-- function associated with each parameter is applied to the value +-- associated with the same paremeter. +-- +-- (If you're looking for pure or an Applicative instance +-- for Many, this is as good as it gets. Many cannot be an +-- Applicative because there is no correct implementation of +-- pure that we can reasonably provide). +apply :: Many param (a -> b) -> Many param a -> Many param b + +-- | compose uses the values of a Many value as keys to a +-- second Many to create a Many mapping from the original +-- keys to the final values. +compose :: Many b c -> Many a b -> Many a c +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Plan.Many.Many k) + + +module Database.Orville.PostgreSQL.Select +data Select row +selectQuery :: FromSql row -> FromClause -> SelectOptions -> Select row +selectQueryTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Select readEntity +selectQueryRows :: [SelectExpr] -> FromClause -> SelectOptions -> Select [(String, SqlValue)] +selectQueryRaw :: FromSql row -> String -> [SqlValue] -> Select row +selectQueryRawRows :: String -> [SqlValue] -> Select [(String, SqlValue)] +selectQueryColumns :: [SelectExpr] -> FromSql row -> FromClause -> SelectOptions -> Select row +selectField :: FieldDefinition nulability a -> SelectForm +data FromClause +fromClauseRaw :: String -> FromClause +fromClauseTableName :: String -> FromClause +fromClauseTable :: TableDefinition readEntity writeEntity key -> FromClause +runSelect :: MonadOrville conn m => Select row -> m [row] + + +module Database.Orville.PostgreSQL.Raw +selectSql :: MonadOrville conn m => String -> [SqlValue] -> FromSql result -> m [result] +selectSqlRows :: MonadOrville conn m => String -> [SqlValue] -> m ResultSet +decodeSqlRows :: MonadOrville conn m => FromSql result -> ResultSet -> m [result] +type ResultSet = [[(String, SqlValue)]] +updateSql :: MonadOrville conn m => String -> [SqlValue] -> m Integer +withConnection :: MonadOrville conn m => (conn -> m a) -> m a + +-- | Migration Guide: withTransaction retains the same name. +withTransaction :: MonadOrville conn m => m a -> m a + +-- | Migration Guide: withCachedConnection has been renamed to +-- withConnection_ +-- +-- Runs an action with a cached connection. Without using this, or +-- wrapping calls in a transaction using withTransaction, +-- successive calls to functions like insertRecord and +-- updateRecord are *not* guaranteed to occur on the same +-- connection. +withCachedConnection :: MonadOrville conn m => m a -> m a + + +module Database.Orville.PostgreSQL.Conduit + +-- | selectConduit provides a way to stream the results of a +-- Select query from the database one by one using the conduit +-- library. You can fuse the conduit built by this function with +-- your own conduit pipeline to handle rows individually in whatever +-- fashion you need (e.g. turning them into rows of CSV). This is useful +-- if you want to be able to process many rows one by one. You can +-- aggregate the results however you require as part of the conduit +-- processing and then use runConduit (or runConduitRes) +-- from the conduit library to execute the processing pipeline. +-- Alternatively, your web server (wai, servant, etc) +-- may provide support for converting a conduit into a streaming HTTP +-- response. +-- +-- Beware: this function must load all the results into memory before +-- streaming can begin. For why, see +-- https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html. +-- If memory use is a concern, try streamPages instead. +selectConduit :: (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m) => Select row -> ConduitT () row m () + +-- | Build a conduit source that is fed by querying one page worth of +-- results at a time. When the last row of the last page is consumed, the +-- stream ends. +streamPages :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> ConduitT () readEnt m () + + +-- | Migration Guide: Although not all exports are identical, most of the +-- items in this module can now be imported from +-- Orville.PostgreSQL. +-- +-- Please note that the new LibPQ-based version of orville represents a +-- complete re-write of Orville from the ground up. As such many of the +-- APIs have been re-thought with the goal of providing stability and +-- better experience long term. +-- +-- Major changes: +-- +--
      +--
    • The library no longer allows the connection type to vary. It is +-- intended only to be used with PostgreSQL. Thus MonadOrville and +-- other types that used to have a conn type parameter no longer +-- have that parameter.
    • +--
    • OrvilleT has been removed in favor of simply using +-- ReaderT. For trivial cases (i.e. ReaderT over +-- IO) a pre-packaged Orville monad is provided.
    • +--
    • In TableDefinition, the order of the type parameters has +-- changed from TableDefinition readEnity writeEntity key to +-- TableDefinition key writeEntity readEntity. This make it more +-- consistent with the order of these arguments in other types. +-- TableParams has been removed in favor of building a basic table +-- definition with the require parameters first and adding or setting +-- other optional items after initial construction.
    • +--
    • RelationalMap has been replaced by SqlMarshaller. +-- Many functions have been renamed, but most functions have a direct or +-- nearly direct translation from the old ones. See the docs on the +-- individual functions such as attrField to see what has +-- changed.
    • +--
    • The auto-migration system is significantly improved. Standard +-- indexes no longer need to be given explicit names. Indexes and +-- constraints are now attached to TableDefinition rather than +-- being their own schema items. Indexes and constraints are no longer +-- dropped explicitly -- they are dropped automatically by Orville when +-- they have been removed from the table definiton.
    • +--
    • A number of places that previously accepted [] now +-- require NonEmpty instead. This is done in places where an +-- empty list would not be valid SQL. For examples of this change see +-- insertRecordMany and updateFields.
    • +--
    • whereAnd and whereOr (which took lists) have been +-- replaced with binary boolean logic functions andExpr and +-- orExpr. These functions also have operator aliases +-- ((.&&), (.||)).
    • +--
    +-- +-- The following items exported from this module have migration guide +-- notes available in their documentation: +-- +-- +module Database.Orville.PostgreSQL.Core + +-- | Migration Guide: TableDefinition can now be imported from +-- PostgreSQL. The order of the type parameters has changed from +-- TableDefinition readEnity writeEntity key to +-- TableDefinition key writeEntity readEntity. In the new +-- Orville tables without primary keys are supported, so the key +-- parameter must now be instantiated as either HasKey keyType +-- or NoKey. +-- +-- A TableDefinition is the center of the Orville universe. A +-- TableDefinition defines the structure of a table in the +-- database and associates it with a Haskell datatype, usually a Haskell +-- record type. The TableDefinition must specify how the Haskell +-- type is converted to and from the database schema, as as well as +-- provide same basic utility functions required by Orville for +-- interacting with the Haskell datatype. +-- +-- Usually you will use TableParams to construct a +-- TableDefinition in a more concise way. This type is provided as +-- an escape hatch for any situations where TableParams is too +-- restrictive for the sql mapping required by a type. +data TableDefinition readEntity writeEntity key +TableDefinition :: String -> [SomeField] -> [String] -> PrimaryKey key -> FromSql readEntity -> ToSql writeEntity () -> (readEntity -> key) -> TableComments () -> TableDefinition readEntity writeEntity key + +-- | The name of the table in the database. +[tableName] :: TableDefinition readEntity writeEntity key -> String + +-- | A list of field definitions defining the table structure +[tableFields] :: TableDefinition readEntity writeEntity key -> [SomeField] + +-- | A list of any columns that may be deleted from the table by Orville. +-- (Orville will never delete a column without being told it is safe) +[tableSafeToDelete] :: TableDefinition readEntity writeEntity key -> [String] + +-- | The statically typed field definition that is the primary key. +-- Currently this field must still by listed in tableFields +[tablePrimaryKey] :: TableDefinition readEntity writeEntity key -> PrimaryKey key + +-- | A definition of how to convert the haskell type from a sql row +[tableFromSql] :: TableDefinition readEntity writeEntity key -> FromSql readEntity + +-- | A function to set the key on the entity +[tableToSql] :: TableDefinition readEntity writeEntity key -> ToSql writeEntity () + +-- | A function to get the key on the entity +[tableGetKey] :: TableDefinition readEntity writeEntity key -> readEntity -> key + +-- | Any comments that might be interesting for developers to see. These +-- comments will get printed in the log if there is an erro while +-- attempting to migrate the table. +[tableComments] :: TableDefinition readEntity writeEntity key -> TableComments () +data PrimaryKey key + +-- | primaryKeyIn builds a WhereCondition that will match all +-- rows where the primary key is equal to one of the given values. For +-- single-field primary keys this is equivalent to whereIn, but +-- primaryKeyIn also handles composite primary keys. +primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition + +-- | primaryKeyEquals builds a WhereCondition that will match +-- the row where the primary key is equal to the given value. For +-- single-field primary keys this is equivalent to .==, but +-- 'primaryKeyEquals also handles composite primary keys. +primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition + +-- | primaryKeyDescription builds a user-readable representation of +-- the primary key for use in error messages and such. It is a +-- comma-delimited list of the names of the fields that make up the +-- primary key. +primaryKeyDescription :: PrimaryKey key -> String + +-- | primaryKeyToSql converts a Haskell value for a primary key into +-- the (possibly multiple) sql values that represent the primary key in +-- the database. +primaryKeyToSql :: PrimaryKey key -> key -> [SqlValue] + +-- | primaryKey constructs a single-field primary key from the +-- FieldDefinition that corresponds to the primary key's column. +-- This is generally used while building a TableDefinition. +primaryKey :: FieldDefinition NotNull key -> PrimaryKey key + +-- | compositePrimaryKey constructs a multi-field primary key from +-- the given parts, each of which corresponds to one field in the primary +-- key. You should use this while building a TableDefinition for +-- a table that you want to have a multi-column primary key. See +-- primaryKeyPart for how to build the parts to be passed as +-- parameters. Note: there is no special significance to the first +-- argument other than requiring that there is at least one field in the +-- primary key. +compositePrimaryKey :: PrimaryKeyPart key -> [PrimaryKeyPart key] -> PrimaryKey key + +-- | primaryKeyPart builds on section of a composite primary key +-- based on the field definition that corresponds to that column of the +-- primary key. The function given is used to decompose the Haskell value +-- for the composite key into the individual parts so they can be +-- converted to sql for things like building WhereCondition +primaryKeyPart :: (key -> part) -> FieldDefinition NotNull part -> PrimaryKeyPart key + +-- | Migration Guide: This function has in the new orville to take the +-- table name, primary key definition and a SqlMarshaller +-- (formerly RelationalMap). Other options such as constraints, +-- indexes, and columns to drop can be added to the +-- TableDefinition after the initial instantiation. The +-- TableParams type has been dropped for the new orville. +-- +-- mkTableDefinition converts a TableParams to +-- TableDefinition. Usually this is used directly on a record +-- literal of the TableParams. For example: +-- +--
    +--   data Foo key = Foo key { fooId :: Record }
    +--   myTable :: TableDefinition Foo
    +--   myTable = mkTableDefinition $
    +--     TableParams
    +--       { tblName = "foo"
    +--       , tblMapper = User $ attrField fooId idField
    +--       , tableSafeToDelete = []
    +--       , tblSetKey = key foo -> foo { fooId = key }
    +--       , tblGetKey = fooId
    +--       , tblComments = []
    +--       }
    +--   
    +mkTableDefinition :: TableParams readEntity writeEntity key -> TableDefinition readEntity writeEntity key + +-- | SqlType defines the mapping of a Haskell type (a) to a SQL +-- column type in the database. This includes both how to convert the +-- type to and from the raw values read from the database as well as the +-- schema information required to create and migrate columns using the +-- type. +data SqlType a +SqlType :: String -> Maybe String -> SqlTypeId -> Maybe Int -> (a -> SqlValue) -> (SqlValue -> Either RowDataErrorReason a) -> SqlType a + +-- | The raw SQL DDL to use when creating/migrating columns of this type +-- (not including any NULL or NOT NULL declarations) +[sqlTypeDDL] :: SqlType a -> String + +-- | The raw SQL DDL to use when creating/migrating columns with foreign +-- keys to this type. This is used foreignRefType to build a new SqlType +-- when making foreign key fields +[sqlTypeReferenceDDL] :: SqlType a -> Maybe String + +-- | sqlTypeId will be compared to the colType field found +-- in the SqlColDesc return by describeTable when +-- determining whether a column type change is required when migrating +-- the database. +[sqlTypeId] :: SqlType a -> SqlTypeId + +-- | 'sqlTypeSqlSize will be compared to the colSize field found +-- in the SqlColDesc return by describeTable when +-- determining whether a column type change is required when migrating +-- the database. +[sqlTypeSqlSize] :: SqlType a -> Maybe Int + +-- | A function for converting Haskell values of this type into values to +-- be stored in the database. +[sqlTypeToSql] :: SqlType a -> a -> SqlValue + +-- | A function for converting values of this are stored in the database +-- into Haskell values. This function should return 'Left +-- RowDataErrorReason' to indicate an error if the conversion is +-- impossible. Otherwise it should return Right the corresponding +-- a value. +[sqlTypeFromSql] :: SqlType a -> SqlValue -> Either RowDataErrorReason a + +-- | serial defines a 32-bit auto-incrementing column type. This +-- corresponds to the SERIAL type in PostgreSQL. +serial :: SqlType Int32 + +-- | bigserial defines a 64-bit auto-incrementing column type. This +-- corresponds to the BIGSERIAL type in PostgresSQL. +bigserial :: SqlType Int64 + +-- | text defines a fixed length text field type. This corresponds +-- to a "CHAR(len)" type in SQL. +text :: Int -> SqlType Text + +-- | varText defines a variable text field type with a max length. +-- This corresponds to a "VARCHAR(len)" type in SQL. +varText :: Int -> SqlType Text + +-- | unboundedText defines a fixed length text field type. This +-- corresponds to a TEXT type in PostgreSQL. +unboundedText :: SqlType Text + +-- | integer defines a 32-bit integer type. This corresponds to the +-- INTEGER type in SQL. +integer :: SqlType Int32 + +-- | bigInteger defines a 64-bit integer type. This corresponds to +-- the BIGINT type in SQL. +bigInteger :: SqlType Int64 + +-- | double defines a floating point numeric type. This corresponds +-- to the "DOUBLE PRECISION" type in SQL. +double :: SqlType Double + +-- | boolean defines a True/False boolean type. This corresponds to +-- the BOOLEAN type in SQL. +boolean :: SqlType Bool + +-- | date defines a type representing a calendar date (without time +-- zone). It corresponds to the DATE type in SQL. +date :: SqlType Day + +-- | timestamp defines a type representing a particular point in +-- time (without time zone). It corresponds to the "TIMESTAMP with time +-- zone" type in SQL. +-- +-- Note: This is NOT a typo. The "TIMESTAMP with time zone" type in SQL +-- does not include any actual time zone information. For an excellent +-- explanation of the complexities involving this type, please see Chris +-- Clark's blog post about it: +-- http://blog.untrod.com/2016/08/actually-understanding-timezones-in-postgresql.html +timestamp :: SqlType UTCTime + +-- | textSearchVector defines a type for indexed text searching. It +-- corresponds to the TSVECTOR type in PostgreSQL. +textSearchVector :: SqlType Text + +-- | Migration Guide: convertSqlType retains the same name +-- +-- convertSqlType changes the Haskell type used by a +-- SqlType in the same manner as maybeConvertSqlType in +-- cases where an a can always be converted to a b. +convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b + +-- | Migration Guide: maybeConvertSqlType has been replaced with +-- tryConvertSqlType, which allows an error message to be +-- returned when conversion fails. +-- +-- maybeConvertSqlType changes the Haskell type used by a +-- SqlType without changing the column type that will be used in +-- the database schema. The functions given will be used to convert the +-- now Haskell type to and from the original type when reading and +-- writing values from the database. When reading an a value +-- from the database, the conversion function should produce +-- Nothing if the value cannot be successfully converted to a +-- b. +maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b + +-- | MigrationGuide: TableParams no longer exists. See the +-- migration guide for mkTableDefinition +-- +-- TableParams is the simplest way to make a +-- TableDefinition. You can use mkTableDefinition to make a +-- definition from the simplified params. Where TableDefinition +-- requires the tableFields, tableFromSql, and +-- tableToSql to all be defined separately and kept in sync, +-- TableParams provides a single tblMapper field that +-- specifies all three simultaneously and ensures they are consistent +-- with one another. +data TableParams readEntity writeEntity key +TableParams :: String -> RelationalMap writeEntity readEntity -> [String] -> PrimaryKey key -> (readEntity -> key) -> TableComments () -> TableParams readEntity writeEntity key + +-- | The name of the table in the database +[tblName] :: TableParams readEntity writeEntity key -> String + +-- | The relational mapping that defines how the Haskell entity type is +-- converted both to and from sql. The fields utilized in the mapping are +-- used to automatically build the list of FieldDefinitions that +-- define the structure of the table in the database. +[tblMapper] :: TableParams readEntity writeEntity key -> RelationalMap writeEntity readEntity + +-- | A list of any columns that may be deleted from the table by Orville. +-- (Orville will never delete a column without being told it is safe) +[tblSafeToDelete] :: TableParams readEntity writeEntity key -> [String] + +-- | A function to set the key on the entity +[tblPrimaryKey] :: TableParams readEntity writeEntity key -> PrimaryKey key + +-- | A function to get the key on the entity +[tblGetKey] :: TableParams readEntity writeEntity key -> readEntity -> key + +-- | Any comments that might be interesting for developers to see. These +-- comments will get printed in the log if there is an erro while +-- attempting to migrate the table. +[tblComments] :: TableParams readEntity writeEntity key -> TableComments () + +-- | Migration guide: This type has been replaced with the +-- SqlMarshaller type in the new orville. The interface is +-- similar, though the names of the functions have been updated in many +-- cases. See the migration guides for those functions to find their new +-- names. +data RelationalMap a b + +-- | Migration Guide: The fields in new orville's SqlMarshaller +-- are somewhat more sophisticated than those of a +-- RelationalMap. The fields function is no longer +-- offered with this simple interface as a result, but the +-- foldMarshallerFields function can be used in combination with +-- the collectFromField helper to collect the desired +-- information from each field. +fields :: RelationalMap a b -> [SomeField] + +-- | Migration Guide: mapAttr has been renamed to +-- marshallNested +mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c + +-- | Migration Guide: mapField has been removed, though its +-- functional equivalent is marshallReadOnlyField +mapField :: FieldDefinition nullability a -> RelationalMap a a + +-- | Migration Guide: attrField has been renamed to +-- marshallField +attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b + +-- | Migration Guide: maybeMapper has been renamed to +-- marshallMaybe +maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b) + +-- | Migration Guide: prefixMap has been renamed to +-- prefixMarshaller +prefixMap :: String -> RelationalMap a b -> RelationalMap a b + +-- | Migration Guide: partialMap has been renamed to +-- marshallPartial +partialMap :: RelationalMap a (Either String a) -> RelationalMap a a + +-- | Migration Guide: readOnlyMap has been renamed to +-- marshallReadOnly +readOnlyMap :: RelationalMap a b -> RelationalMap c b + +-- | Migration Guide: readOnlyField has been renamed to +-- marshallReadOnlyField +readOnlyField :: FieldDefinition nullability a -> RelationalMap b a + +-- | Migration Guide: OrvilleEnv has been renamed to +-- OrvilleState. It no longer has any type paremeters. The +-- connection type is fixed and cannot be changed. +-- +-- OrvilleEnv tracks all the environment information required for +-- an 'OrvilleT conn m' Monad to operate. Use newOrvilleEnv to +-- construct one. +data OrvilleEnv conn + +-- | Migration Guide: newOrvilleEnv has been renamed to +-- newOrvilleState. The new function requires a parameter to be +-- passed before the connection pool to specify the level of detail to be +-- used when Orville reports errors. +-- +-- newOrvilleEnv initialized an OrvilleEnv for service. The +-- connection pool provided will be used to obtain connections to the +-- database ase required. You can use the createConnectionPool +-- utility function to create a connection pool to a PosgreSQL server. +newOrvilleEnv :: Pool conn -> OrvilleEnv conn + +-- | Migration Guide: setStartTransactionSQL has been renamed to +-- setBeginTransactionExpr +setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn + +-- | Migration Guide: aroundRunningQuery has been renamed to +-- addSqlExecutionCallback +aroundRunningQuery :: (forall a. QueryType -> String -> IO a -> IO a) -> OrvilleEnv conn -> OrvilleEnv conn + +-- | Migration Guide: addTransactionCallBack retains the same name +addTransactionCallBack :: (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn +ormEnvPool :: OrvilleEnv conn -> Pool conn +data TransactionEvent +TransactionStart :: TransactionEvent +TransactionCommit :: TransactionEvent +TransactionRollback :: TransactionEvent + +-- | Migration Guide: OrvilleT has been removed. In its place you +-- can simply use a ReaderT OrvilleState. If you have another +-- ReaderT layer in your monad stack you can add the +-- OrvilleState to the reader context for that layer instead, +-- which is more efficient than having multiple ReaderT layers. +-- If you have a simple case of OrvilleT conn IO the new Orville +-- offers a simpler Orville monad (not a transformer) to get you +-- started. +data OrvilleT conn m a +unOrvilleT :: OrvilleT conn m a -> ReaderT (OrvilleEnv conn) m a +data SqlValue + +-- | Migration Guide: HasOrvilleContext has been renamed to +-- HasOrvilleState. getOrvilleEnv and +-- localOrvilleEnv have been renamed to askOrvilleState +-- and localOrvilleState. +-- +-- HasOrvilleContext defines the operations that must be available +-- in your own monad for managing the connection pool that Orville +-- functions will use to access the database and manage transaction +-- state. In most cases you can include OrvilleT in your Monad +-- stack and then automatically derive an instance of +-- HasOrvilleContext. +-- +-- You could also provide your own implementations of these functions +-- instead of using OrvilleT, if that is the easiest approach for +-- your Monad. +class IConnection conn => HasOrvilleContext conn m | m -> conn + +-- | getOrvilleEnv fetches the Orville environment from the Monad context. +-- Analogous to ask from the Reader monad. +getOrvilleEnv :: HasOrvilleContext conn m => m (OrvilleEnv conn) +localOrvilleEnv :: HasOrvilleContext conn m => (OrvilleEnv conn -> OrvilleEnv conn) -> m a -> m a + +-- | Migration Guide: MonadOrville retains the same name, but the +-- conn parameter has been removed. MonadFail and +-- MonadThrow have been removed as superclass constraints. +-- +-- MonadOrville does not have any methods of its own. Instead it +-- brings all the typeclass constraints required by Orville functions +-- that need to access the database into a single typeclass. In some +-- cases you can include OrvilleT in your Monad stack and then +-- automatically derive an instance of MonadOrville. However, more +-- likely you are using some third party monad somewhere in your stack +-- that does not han a MonadOrvilleControl instance. In this case +-- you won't be able to derive MonadOrville, but providing a +-- simple empty instance will do: +-- +--
    +--   instance O.MonadOrville Postgres.Connection MyMonad
    +--   
    +--   
    +class (Monad m, MonadIO m, HasOrvilleContext conn m, MonadThrow m, MonadOrvilleControl m, MonadFail m) => MonadOrville conn m + +-- | Migration Guide: runOrville now operates on the concrete +-- Orville monad becase OrvilleT has been removed. +-- Assuming you are replacing usages of OrvilleT with +-- ReaderT you will want to replace usages of +-- runOrville with runReaderT. +runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a + +-- | Migration Guide: mapOrvilleT has been removed because +-- OrvilleT has been removed. If you're replacing +-- OrvilleT with ReaderT then mapOrvilleT +-- should be replaced with mapReaderT. +mapOrvilleT :: Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b + +-- | Migration Guide: MonadOrvilleControl retains the same name. +-- The liftFinally member has been removed. There are new +-- liftCatch and liftMask members that must be +-- implemented, however. Instances of the new +-- MonadOrvilleControl are provided for IO and +-- ReaderT. Helper functions for implmenting the members via +-- UnliftIO can be found in +-- Orville.PostgreSQL.UnliftIO. +-- +-- MonadOrvilleControl provides an interface for the kinds of IO +-- operations that Orville functions need to lift into the Monad +-- providing the MonadOrville instance. This typeclass allows +-- users to provide their own lifting strategies in case the Monad stack +-- in question has special needs. If you are only using ReaderT +-- and OrvilleT layers in your monad stack, you can probably +-- implement this for your own Monad wrapper type using the provided +-- default functions and providing functions to wrap and unwrapper your +-- Monad layer: +-- +--
    +--   instance MonadOrvilleControl MyMonad where
    +--     liftWithConnection = defaultLiftWithConnection wrapMyMonad unWrapMyMonad
    +--     liftFinally = defaultLiftFinally wrapMyMonad unWrapMyMonad
    +--   
    +--   
    +-- +-- If you are using transformers in your monad stack beyond +-- ReaderT, they probably don't provide MonadOrvilleControl +-- instances (e.g. third party libraries). In this case, see +-- MonadUnliftIO for more help. If you're still stuck (because +-- your library doesn't support MonadTransControl), try +-- MonadBaseControl instead. If you're *still* stuck after that, +-- please file an issue on Github at +-- https://github.com/flipstone/orville so we can can help out! +class MonadOrvilleControl m +liftWithConnection :: MonadOrvilleControl m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b +liftFinally :: MonadOrvilleControl m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c + +-- | Migration Guide: defaultLiftWithConnection has been removed. +-- In its place you can use either the ReaderT instance of +-- MonadOrvilleControl or the helpers in +-- Orville.PostgreSQL.UnliftIO. +-- +-- defaultLiftWithConnection provides a simple definition of +-- liftWithConnection for MonadOrvilleControl instances +-- when the Monad in question is a wrapper around a type that already +-- implements MonadOrvilleControl +defaultLiftWithConnection :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a. (conn -> IO a) -> IO a) -> (conn -> n b) -> n b + +-- | Migration Guide: defaultLiftWithConnection has been removed +-- (along with liftFinally) +-- +-- defaultLiftFinally provides a simple definition of +-- liftWithConnection for MonadOrvilleControl instances +-- when the Monad in question is a wrapper around a type that already +-- implements MonadOrvilleControl +defaultLiftFinally :: MonadOrvilleControl m => (forall a. m a -> n a) -> (forall a. n a -> m a) -> (forall a b. IO a -> IO b -> IO a) -> n c -> n d -> n c +data QueryType +SelectQuery :: QueryType +InsertQuery :: QueryType +UpdateQuery :: QueryType +DeleteQuery :: QueryType +DDLQuery :: QueryType + +-- | Migration Guide: withCachedConnection has been renamed to +-- withConnection_ +-- +-- Runs an action with a cached connection. Without using this, or +-- wrapping calls in a transaction using withTransaction, +-- successive calls to functions like insertRecord and +-- updateRecord are *not* guaranteed to occur on the same +-- connection. +withCachedConnection :: MonadOrville conn m => m a -> m a + +-- | Migration Guide: withTransaction retains the same name. +withTransaction :: MonadOrville conn m => m a -> m a + +-- | Migration Guide: ColumnFlag has been removed. Depending on +-- flag constructor there may or may not be a replacement. +-- +-- ColumnDefault - replaced by the setDefaultValue +-- function in new orville Unique - replaced by the +-- addUniqueConstraint function in new orville +-- References - replaced by the addForeignKeyConstraint +-- function in new orville ColumnDescription - removed +-- AssignedByDatabase - removed, though many cases are handled +-- by marshallReadOnlyField +data ColumnFlag +Default :: a -> ColumnFlag +Unique :: ColumnFlag +References :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> ColumnFlag +ColumnDescription :: String -> ColumnFlag +AssignedByDatabase :: ColumnFlag +class ColumnDefault a +toColumnDefaultSql :: ColumnDefault a => a -> String +data Now +Now :: Now + +-- | Migration Guide: The signature of the FieldDefinition type +-- has not changed, but many of the constructors and accessors have. See +-- the migration guides on individual functions for more info. +data FieldDefinition nullability a + +-- | Nullable is a values-less type used to track that a +-- FieldDefinition represents a field that is marked nullable in +-- the database schema. See the Nullability type for the +-- value-level representation of field nullability. +data Nullable + +-- | 'NotNull is a values-less type used to track that a +-- FieldDefinition represents a field that is marked not-null in +-- the database schema. See the Nullability type for the +-- value-level representation of field nullability. +data NotNull + +-- | Nullability represents whether a field will be marked as +-- NULL or 'NOT NULL' in the database schema. It is a GADT so +-- that the value constructors can be used to record this knowledge in +-- the type system as well. This allows functions that work only on +-- Nullable or NotNull fields to indicate this in their +-- type signatures as appropriate. +data Nullability nullability +[Nullable] :: Nullability Nullable +[NotNull] :: Nullability NotNull + +-- | Migration Guide: isFieldNullable has been replaced with +-- fieldIsNotNullable, which has the same signture but the +-- Bool returned is the opposite. +isFieldNullable :: FieldDefinition nullability a -> Bool + +-- | Migration Guide: fieldOfType is essentially unchanged in the +-- new orville. +fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a + +-- | Migration Guide: textField has been renamed to +-- boundedTextField. It now takes an Int32 rather than +-- an Int +textField :: String -> Int -> FieldDefinition NotNull Text + +-- | Migration Guide: fixedTextField retains the same name. It now +-- takes an Int32 rather than an Int +fixedTextField :: String -> Int -> FieldDefinition NotNull Text + +-- | Migration Guide: unboundedTextField retains the same name. +unboundedTextField :: String -> FieldDefinition NotNull Text + +-- | Migration Guide: dayField has been renamed to +-- dateField +dayField :: String -> FieldDefinition NotNull Day + +-- | Migration Guide: utcTimeField has been renamed to +-- utcTimestampField +utcTimeField :: String -> FieldDefinition NotNull UTCTime + +-- | Migration guide: int32Field has been renamed to +-- integerField +int32Field :: String -> FieldDefinition NotNull Int32 + +-- | Migration guide: int64Field has been renamed to +-- bigIntegerField +int64Field :: String -> FieldDefinition NotNull Int64 + +-- | Migration guide: doubleField retains the same name. +doubleField :: String -> FieldDefinition NotNull Double + +-- | Migration guide: boolField has been renamed to +-- booleanField +boolField :: String -> FieldDefinition NotNull Bool + +-- | Migration guide: automaticIdField has been renamed to +-- serialField +automaticIdField :: String -> FieldDefinition NotNull Int32 + +-- | Migration guide: searchVectorField has been renamed to +-- textSearchVectorField +searchVectorField :: String -> FieldDefinition NotNull Text + +-- | Migration Guide: nullableField retains the same name +-- +-- Makes a NotNull field Nullable by wrapping the Haskell +-- type of the field in Maybe. The field will be marked as +-- NULL in the database schema and the value Nothing will +-- be used to represent NULL values when converting to and from +-- sql. +nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a) + +-- | Migration Guide: foreignKeyField has been removed. It is +-- replaced by addForeignKeyConstraint which adds a foreign key +-- constraint to an existing FieldDefinition. +foreignKeyField :: String -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability key -> FieldDefinition nullability key + +-- | Migration Guide: withFlag has been removed. See the migration +-- guide on ColumnFlag regarding the new API. +withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a + +-- | Migration Guide: withName has been removed. +withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a + +-- | Migration Guide: withConversion has been replaced with +-- convertField, whose arguments are flipped from those of +-- withConversion. Note there is also now a coerceField +-- function that can be used with newtype wrappers, provided the +-- constructor is available where coerceField is used. +withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b + +-- | Migration Guide: fieldFromSql has been replaced with +-- fieldValueFromSqlValue +fieldFromSql :: FieldDefinition nullability a -> FromSql a + +-- | Migration Guide: fieldToSqlValue has been renamed to +-- fieldValueToSqlValue +fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue +data SomeField +SomeField :: FieldDefinition nullability a -> SomeField + +-- | Migration Guide: withPrefix has been replaced by +-- prefixField whose arguments are flipped relative to +-- withPrefix +withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a +fieldName :: FieldDefinition nullability a -> String +fieldType :: FieldDefinition nullability a -> SqlType a + +-- | fieldFlags has been removed. See the new +-- fieldDefaultValue and fieldTableConstraints +-- functions +fieldFlags :: FieldDefinition nullability a -> [ColumnFlag] +data IndexDefinition +IndexDefinition :: String -> Bool -> String -> String -> IndexDefinition +[indexName] :: IndexDefinition -> String +[indexUnique] :: IndexDefinition -> Bool +[indexTable] :: IndexDefinition -> String +[indexBody] :: IndexDefinition -> String + +-- | Migration Guide: uniqueIndex no longer requires a name to be +-- specified. Migration will be done automatically by inspecting the +-- structure of the indexes that exist in the database. It also no longer +-- accepts a TableDefinition at the time of creating the +-- IndexDefinition. Instead you should use +-- addTableIndexes to add the IndexDefinition to the +-- TableDefinition for the table that you wish to index. +-- +-- If you wish to specify the index name explicitly, you can use +-- uniqueNamedIndex instead. If you do so, index migration will +-- be managed by comparing to the names of existing indexes rather than +-- checking that the index structure matches the Haskell definition. +uniqueIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition + +-- | Migration Guide: simpleIndex has been renamed to +-- nonUniqueIndex. It no longer requires a name to be specified. +-- Migration will be done automatically be inspecting the structure of +-- the indexes that exist in the database. It also no longer accepts a +-- TableDefinition at the time of creating the +-- IndexDefinition. Instead you should use +-- addTableIndexes to add the IndexDefinition to the +-- TableDefinition for the table that you wish to index. +-- +-- If you wish to specify the index name explicitly, you can use +-- nonUniqueNamedIndex instead. If you do so, index migration +-- will be managed by comparing to the names of existing indexes rather +-- than checking that the index structure matches the Haskell definition. +simpleIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> IndexDefinition + +-- | Works much the same as simpleIndex but takes a list of strings +-- that are the conditions of a where clause on index creation for +-- partial indexes +simplePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition + +-- | Works much the same as uniqueIndex but takes a list of strings +-- that are the conditions of a where clause on index creation for +-- partial indexes +uniquePartialIndex :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> [String] -> IndexDefinition +data ConstraintDefinition +ConstraintDefinition :: String -> String -> String -> ConstraintDefinition +[constraintName] :: ConstraintDefinition -> String +[constraintTable] :: ConstraintDefinition -> String +[constraintBody] :: ConstraintDefinition -> String +data SequenceDefinition +SequenceDefinition :: String -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Bool -> SequenceDefinition +[sequenceName] :: SequenceDefinition -> String +[sequenceIncrement] :: SequenceDefinition -> Maybe Int +[sequenceMinValue] :: SequenceDefinition -> Maybe Int +[sequenceMaxValue] :: SequenceDefinition -> Maybe Int +[sequenceStart] :: SequenceDefinition -> Maybe Int +[sequenceCache] :: SequenceDefinition -> Maybe Int +[sequenceCycle] :: SequenceDefinition -> Bool + +-- | Migration Guide: uniqueConstraint no longer accepts a name +-- parameter. Instead the constraint is migrated automatically based on +-- the structure of existing constraints found in the database. It also +-- no longer accepts a TableDefinition. Instead you should use +-- addTableConstraints to add the ConstraintDefinition +-- to the table that you wish to apply the constraint to. +uniqueConstraint :: String -> TableDefinition readEntity writeEntity key -> [SomeField] -> ConstraintDefinition + +-- | Migration Guide: dropConstraint has been removed. Constraints +-- are now dropped automatically during auto-migration when they are +-- removed from the TableDefinition. +dropConstraint :: TableDefinition readEntity writeEntity key -> String -> SchemaItem +data FromSql a +data FromSqlError + +-- | Captures a failure in the translation of a SQL value from a particular +-- field to it's corresponding Haskell values. +RowDataError :: !RowDataErrorDetails -> FromSqlError + +-- | An expected column was not returned by the database +MissingColumn :: !MissingColumnDetails -> FromSqlError + +-- | A conversion between haskell representations failed at a point where +-- we don't know what column the value came from. This is the case when +-- using the partialMap combinator. +ConversionError :: !ConversionErrorDetails -> FromSqlError +data RowDataErrorDetails +RowDataErrorDetails :: !RowDataErrorReason -> !String -> ![(String, SqlValue)] -> RowDataErrorDetails +[rowErrorReason] :: RowDataErrorDetails -> !RowDataErrorReason + +-- | Column name for the erroneous value +[rowErrorColumnName] :: RowDataErrorDetails -> !String + +-- | Primary keys. Empty if not known +[rowErrorPrimaryKeys] :: RowDataErrorDetails -> ![(String, SqlValue)] +data RowDataErrorReason + +-- | Sql value has a different type than expected +TypeMismatch :: !String -> !String -> RowDataErrorReason + +-- | An integer value was outside the expected bounds. +IntegralOutOfBounds :: !Integer -> !Integer -> !Integer -> RowDataErrorReason + +-- | Generic decoding failure +DecodingFailure :: !String -> RowDataErrorReason +data MissingColumnDetails +MissingColumnDetails :: !String -> ![String] -> MissingColumnDetails +[missingColumn] :: MissingColumnDetails -> !String +[actualColumns] :: MissingColumnDetails -> ![String] +data ConversionErrorDetails +ConversionErrorDetails :: !String -> ![(String, SqlValue)] -> ConversionErrorDetails +[convErrorReason] :: ConversionErrorDetails -> !String + +-- | Primary key value(s). Empty if not known +[convErrorPrimaryKeys] :: ConversionErrorDetails -> ![(String, SqlValue)] + +-- | Shows the error in a way that should not contain any potentially +-- sensitive data. This is used for the Show instance. +showFromSqlErrorMinimal :: FromSqlError -> String + +-- | Shows the error in a way appropriate for logging within an +-- application. The resulting string contains information that is useful +-- for debugging but is potentially undesirable to expose outside of the +-- application (such as primary key values). +showFromSqlErrorForLogging :: FromSqlError -> String + +-- | User friendly identifier labels for SqlValues +showSqlValueType :: SqlValue -> String +class ColumnSpecifier col +selectForm :: ColumnSpecifier col => col -> SelectForm +col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a +data ToSql a b +getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity () +getComponent :: (entity -> a) -> ToSql a () -> ToSql entity () + +-- | Migration Guide: SchemaItem retains the same name. The +-- Index, DropIndex, Constraint and +-- DropConstraint constructors have been removed. These items +-- are now added to the TableDefinition via +-- addTableConstraints and addTableIndexes. The +-- remaining constructors have been prefixed with the word +-- Schema (e.g. Table has been renamed to +-- SchemaTable). There is no explicit replacement for +-- DropIndex and DropConstraint. Orville will +-- automatically drop indexes and constraints that are no longer +-- mentioned on the TableDefinition for any tables that it +-- migrates. +data SchemaItem +Table :: TableDefinition readEntity writeEntity key -> SchemaItem +DropTable :: String -> SchemaItem +Index :: IndexDefinition -> SchemaItem +DropIndex :: String -> SchemaItem +Constraint :: ConstraintDefinition -> SchemaItem +DropConstraint :: String -> String -> SchemaItem +Sequence :: SequenceDefinition -> SchemaItem +DropSequence :: String -> SchemaItem + +-- | Migration Guide: SchemaDefinition has been removed. Use +-- [SchemaItem] instead. +type SchemaDefinition = [SchemaItem] + +-- | Migration Guide: Record has been removed. It's recommended +-- that you create a separate record key type for each of your entities +-- instead. +type Record = Int +type CreatedAt = UTCTime +type UpdatedAt = UTCTime +type OccurredAt = UTCTime +data TableComments a +noComments :: TableComments () +say :: String -> (Int, Int, Int) -> String -> TableComments () +data WhereCondition + +-- | Migration Guide: whereAnd has been removed. Use the binary +-- function andExpr to combine BooleanExpr expressions +-- instead. andExpr is also available as the operator +-- (.&&) +whereAnd :: [WhereCondition] -> WhereCondition + +-- | Migration Guide: whereOr has been removed. Use the binary +-- function orExpr to combine BooleanExpr expressions +-- instead. orExpr is also available as the operator +-- (.||) +whereOr :: [WhereCondition] -> WhereCondition + +-- | Migration Guide: whereIn has been renamed to +-- fieldIn. It now takes a NonEmpty list of values to +-- reflect this is a requirement in SQL. +whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition + +-- | Migration Guide: whereLike has been renamed to +-- fieldLike. It now takes a T.Text value rather than a +-- String. +whereLike :: FieldDefinition nullability a -> String -> WhereCondition + +-- | Migration Guide: whereLikeInsensitive has been renamed to +-- fieldLikeInsensitive. It now takes a T.Text value +-- rather than a String. +whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition + +-- | Migration Guide: whereNotIn has been renamed to +-- fieldNotIn. It now takes a NonEmpty list of values +-- to reflect this is a requirement in SQL. +whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition + +-- | Migration Guide: whereQualified has been removed. If you need +-- qualified column references you can use the SQL building functions +-- found in Orville.PostgreSQL.Expr to build them. The +-- qualifyColumn function can be used to qualify column +-- references in that context. BooleanExpr values built directly +-- this way can be easily used in conjuction with other helpers such as +-- fieldEquals which also build BooleanExpr values +-- themselves. +whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition + +-- | Migration Guide: whereRaw has been removed. In its place you +-- should use the more general functions such as +-- unsafeSqlExpression or unsafeRawSql in the +-- Orville.PostgreSQL.Raw.RawSql module to build a +-- BooleanExpr. +whereRaw :: String -> [SqlValue] -> WhereCondition + +-- | Migration Guide: whereToSql has been removed. It is replaced +-- by the more general toBytesAndParams function in +-- Orville.PostgreSQL.Raw.RawSql. +whereToSql :: [WhereCondition] -> (String, [SqlValue]) + +-- | Migration Guide: isNull has been renamed to +-- fieldIsNull +isNull :: FieldDefinition Nullable a -> WhereCondition + +-- | Migration Guide: isNotNull has been renamed to +-- fieldIsNotNull +isNotNull :: FieldDefinition Nullable a -> WhereCondition +(.==) :: FieldDefinition nullability a -> a -> WhereCondition +(.<>) :: FieldDefinition nullability a -> a -> WhereCondition +(.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition +(%==) :: FieldDefinition nullability a -> a -> WhereCondition +(.>) :: FieldDefinition nullability a -> a -> WhereCondition +(.>=) :: FieldDefinition nullability a -> a -> WhereCondition +(.<) :: FieldDefinition nullability a -> a -> WhereCondition +(.<=) :: FieldDefinition nullability a -> a -> WhereCondition +data SelectOptions +SelectOptions :: First Bool -> [WhereCondition] -> [OrderByClause] -> First Int -> First Int -> [GroupByClause] -> SelectOptions +[selectDistinct] :: SelectOptions -> First Bool +[selectOptWhere] :: SelectOptions -> [WhereCondition] +[selectOptOrder] :: SelectOptions -> [OrderByClause] +[selectOptLimit] :: SelectOptions -> First Int +[selectOptOffset] :: SelectOptions -> First Int +[selectOptGroup] :: SelectOptions -> [GroupByClause] +where_ :: WhereCondition -> SelectOptions +distinct :: SelectOptions +order :: ToOrderBy a => a -> SortDirection -> SelectOptions +limit :: Int -> SelectOptions +offset :: Int -> SelectOptions +groupBy :: ToGroupBy a => a -> SelectOptions +selectOptionsToSql :: SelectOptions -> (String, [SqlValue]) + +-- | An associative operation. +(<>) :: Semigroup a => a -> a -> a +infixr 6 <> +data FieldUpdate +fieldUpdate :: FieldDefinition nullability a -> a -> FieldUpdate +(.:=) :: FieldDefinition nullability a -> a -> FieldUpdate +data OrderByClause +OrderByClause :: String -> [SqlValue] -> SortDirection -> OrderByClause +data SortDirection +Ascending :: SortDirection +Descending :: SortDirection + +-- | Migration Guide: migrateSchema has been renamed to +-- autoMigrateSchema +-- +-- migrateSchema will attempt to make changes to the actual database +-- schema that it it matches the provided SchemaDefinition. Unsafe +-- migrations such as dropping tables or columns are never attempted +-- unless the SchemaDefinition explicitly states that the items are safe +-- to drop. Column types may be changed, but will fail if the database +-- cannot successfully make the request type change. +migrateSchema :: MonadOrville conn m => SchemaDefinition -> m () +data MigrationError +MigrationLockExcessiveRetryError :: String -> MigrationError +MigrationExecutionError :: SchemaItem -> SomeException -> MigrationError + +-- | Migration Guide: generateMigrationPlan retains the same name. +-- It has changed to always return a MigrationPlan. You can use +-- check whether migrationPlanSteps is as empty list if you wish +-- to determine whether any migrations will be performed by the plan. +-- +-- generateMigrationPlan inspects the state of the actual database schema +-- and constructs a plan describing what changes would be made to make it +-- match the provided SchemaDefinition. If the actual schema already +-- matches the definition, Nothing will be returned. +generateMigrationPlan :: MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan) + +-- | Migration Guide: MigrationPlan retains the same name. +data MigrationPlan + +-- | Migration Guide: MigrationItem has been renamed to +-- MigrationStep, which is now a simple RawSql wrapper. +-- You can use RawSql.toExampleBytes if you wish to render it to +-- a bytestring for display purposes. +data MigrationItem +MigrationItem :: SchemaItem -> DDL -> MigrationItem +[migrationItemSchemaItem] :: MigrationItem -> SchemaItem +[migrationItemDDL] :: MigrationItem -> DDL + +-- | Migration Guide: migrationPlanItems has been renamed to +-- migrationPlanSteps +migrationPlanItems :: MigrationPlan -> [MigrationItem] +data Pagination m entity +Pagination :: [entity] -> Maybe (m (Pagination m entity)) -> Pagination m entity +[pageRows] :: Pagination m entity -> [entity] +[pageNext] :: Pagination m entity -> Maybe (m (Pagination m entity)) +buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField) => TableDefinition readEnt write key -> FieldDefinition NotNull orderField -> (readEnt -> orderField) -> Maybe WhereCondition -> Word -> m (Pagination m readEnt) + +-- | Migration Guide: selectAll has been renamed to +-- findEntitiesBy +selectAll :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m [readEntity] + +-- | Migration Guide: selectFirst has been renamed to +-- findFirstEntityBy +selectFirst :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> SelectOptions -> m (Maybe readEntity) + +-- | Migration Guide: deleteRecord has been renamed to +-- deleteEntity. Note that there are also new variant functions +-- deleteAndReturnEntity and +-- deleteEntityAndReturnRowCount that return Maybe +-- readEntity and Int respectively. +deleteRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m () + +-- | Migration Guide: deleteWhere has been renamed to +-- deleteEntities. It now takes a Maybe BooleanExpr +-- rather than [WhereCondition] +deleteWhere :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [WhereCondition] -> m Integer + +-- | Migration Guide: findRecord has been renamed to +-- findEntity +findRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> m (Maybe readEntity) + +-- | Migration Guide: findRecords has been renamed to +-- findEntities. It now requires a NonEmpty key rather +-- than simply [key] and returns a [readEntity] instead +-- of a Map. +findRecords :: (Ord key, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> [key] -> m (Map key readEntity) + +-- | Migration Guide: findRecordsBy has been renamed to +-- findEntitiesBy. It no longer takes a FieldDefinition +-- to group by. Instead it simply returns a [readEntity] +findRecordsBy :: (Ord fieldValue, MonadOrville conn m) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> m (Map fieldValue [readEntity]) + +-- | Migration Guide: insertRecord has been renamed to +-- insertAndReturnEntity. Note there are also new variant +-- functions insertEntity and +-- insertEntityAndReturnRowCount that return () and +-- Int respectively. +insertRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity + +-- | Migration Guide: insertRecordMany has been renamed to +-- insertEntities. It now requires a NonEmpty +-- writeEntity rather than [writeEntity]. Note that there +-- are also new variant functions insertAndReturnEntities and +-- insertEntitiesAndReturnRowCount. +insertRecordMany :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m () + +-- | Migration Guide: insertRecordManyReturning has been renamed +-- to insertAndReturnEntities. +insertRecordManyReturning :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [writeEntity] -> m [readEntity] + +-- | Migration Guide: updateFields has been renamed to +-- updateFieldsAndReturnRowCount, but now takes a NonEmpty +-- SetClause instead of a [Field Update] and a Maybe +-- BooleanExpr instead of a [WhereCondition]. +-- +-- updateFields still exists as a variant of this function, but +-- returns () rather than Int. +-- updateFieldsAndReturnEntities is now available as well. +updateFields :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> [FieldUpdate] -> [WhereCondition] -> m Integer + +-- | Migration Guide: updateRecord has been renamed to +-- updateEntity. Note that there are also new variant functions +-- updateAndReturnEntity and +-- updateEntityAndReturnRowCount@. +updateRecord :: MonadOrville conn m => TableDefinition readEntity writeEntity key -> key -> writeEntity -> m () +sequenceNextVal :: MonadOrville conn m => SequenceDefinition -> m Int +sequenceSetVal :: MonadOrville conn m => SequenceDefinition -> Int -> m Int +sequenceCurrVal :: MonadOrville conn m => SequenceDefinition -> m Int + +-- | Migration Plan: createIndexesConcurrently has been removed. +-- You should now use setIndexCreationStrategy Asynchronous +-- instead. +-- +-- createIndexesConcurrently will create the given indexes, if they do +-- not exist using the PostgreSQL concurrently feature. However, this +-- does *not* mean the the function happens concurrently. This will wait +-- for PostgreSQL to return, but other operations to the table will be +-- allowed during index creation. +-- +-- Note: PostgreSQL does not allow CREATE INDEX CONCURRENTLY to appear +-- inside of a transaction. Use this function with care. +createIndexesConcurrently :: MonadOrville conn m => [IndexDefinition] -> m () + +-- | Migration Guide: dropIndexesConcurrently has been removed. +-- +-- dropIndexesConcurrently will drop each of the given indexes with the +-- CONCURRENTLY keyword, allowing for other table operations to continue +-- while the index is dropped. However there are several caveats that +-- come with this as noted at +-- https://www.postgresql.org/docs/9.6/sql-dropindex.html . Much +-- like createIndexesConcurrently this cannot be used in a +-- transaction. But further this cannot drop indexes that support UNIQUE +-- or PRIMARY KEY constraints. +-- +-- Use this with care. +dropIndexesConcurrently :: MonadOrville conn m => [String] -> m () + + +module Database.Orville.PostgreSQL.Popper +data PopError +MissingRecord :: TableDefinition readEntity writeEntity key -> PrimaryKey key -> key -> PopError +MissingRecordBy :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> fieldValue -> PopError +Unpoppable :: String -> PopError +data Popper a b +data Popped a +PoppedValue :: a -> Popped a +PoppedError :: PopError -> Popped a + +-- | Left-to-right composition +(>>>) :: Category cat => cat a b -> cat b c -> cat a c +infixr 1 >>> + +-- | Right-to-left composition +(<<<) :: Category cat => cat b c -> cat a b -> cat a c +infixr 1 <<< +abortPop :: PopError -> Popper a b +certainly :: PopError -> Popper (Maybe b) b +certainly' :: Popper a PopError -> Popper a (Maybe b) -> Popper a b +fromKern :: (a -> b) -> Popper a b +hasMany :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue [readEntity] +hasManyIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue [readEntity]) +hasOneIn :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper [fieldValue] (Map fieldValue readEntity) +hasManyInWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper [fieldValue] (Map fieldValue [readEntity]) +hasManyWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue [readEntity] +hasOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue (Maybe readEntity) +hasOne' :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue readEntity +hasOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> SelectOptions -> Popper fieldValue (Maybe readEntity) +kern :: Popper a a +popMissingRecord :: TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Popper fieldValue PopError +onKern :: (a -> b -> c) -> Popper b a -> Popper b c +pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b) +popThrow :: MonadOrville conn m => Popper a b -> a -> m b +popFirst :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a (Maybe readEntity) +popMany :: Popper a b -> Popper [a] [b] +onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b +popMaybe :: Popper a b -> Popper (Maybe a) (Maybe b) + +-- | popQuery embeds an Orville operation in a popper. It is left up to the +-- programmer to ensure that the Orville operation does not do any +-- updates to the database, but only does queries. +-- +-- The initial string argument is a description of the query to put into +-- the results of explain +popQuery :: String -> (forall conn m. MonadOrville conn m => m b) -> Popper a b +popRecord :: TableDefinition readEntity writeEntity key -> key -> Popper a (Maybe readEntity) +popRecord' :: TableDefinition readEntity writeEntity key -> key -> Popper a readEntity +popTable :: TableDefinition readEntity writeEntity key -> SelectOptions -> Popper a [readEntity] +explain :: Popper a b -> String +explainLines :: Popper a b -> [String] +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Popper.Popper a) +instance GHC.Base.Applicative (Database.Orville.PostgreSQL.Popper.Popper a) +instance Control.Category.Category Database.Orville.PostgreSQL.Popper.Popper +instance Control.Arrow.Arrow Database.Orville.PostgreSQL.Popper.Popper +instance Control.Arrow.ArrowChoice Database.Orville.PostgreSQL.Popper.Popper +instance GHC.Base.Functor Database.Orville.PostgreSQL.Popper.Popped +instance GHC.Base.Applicative Database.Orville.PostgreSQL.Popper.Popped +instance GHC.Show.Show Database.Orville.PostgreSQL.Popper.PopError +instance GHC.Exception.Type.Exception Database.Orville.PostgreSQL.Popper.PopError + +module Database.Orville.PostgreSQL.Plan.Operation + +-- | Operation provides a stucture for building primitive operations +-- that can be incorporated into a Plan. An Operation +-- provides base case implementations of the various plan execution +-- functions. You only need to care about this type if you want to create +-- new custom operations to include in a Plan beyond those already +-- provided in the Plan api. +data Operation param result +Operation :: (forall conn m. MonadOrville conn m => param -> m (Either AssertionFailed result)) -> (forall conn m. MonadOrville conn m => [param] -> m (Either AssertionFailed (Many param result))) -> Explanation -> Explanation -> Operation param result + +-- | executeOperationOne will be called when an plan is executed +-- with a single input parameter +[executeOperationOne] :: Operation param result -> forall conn m. MonadOrville conn m => param -> m (Either AssertionFailed result) + +-- | executeOperationMany will be called when an plan is executed +-- with multiple input parameters (via planMany). +[executeOperationMany] :: Operation param result -> forall conn m. MonadOrville conn m => [param] -> m (Either AssertionFailed (Many param result)) + +-- | explainOperationOne will be called when producing an +-- explanation of what the plan will do when given one input parameter. +-- Plans that do not perform any interesting IO interactions should +-- generally return an empty explanation. +[explainOperationOne] :: Operation param result -> Explanation + +-- | explainOperationMany will be called when producing an +-- explanation of what the plan will do when given multiple input +-- parameters (via planMany). Plans that do not perform any +-- interesting IO interactions should generally return an empty +-- explanation. +[explainOperationMany] :: Operation param result -> Explanation + +-- | AssertionFailed may be returned from the execute functions of +-- an Operation to indicate that some expected invariant has +-- failed. For example, following a foreign key that is enforced by the +-- database only to find that no record exists. When an Operation +-- returns an AssertionFailed value during plan execution the +-- error is thrown as an exception using the MonadThrow instance +-- for whatever monad the plan is executing in. +data AssertionFailed + +-- | mkAssertionFailed builds an AssertionFailed error from +-- an error message. +mkAssertionFailed :: String -> AssertionFailed + +-- | findOne builds a planning primitive that finds (at most) one +-- row from the given table where the column value for the provided +-- FieldDefinition matches the plan's input parameter. When +-- executed on multiple parameters it fetches all rows where the field +-- matches the inputs and arbitrarily picks at most one of those rows to +-- use as the result for each input. +findOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue (Maybe readEntity) + +-- | findOneWhere is similar to findOne but allows a +-- WhereCondition to be specified that is added to the database +-- query to restrict which rows are returned. +findOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue (Maybe readEntity) + +-- | findAll builds a planning primitive that finds all the rows +-- from the given table where the column value for the provided field +-- matches the plan's input parameter. Where executed on multiple +-- parameters all rows are fetch in a single query and then associated +-- with their respective inputs after being fetched. +findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Operation fieldValue [readEntity] + +-- | findAllWhere is similar to findAll but allows a +-- WhereCondition to be specified that is added to the database +-- query to restrict which rows are returned. +findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Operation fieldValue [readEntity] + +-- | findSelect builds a plan Operation where the select that +-- is run does not use the input parameters for the plan in any way. If +-- the executeOperationMany function of the resulting +-- Operation will run the query once and use the entire result set +-- as the result each of the input parameters in turn. +findSelect :: Select row -> Operation param [row] + +-- | askParam simply returns the paremeter given from the plan. +askParam :: Operation param param + +-- | assertRight returns the value on the Right side of an +-- Either. If the Either is a Left, it raises +-- AssertionFailed with the message from the left side of the +-- either. +assertRight :: Operation (Either String a) a + +-- | SelectOperation is a helper type for building Operation +-- primitives that run Select queries. Specifying the fields of +-- SelectOperation and then using the selectOperation +-- function to build an Operation is more convenient that building +-- functions to execute the queries thate are required by the +-- Operation type. +data SelectOperation param row result +SelectOperation :: (param -> Select row) -> ([param] -> Select row) -> Select row -> Select row -> (row -> param) -> ([row] -> result) -> SelectOperation param row result + +-- | selectOne will be called to build the Select query that +-- should be run when there is a single input parameter while executing a +-- plan. Note that the "One-ness" here refers to the single input +-- parameter rather than result. See produceResult below for more +-- information about returning one values vs. many from a +-- SelectOperation. +[selectOne] :: SelectOperation param row result -> param -> Select row + +-- | selectMany will be called to build the Select query that +-- should be run when there are multiple parameters while executing a +-- plan. Note that the "Many-ness" here refers to the multiple input +-- parameters rather than result. See produceResult below for more +-- information about returning one values vs. many from a +-- SelectOperation. +[selectMany] :: SelectOperation param row result -> [param] -> Select row + +-- | explainSelectOne should show a representative query of what +-- will be returned when selectOne is used. No input parameter is +-- available here to build the query, however, because this value is used +-- to explain a plan without actually running it. +[explainSelectOne] :: SelectOperation param row result -> Select row + +-- | explainSelectMany should show a representative query of what +-- will be returned when 'selectMany is used. No input parameters are +-- available here to build the query, however, because this value is used +-- to explain a plan without actually running it. +[explainSelectMany] :: SelectOperation param row result -> Select row + +-- | categorizeRow will be used when a plan is executed with +-- multiple parameters to determine which input parameter the row should +-- be associated with. +[categorizeRow] :: SelectOperation param row result -> row -> param + +-- | produceResult will be used convert the row type +-- returned by the Select queries for the operation input the +-- result type that is present as the output of the operation. +-- The input rows will be all the inputs associated with a single +-- parameter. The result type constructed here need not be a +-- single value. For instance, findAll uses the list type as the +-- result type and findOne uses Maybe. +[produceResult] :: SelectOperation param row result -> [row] -> result + +-- | selectOperation builds a primitive planning Operation +-- using the functions given by a SelectOperation. If you are +-- implementing a custom operation that runs a select statement, it is +-- probably easier to use this function rather than building the +-- Operation functions directly. +selectOperation :: Ord param => SelectOperation param row result -> Operation param result +instance GHC.Show.Show Database.Orville.PostgreSQL.Plan.Operation.AssertionFailed +instance GHC.Exception.Type.Exception Database.Orville.PostgreSQL.Plan.Operation.AssertionFailed + +module Database.Orville.PostgreSQL.Plan + +-- | A Plan is an executable set of queries that can be executed to +-- load data from the database, using the results of prior queries as +-- input parameters to following queries in controlled ways. In +-- particular, the "controlled" aspect of this allows plans that take a +-- single input to be adapted to take multiple input parameters in a list +-- without the resulting plan executing N+1 queries. This restriction +-- means that while query results can be used as input parameters to +-- later queries, they cannot be used to decide to run completely +-- different queries based on other query results. Allowing this would +-- prevent the Plan structure from eliminating N+1 query loops. +-- +-- Note that during execution queries are never combined across tables to +-- form joins or subqueries. Queries are still executed in the same +-- sequence as specified in the plan, just on all the inputs at once +-- rather than in a loop. If you need to do a join with a plan, you can +-- always construction your own custom Operation and use +-- planOperation to incorporate into a plan. +-- +-- The param type variable indicates what type of value is +-- expected as input when the plan is executed. +-- +-- The result type for a plan indicates what Haskell type is +-- produced when the plan is executed. +-- +-- The scope type is used internally by Orville to track the +-- plan is currently executed against a single input or multiple inputs. +-- This type parameter should never specified as a concrete type in user +-- code, but must be exposed as a variable to ensure that execute scope +-- is tracked correctly through usages of bind. +data Plan scope param result + +-- | A Planned value is a wrapper around the results of previous run +-- queries when using the bind function. At the time that you are +-- writing a plan you do not know whether the Plan will be run +-- with a single input or multiple inputs. A Planned value may end +-- up being either an individual item or a list of items. Due to this, +-- your ability to interact with the value is limited to the use of +-- fmap to extract (or build) other values from the results. +-- Planned values can be used together with the use +-- function to make a Plan that produces the extracted value. +-- +-- Note that while Planned could provide an Applicative +-- instance as well, it does not to avoid confusion with +-- Applicative instance for Plan itself. If you need to +-- build a value from several Planned values using +-- Applicative, you should call use on each of the values +-- and use the Applicative instance for Plan. +data Planned scope param a + +-- | Execute is a tag type used by as the scope variable +-- for Plan values when executing them via the execute +-- function. +data Execute + +-- | Explain is an tag type used as the scope variable when +-- explaining a Plan via the explain function. +data Explain + +-- | askParam allows the input parameter for the plan to be +-- retrieved as the result of the plan. Together with bind you can +-- use this to get access to the input parameter as a Planned +-- value. +askParam :: Plan scope param param + +-- | execute accepts the input parameter (or parameters) expected by +-- a Plan and runs the plan to completion, either throwing an +-- AssertionFailed exception in the monad m or producing +-- the expected result. +-- +-- If you have a plan that takes one input and want to provide a list of +-- input, use planMany to adapt it to a multple-input plan before +-- calling execute. +execute :: MonadOrville conn m => Plan Execute param result -> param -> m result + +-- | explain produces a textual description of the steps outlined by +-- a Plan -- in most cases example SQL queries. If you want to see +-- the explanation of how the plan will run with multiple input +-- parameters, you can use planMany to adapt it before calling +-- explain. +explain :: Plan Explain param result -> [String] + +-- | findMaybeOne constructs a Plan that will find at most +-- one row from the given table where the plan's input value matches the +-- given database field. +findMaybeOne :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue (Maybe readEntity) + +-- | findMaybeOneWhere is similar to findMaybeOne, but allows +-- a WhereCondition to be specified to restrict which rows are +-- matched by the database query. +findMaybeOneWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue (Maybe readEntity) + +-- | findOne is an alias to findOneShowVia that uses the +-- Show instance of fieldValue when producing a failure +-- message in the result the entity cannot be found. +findOne :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity + +-- | findOneShowVia is similar to 'findMaybeOne, but it expects that +-- there will always be a row found matching the plan's input value. If +-- no row is found an AssertionFailed exception will be thrown. +-- This is a useful convenience when looking up foreign-key associations +-- that are expected to be enforced by the database itself. +findOneShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue readEntity + +-- | findOneWhere is an alias to findOneWhereShowVia that +-- uses the Show instance of fieldValue when producing a +-- failure message in the result the entity cannot be found. +findOneWhere :: (Show fieldValue, Ord fieldValue) => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity + +-- | findOneWhereShowVia is similar to findOneShowVia, but +-- allows a WhereCondition to be specified to restrict which +-- rows are matched by the database query. +findOneWhereShowVia :: Ord fieldValue => (fieldValue -> String) -> TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue readEntity + +-- | findAll constructs a Plan that will find all the rows +-- from the given table there the plan's input value matches the given +-- database field. +findAll :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> Plan scope fieldValue [readEntity] + +-- | findAllWhere is similar to findAll, but allows a +-- WhereCondition to be specified to restrict which rows are +-- matched by the database query. +findAllWhere :: Ord fieldValue => TableDefinition readEntity writeEntity key -> FieldDefinition nullability fieldValue -> WhereCondition -> Plan scope fieldValue [readEntity] + +-- | bind gives access to the results of a plan to use as input +-- values to future plans. The plan result is given the input parameter +-- to the provided function, which must produce the remaining Plan +-- to be executed. The value will be wrapped in the Planned type, +-- which may represent either a result or multiple results, depending on +-- whether one plan is currently be executed with one and multiple input +-- parameters. This ensures that the caller produces only a single +-- remaining Plan to be used for all inputs when there are +-- multiple to eliminate the need to possibly run different queries for +-- different inputs (which would an introduce N+1 query execution). +-- +-- The Planned value (or values) provided by bind have +-- actually been retrieved from the database, so the value can be used +-- multiple times when constructing the remaining Plan without +-- fear of causing the query to run multiple times. +-- +-- Also see use for how to lift a Planned value back into a +-- Plan. +bind :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result + +-- | use constructs a Plan that always produces the +-- Planned value as its result, regardless of the parameter given +-- as input to the plan. +use :: Planned scope param a -> Plan scope param a + +-- | using uses a Planned value in the input to another +-- Plan. The resulting plan will ignore its input and use the +-- Planned value as the input to produce its result instead. +using :: Planned scope param a -> Plan scope a b -> Plan scope param b + +-- | chain connects the output of one plan to the input of another +-- to form a larger plan that will execute the first followed by the +-- second. +chain :: Plan scope a b -> Plan scope b c -> Plan scope a c + +-- | apply applies a function produced by a plan to the value +-- produced by another plan. This is usually used via the +-- <*> operator through the Applicative instance for +-- Plan. +apply :: Plan scope param (a -> b) -> Plan scope param a -> Plan scope param b + +-- | planMany adapts a plan that takes a single input parameter to +-- work on multiple input parameters. When the new plan is executed each +-- query will execute in the same basic order, but with adjusted +-- conditions to find all the rows for all inputs at once rather than +-- running the planned queries once for each input. +planMany :: (forall manyScope. Plan manyScope param result) -> Plan scope [param] (Many param result) + +-- | planList lifts a plan so both its param and result become +-- lists. This saves you from having to fmap in elems when all you +-- want back from a Many is the list of results inside it. +planList :: (forall scope. Plan scope param result) -> Plan listScope [param] [result] + +-- | focusParam builds a plan from a function and an existing plan +-- taking the result of that function as input. This is especially useful +-- when there is some structure, and a plan that only needs a part of +-- that structure as input. The function argument can access part of the +-- structure for the plan argument to use, so the final returned plan can +-- take the entire structure as input. +focusParam :: (a -> b) -> Plan scope b result -> Plan scope a result + +-- | planEither lets you construct a plan that branches by executing +-- a different plan for the Left and Right sides of an +-- Either value. When used with a single input parameter only one +-- of the two plans will be used, based on the input parameter. When used +-- on multiple input parameters, each of the two plans will be executed +-- only once with all the Left and Right values provided as +-- input parameters respectively. +planEither :: Plan scope leftParam leftResult -> Plan scope rightParam rightResult -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult) + +-- | planMaybe lifts a plan so both its param and result become +-- Maybes. This is useful when modifying an existing plan to deal +-- with optionality. Writing just one plan can then easily produce both +-- the required and optional versions. +planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b) + +-- | AssertionFailed may be returned from the execute functions of +-- an Operation to indicate that some expected invariant has +-- failed. For example, following a foreign key that is enforced by the +-- database only to find that no record exists. When an Operation +-- returns an AssertionFailed value during plan execution the +-- error is thrown as an exception using the MonadThrow instance +-- for whatever monad the plan is executing in. +data AssertionFailed + +-- | assert allows you to make an assertion about a plans result +-- that will throw an AssertionFailed failed exception during +-- execution if it proves to be false. The first parameter is the +-- assertion function, which should return either an error message to be +-- given in the exception or the value to be used as the plan's result. +assert :: (param -> a -> Either String b) -> Plan scope param a -> Plan scope param b + +-- | planSelect allows any Orville Select query to be +-- incorporated into a plan. Note that the Select cannot depend on +-- the plan's input parameters in this case. If the plan is executed with +-- multiple inputs the same set of all the results will be used as the +-- results for each of the input parameters. +planSelect :: Select row -> Plan scope () [row] + +-- | planOperation allows any primitive Operation to be used +-- as an atomic step in a plan. When the plan is executed, the +-- appropriate Operation functions will be used depending on the +-- execution context. +planOperation :: Operation param result -> Plan scope param result +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Plan.Plan scope param) +instance GHC.Base.Applicative (Database.Orville.PostgreSQL.Plan.Plan scope param) +instance GHC.Base.Functor (Database.Orville.PostgreSQL.Plan.Planned scope param) + + +-- | This module exports the bind function as >>= so +-- that it can be used in conjuction with the QualifiedDo +-- language extension to write plans using do syntax like so: +-- +--
    +--   module MyModule where
    +--   
    +--   import qualified Orville.PostgreSQL.Plan.Syntax as PlanSyntax
    +--   
    +--   data FooFamily =
    +--     FooFamily
    +--       { foo :: Foo
    +--       , children :: [FooChildren]
    +--       , pets :: [FooPets]
    +--       }
    +--   
    +--   findFooFamily = PlanSyntax.do $
    +--     fooHeader <- Plan.findOne fooTable fooIdField
    +--     fooChildren <- Plan.findAll fooChildTable fooIdField
    +--     fooPets <- Plan.findAll fooPetTable fooIdField
    +--   
    +--     FooFamily
    +--       $ Plan.use fooHeader
    +--       * Plan.use fooChildren
    +--       * Plan.use fooPets
    +--   
    +module Database.Orville.PostgreSQL.Plan.Syntax + +-- | An operator alias of bind so that it can be used with +-- QualifiedDo. +(>>=) :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result + + +-- | See Database.Orville.PostgreSQL.Core for information about +-- migrating to the new LibPQ-based Orville. +module Database.Orville.PostgreSQL + +module Database.Orville.PostgreSQL.Trigger +insertTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, InsertTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> writeEntity -> m readEntity +class InsertTrigger trigger readEntity +insertTriggers :: InsertTrigger trigger readEntity => readEntity -> [trigger] +updateTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, UpdateTrigger trigger readEntity writeEntity) => TableDefinition readEntity writeEntity key -> readEntity -> writeEntity -> m () +class UpdateTrigger trigger readEntity writeEntity +updateTriggers :: UpdateTrigger trigger readEntity writeEntity => readEntity -> writeEntity -> [trigger] +deleteTriggered :: (MonadThrow m, MonadOrville conn m, MonadTrigger trigger m, DeleteTrigger trigger readEntity) => TableDefinition readEntity writeEntity key -> readEntity -> m () +class DeleteTrigger trigger readEntity +deleteTriggers :: DeleteTrigger trigger readEntity => readEntity -> [trigger] +class MonadTrigger trigger m | m -> trigger +runTriggers :: MonadTrigger trigger m => [trigger] -> m () +data OrvilleTriggerT trigger conn m a +data RecordedTriggers trigger +committedTriggers :: RecordedTriggers trigger -> [trigger] +uncommittedTriggers :: RecordedTriggers trigger -> Maybe [trigger] +runOrvilleTriggerT :: MonadIO m => OrvilleTriggerT trigger conn m a -> Pool conn -> m (a, [trigger]) +mapOrvilleTriggerT :: Monad n => (m a -> n b) -> OrvilleTriggerT trigger conn m a -> OrvilleTriggerT trigger conn n b +liftOrville :: Monad m => OrvilleT conn m a -> OrvilleTriggerT trigger conn m a +askTriggers :: MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger) +clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m () + + +-- | MonadUnliftIO provides functions and instances for using +-- MonadOrville and OrvilleT for Monad transformer +-- stacks that are using MonadUnliftIO. The most common way to +-- do this is simply to add the following MonadOrvilleControl +-- instance: +-- +--
    +--   instance MonadOrvilleControl MyMonad where
    +--     liftWithConnection = liftWithConnectionViaUnliftIO
    +--     liftFinally = liftFinallyViaUnliftIO
    +--   
    +-- +-- This module also provides a MonadUnliftIO instance for +-- OrvilleT and OrvilleTrigger. | +module Database.Orville.PostgreSQL.MonadUnliftIO + +-- | liftWithConnectionViaUnliftIO can be use as the implementation of +-- liftWithConnection for MonadOrvilleControl when the +-- Monad implements MonadUnliftIO. | +liftWithConnectionViaUnliftIO :: MonadUnliftIO m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b + +-- | liftFinallyViaUnliftIO can be use as the implementation of +-- liftFinally for MonadOrvilleControl when the +-- Monad implements MonadUnliftIO. | +liftFinallyViaUnliftIO :: MonadUnliftIO m => (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c +instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Database.Orville.PostgreSQL.Internal.Monad.OrvilleT conn m) +instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Database.Orville.PostgreSQL.Internal.Trigger.OrvilleTriggerT trigger conn m) + + +-- | ResourceT provides ResourceT instance of the Orville +-- typeclasses for situations where you might need it. In particular, if +-- you are using the conduit library, you may want to wrap +-- ResourceT around your normal monad stack, in which case you'll +-- need the MonadOrville instance provided here to use +-- selectConduit. +-- +-- These instances are not included in the default exports for Orville +-- because the required either a MonadUnliftIO or +-- MonadBaseControl instance of the monad underlying +-- ResourceT, depending on the version of ResourceT you are +-- using. For resource-1.1.10 and above you must provide +-- MonadUnliftIO instance. For versions prior to 1.1.10 you must +-- provide a MonadBaseControl instance. +-- +-- This is required by MonadOrville requires an instance to +-- MonadBaseControl to be defined. The instance provided here +-- can only use one lifting strategy, one we choose MonadUnliftIO +-- wherever possible (both by our own opinion and because later versions +-- of ResourceT have removed MonadBaseControl support). +-- MonadBaseControl is used for versions of ResourceT +-- before ResourceT supported MonadUnliftIO. +module Database.Orville.PostgreSQL.ResourceT +instance (GHC.Base.Monad m, Database.Orville.PostgreSQL.Internal.Monad.HasOrvilleContext conn m) => Database.Orville.PostgreSQL.Internal.Monad.HasOrvilleContext conn (Control.Monad.Trans.Resource.Internal.ResourceT m) +instance (Database.Orville.PostgreSQL.Internal.Monad.MonadOrvilleControl m, Control.Monad.IO.Unlift.MonadUnliftIO m) => Database.Orville.PostgreSQL.Internal.Monad.MonadOrvilleControl (Control.Monad.Trans.Resource.Internal.ResourceT m) +instance (Control.Monad.IO.Unlift.MonadUnliftIO m, Database.Orville.PostgreSQL.Internal.Monad.MonadOrville conn m) => Database.Orville.PostgreSQL.Internal.Monad.MonadOrville conn (Control.Monad.Trans.Resource.Internal.ResourceT m) + + +-- | MonadBaseControl provides functions and instances for using +-- MonadOrville and OrvilleT for situations where you +-- need to use MonadBaseControl. If you do not know if you need +-- MonadBaseControl, then you probably don't need to use this +-- module. If you are thinking about using MonadBaseControl +-- instead of MonadUnliftIO, we recommend reading Michael +-- Snoyman's excellent "A Tale of Two Brackets" +-- (https:/www.fpcomplete.comblog201706/tale-of-two-brackets) +-- if you have not already done so. +-- +-- If you're still here after reading above, this module provides the +-- functions you need to implement MonadOrvilleControl for your +-- Monad stack using its MonadBaseControl instance. The most +-- common way to do this is simply to add the following +-- MonadOrvilleControl instance: +-- +--
    +--   instance MonadOrvilleControl MyMonad where
    +--     liftWithConnection = liftWithConnectionViaBaseControl
    +--     liftFinally = liftFinallyViaBaseControl
    +--   
    +-- +-- This module also provides a MonadOrvilleControl for +-- StateT as well as MonadBaseControl and +-- MonadTransControl instances for OrvilleT and +-- OrvilleTriggerT. +module Database.Orville.PostgreSQL.MonadBaseControl + +-- | liftWithConnectionViaBaseControl can be use as the implementation of +-- liftWithConnection for MonadOrvilleControl when the +-- Monad implements MonadBaseControl. +liftWithConnectionViaBaseControl :: MonadBaseControl IO m => (forall b. (conn -> IO b) -> IO b) -> (conn -> m a) -> m a + +-- | liftFinallyViaBaseControl can be use as the implementation of +-- 'liftFinally for MonadOrvilleControl when the Monad +-- implements MonadBaseControl. +liftFinallyViaBaseControl :: MonadBaseControl IO m => (forall c d. IO c -> IO d -> IO c) -> m a -> m b -> m a +instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Database.Orville.PostgreSQL.Internal.Monad.MonadOrvilleControl (Control.Monad.Trans.State.Lazy.StateT a m) +instance Control.Monad.Trans.Control.MonadTransControl (Database.Orville.PostgreSQL.Internal.Monad.OrvilleT conn) +instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Database.Orville.PostgreSQL.Internal.Monad.OrvilleT conn m) +instance Control.Monad.Trans.Control.MonadTransControl (Database.Orville.PostgreSQL.Internal.Trigger.OrvilleTriggerT trigger conn) +instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Database.Orville.PostgreSQL.Internal.Trigger.OrvilleTriggerT trigger conn m) diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/plus.gif b/orville-docsite/site-builder/orville-postgresql-legacy-docs/plus.gif new file mode 100644 index 0000000000000000000000000000000000000000..2d15c14173d23f664b955cd24f51c82f5f09d91d GIT binary patch literal 59 zcmZ?wbhEHbgbBX M^XE!9f*2UA0nx1yDgXcg literal 0 HcmV?d00001 diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.css b/orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.css new file mode 100644 index 0000000..468d803 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.css @@ -0,0 +1,164 @@ +/* @group Search box layout */ + +#search { + position: fixed; + top: 3.2em; + bottom: 0; + left: calc(50% - 22em); + width: 44em; + z-index: 1000; + pointer-events: none; + overflow-y: auto; +} + +#search.hidden { + display: none; +} + +#search-form, #search-results { + box-shadow: 2px 2px 6px rgb(199, 204, 208); + pointer-events: all; +} + +#search-form input { + font-size: 1.25em; line-height: 2.3em; height: 2.4em; + display: block; + box-sizing: border-box; + width: 100%; + margin: 0; + padding: 0 0.75em; + border: 0.05em solid rgb(151, 179, 202); +} + +#search input:focus { + outline: none; +} + +#search p.error { + color: rgb(107, 24, 24); + font-weight: bold; +} + +#search-results { + box-sizing: border-box; + border: 0.05em solid #b2d5fb; + background: #e8f3ff; +} + +#search-form input + #search-results { + border-top: none; + top: 3em; + max-height: calc(100% - 3em); +} + +/* @end */ + +/* @group search results */ + +#search-results > ul { + margin: 0; + list-style: none; +} + +#search-results > ul > li, +#search-results > p, +#search-results > table { + padding: 0.5em 1em; + margin: 0; +} + +#search-results > ul > li { + border-bottom: 1px solid #b2d5fb; +} + +#search-results > ul > li > ul { + list-style: none; +} + +.search-module h4 { + margin: 0; +} + +.search-module > ul { + margin: 0.5em 0 0.5em 2em; +} + +.search-module > ul > li > a[href] { + display: block; + color: inherit; + padding: 0.25em 0.5em; +} + +.search-module > ul > li > a[href].active-link { + background: #faf9dc; +} + +.search-module a[href]:hover { + text-decoration: none; +} + +.search-result a a { + pointer-events: none; +} + +.search-result ul.subs { + display: inline-block; + margin: 0; padding: 0; +} + +.search-result ul.subs li { + display: none; +} + +.search-result ul.subs::after { + display: inline-block; + content: "..."; + color: rgb(78,98,114); + margin: 0 0.25em; +} + +.more-results { + color: rgb(99, 141, 173); + position: relative; +} + +.more-results::before { + content: "+"; + display: inline-block; + color: #b2d5fb; + font-weight: bold; + font-size: 1.25em; line-height: inherit; + position: absolute; + left: -1em; +} + +/* @end */ + +/* @group Keyboard shortcuts table */ + +.keyboard-shortcuts { + line-height: 1.6em; +} + +.keyboard-shortcuts th { + color: rgb(78,98,114); +} + +.keyboard-shortcuts td:first-child, +.keyboard-shortcuts th:first-child { + text-align: right; + padding-right: 0.6em; +} + +.key { + display: inline-block; + font-size: 0.9em; + min-width: 0.8em; line-height: 1.2em; + text-align: center; + background: #b2d5fb; + border: 1px solid #74a3d6; + padding: 0 0.2em; + margin: 0 0.1em; +} + +/* @end */ diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.min.js b/orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.min.js new file mode 100644 index 0000000..c03e083 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/quick-jump.min.js @@ -0,0 +1,2 @@ +!function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s=0&&e.followActiveLink()),"s"===t.key&&"input"!==t.target.tagName.toLowerCase()&&(t.preventDefault(),e.show())})},t.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},t.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},t.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},t.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t={};this.state.fuse.search(e).forEach(function(e){var n=e.item.module;(t[n]||(t[n]=[])).push(e)});var n=[];for(var o in t)!function(e){var o=t[e],r=0;o.forEach(function(e){r+=1/e.score}),n.push({module:e,totalScore:1/r,items:o})}(o);n.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:n})},t.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.topn)return i(e,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},function(e,t,n){"use strict";var o=n(0),r=function e(t,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i=t&&n.push([o,r]),o=-1)}return e[i-1]&&i-o>=t&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(o,"\\$&").replace(n,"|")),i=e.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=O;E-=1){var R=E-1,U=n[e.charAt(R)];if(U&&(b[R]=1),P[E]=(P[E+1]<<1|1)&U,0!==I&&(P[E]|=(L[E+1]|L[E])<<1|1|L[E+1]),P[E]&N&&(C=o(t,{errors:I,currentLocation:R,expectedLocation:_,distance:c}))<=m){if(m=C,(y=R)<=_)break;O=Math.max(1,2*_-y)}}if(o(t,{errors:I+1,currentLocation:_,expectedLocation:_,distance:c})>m)break;L=P}return{isMatch:y>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");d=d.name}else a[d]={weight:1};this._analyze({key:d,value:this.options.getFn(u,d),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,h=t.fullSearcher,p=void 0===h?[]:h,d=t.resultMap,f=void 0===d?{}:d,v=t.results,_=void 0===v?[]:v;if(void 0!==i&&null!==i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=p.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],w=0;w-1&&(O=(O+m)/2),this._log("Score average:",O);var j=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log("\nCheck Matches: "+j),(g||k.isMatch)&&j){var P=f[l];P?P.output.push({key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}):(f[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}]},_.push(f[l]))}}else if(a(i))for(var E=0,R=i.length;E-1&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===T?a=[r]:a.push(r),o=i;var l=new e;return l.nodeName=t,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==P.push(e)&&(I.debounceRendering||O)(i)}function i(){var e,t=P;for(P=[];e=t.pop();)e.__d&&L(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===j.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,d,s):e.removeEventListener(t,d,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)p(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function p(e,t,n){try{e[t]=n}catch(e){}}function d(e){return this.__l[e.type](I.event&&I.event(e)||e)}function f(){for(var e;e=E.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function v(e,t,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=e&&!("__preactattr_"in e));var s=_(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||f()),s}function _(e,t,n,o,r){var i=e,s=U;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0))),i.__preactattr_=!0,i;var l=t.nodeName;if("function"==typeof l)return C(e,t,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!e||!a(e,l))&&(i=c(l,U),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0)}var u=i.firstChild,h=i.__preactattr_,p=t.children;if(null==h){h=i.__preactattr_={};for(var d=i.attributes,f=d.length;f--;)h[d[f].name]=d[f].value}return!D&&p&&1===p.length&&"string"==typeof p[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=p[0]&&(u.nodeValue=p[0]):(p&&p.length||null!=u)&&g(i,p,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,t.attributes,h),U=s,i}function g(e,t,n,o,r){var i,a,l,c,h,p=e.childNodes,d=[],f={},v=0,g=0,y=p.length,k=0,b=t?t.length:0;if(0!==y)for(L=0;L2?[].slice.call(arguments,2):e.children)},Component:N,render:function(e,t,n){return v(n,e,{},!1,t,!1)},rerender:i,options:I};void 0!==t?t.exports=F:self.preact=F}()},{}]},{},[1]); +//# sourceMappingURL=quick-jump.min.js.map diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html new file mode 100644 index 0000000..aad1847 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Data.Map.Helpers.html @@ -0,0 +1,25 @@ +
    {-|
    +Module    : Data.Map.Helpers
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Data.Map.Helpers
    +  ( groupBy
    +  , groupBy'
    +  ) where
    +
    +import qualified Data.Map.Strict as Map
    +import qualified Data.DList as DList
    +
    +groupBy :: Ord k => (a -> k) -> [a] -> Map.Map k [a]
    +groupBy keyFunc = groupBy' mkEntry
    +  where
    +    mkEntry a = (keyFunc a, a)
    +
    +groupBy' :: Ord k => (a -> (k, v)) -> [a] -> Map.Map k [v]
    +groupBy' mkEntry as = fmap DList.toList $ Map.fromListWith (flip DList.append) (fmap mkListEntry as)
    +  where
    +    mkListEntry a =
    +      let (k, v) = mkEntry a
    +       in (k, DList.singleton v)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html new file mode 100644 index 0000000..ca5298c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Conduit.html @@ -0,0 +1,198 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Conduit
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Conduit
    +  ( selectConduit
    +#if MIN_VERSION_conduit(1,3,0)
    +  , streamPages
    +#endif
    +  ) where
    +
    +{-
    +  !!! WARNING !!!
    +
    +  Basically this entire file is forked using conditional compilation on the
    +  version of conduit that is being used. Only 'feedRows' is shared below, and
    +  even that needs a different type signature. If you're changing this file,
    +  you should probably take the time to run some earlier LTS versions to double
    +  check that conduit support works correctly with different library versions.
    +-}
    +
    +#if MIN_VERSION_conduit(1,3,0)
    +import Conduit
    +  ( Acquire
    +  , ReleaseType(..)
    +  , allocateAcquire
    +  , mkAcquire
    +  , mkAcquireType
    +  , yieldMany
    +  )
    +
    +import Control.Monad (void)
    +import Control.Monad.Catch
    +import Control.Monad.Trans
    +import Control.Monad.Trans.Resource (MonadResource, release)
    +import Data.Conduit
    +import Data.Pool
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Select
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Internal.Where
    +import Database.Orville.PostgreSQL.Pagination (Pagination(..), buildPagination)
    +
    +{-|
    +   'selectConduit' provides a way to stream the results of a 'Select' query
    +   from the database one by one using the conduit library. You can 'fuse' the
    +   conduit built by this function with your own conduit pipeline to handle rows
    +   individually in whatever fashion you need (e.g. turning them into rows of
    +   CSV). This is useful if you want to be able to process many rows one by one.
    +   You can aggregate the results however you require as part of the conduit
    +   processing and then use 'runConduit' (or 'runConduitRes') from the conduit
    +   library to execute the processing pipeline. Alternatively, your web server
    +   ('wai', 'servant', etc) may provide support for converting a conduit into a
    +   streaming HTTP response.
    +
    +   Beware: this function must load all the results into memory before streaming
    +   can begin. For why, see https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html.
    +   If memory use is a concern, try 'streamPages' instead.
    +  -}
    +selectConduit ::
    +     (Monad m, MonadOrville conn m, MonadCatch m, MonadResource m)
    +  => Select row
    +  -> ConduitT () row m ()
    +selectConduit select = do
    +  pool <- ormEnvPool <$> lift getOrvilleEnv
    +  (releaseKey, query) <-
    +    allocateAcquire (acquireStatement pool (selectSql select))
    +  void $ liftIO $ execute query $ selectValues select
    +  result <- feedRows (selectBuilder select) query
    +  -- Note this doesn't use finally to release this, but it will be released
    +  -- automatically at the end of runResourceT. finally cannot be used here
    +  -- because Conduit doesn't offer MonadMask. Alternatively we could use
    +  -- withAllocate here, but that would require an UNLiftIO instance
    +  release releaseKey
    +  pure result
    +
    +acquireConnection :: Pool conn -> Acquire conn
    +acquireConnection pool =
    +  fst <$> mkAcquireType (takeResource pool) releaseConnection
    +  where
    +    releaseConnection (conn, local) releaseType =
    +      case releaseType of
    +        ReleaseEarly -> putResource local conn
    +        ReleaseNormal -> putResource local conn
    +        ReleaseException -> destroyResource pool local conn
    +
    +acquireStatement ::
    +     IConnection conn => Pool conn -> String -> Acquire Statement
    +acquireStatement pool sql = do
    +  conn <- acquireConnection pool
    +  mkAcquire (prepare conn sql) finish
    +#else
    +import qualified Control.Exception as E
    +import Control.Monad
    +import Control.Monad.Catch
    +import Control.Monad.Trans
    +import Data.Conduit
    +import Data.IORef
    +import Data.Pool
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Select
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +-- All the masking manual cleanup in this function amounts to a
    +-- poor man's ResourceT that I *hope* is correct. The constraints
    +-- hat lead to this are:
    +--
    +--   * The immediate purpose of conduit queries to to provide streaming
    +--     responses in a Happstack App
    +--
    +--   * Happstack does not offer a side-effect controlled streaming
    +--     response solution at the moment. It relies in Lazy Bytestrings
    +--
    +--   * The conduit lazy consume specifically warns that you need to
    +--     ensure you consume the whole list before ResourceT returns,
    +--     which I cannot guarantee in Happstack (in fact, I believe it
    +--     specifically will *not* happen that way)
    +--
    +--   * Data.Pool.withResource depends on MonadBaseControl, which
    +--     Conduit does not offer
    +--
    +--   * Conduit also does not offer MonadMask, so I cannot use
    +--     mask/restore in the normal way
    +--
    +-- So, we instead we mask exceptions while registering cleanup and
    +-- finish actions in vars while masked and then ensure those vars
    +-- are read and executed at the appropriate times.
    +--
    +-- Beware: this function must load all the results into memory before streaming
    +-- can begin. For why, see https://www.postgresql.org/docs/9.2/libpq-single-row-mode.html.
    +-- If memory use is a concern, try 'streamPages' instead.
    +selectConduit ::
    +     (Monad m, MonadOrville conn m, MonadCatch m) => Select row -> Source m row
    +selectConduit select = do
    +  pool <- ormEnvPool <$> lift getOrvilleEnv
    +  cleanupRef <- liftIO $ newIORef (pure ())
    +  finishRef <- liftIO $ newIORef (pure ())
    +  let acquire =
    +        lift $
    +        liftIO $
    +        E.mask_ $ do
    +          (conn, local) <- takeResource pool
    +          writeIORef cleanupRef $ destroyResource pool local conn
    +          writeIORef finishRef $ putResource local conn
    +          pure conn
    +      runCleanup = liftIO $ join (readIORef cleanupRef)
    +      runFinish = liftIO $ join (readIORef finishRef)
    +      go = do
    +        conn <- acquire
    +        query <- liftIO $ prepare conn $ selectSql select
    +        addCleanup (const $ liftIO $ finish $ query) $ do
    +          void $ liftIO $ execute query $ selectValues select
    +          feedRows (selectBuilder select) query
    +  result <- go `onException` runCleanup
    +  runFinish
    +  pure result
    +#endif
    +
    +feedRows ::
    +#if MIN_VERSION_conduit(1,3,0)
    +     (Monad m, MonadIO m) => FromSql row -> Statement -> ConduitT () row m ()
    +#else
    +     (Monad m, MonadIO m) => FromSql row -> Statement -> Source m row
    +#endif
    +feedRows builder query = do
    +  row <- liftIO $ fetchRowAL query
    +  case runFromSql builder <$> row of
    +    Nothing -> pure ()
    +    Just (Left _) -> pure ()
    +    Just (Right r) -> yield r >> feedRows builder query
    +
    +#if MIN_VERSION_conduit(1,3,0)
    +-- | Build a conduit source that is fed by querying one page worth of results
    +-- at a time. When the last row of the last page is consumed, the stream ends.
    +streamPages :: (MonadOrville conn m, Bounded orderField, Enum orderField)
    +            => TableDefinition readEnt write key
    +            -> FieldDefinition NotNull orderField
    +            -> (readEnt -> orderField)
    +            -> Maybe WhereCondition
    +            -> Word -- ^ number of rows fetched per page
    +            -> ConduitT () readEnt m ()
    +streamPages tableDef orderField getOrderField mbWhereCond pageSize =
    +  loop =<< lift (buildPagination tableDef orderField getOrderField mbWhereCond pageSize)
    +    where
    +      loop pagination = do
    +        yieldMany (pageRows pagination)
    +        case pageNext pagination of
    +          Nothing -> pure ()
    +          Just nxtPage -> loop =<< lift nxtPage
    +#endif
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html new file mode 100644 index 0000000..f7adb73 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Connection.html @@ -0,0 +1,31 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Connection
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Connection
    +  ( createConnectionPool
    +  , Pool
    +  , Connection
    +  ) where
    +
    +import Data.Pool
    +import Data.Time
    +import Database.HDBC
    +import Database.HDBC.PostgreSQL
    +
    +{-|
    + 'createConnectionPool' allocates a pool of connections to a PosgreSQL
    + server. The returned pool can be used as the endpoint to
    + 'Database.Orville.PostgreSQL.Core.newOrvilleEnv'
    + to construct.
    +-}
    +createConnectionPool ::
    +     Int -- ^ Number of stripes in the connection pool
    +  -> NominalDiffTime -- ^ Linger time before closing an idle connection
    +  -> Int -- ^ Max number of connections to allocate per stripe
    +  -> String -- ^ A PostgreSQL connection string
    +  -> IO (Pool Connection)
    +createConnectionPool stripes linger maxRes connString =
    +  createPool (connectPostgreSQL' connString) disconnect stripes linger maxRes
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html new file mode 100644 index 0000000..6587373 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Core.html @@ -0,0 +1,636 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Core
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +Migration Guide: Although not all exports are identical, most of the items in
    +this module can now be imported from @Orville.PostgreSQL@.
    +
    +Please note that the new LibPQ-based version of orville represents a complete
    +re-write of Orville from the ground up. As such many of the APIs have been
    +re-thought with the goal of providing stability and better experience long
    +term.
    +
    +Major changes:
    +
    +* The library no longer allows the connection type to vary. It is intended only
    +  to be used with PostgreSQL. Thus 'MonadOrville' and other types that used to
    +  have a @conn@ type parameter no longer have that parameter.
    +
    +* 'OrvilleT' has been removed in favor of simply using @ReaderT@. For trivial
    +  cases (i.e. @ReaderT@ over @IO@) a pre-packaged @Orville@ monad is provided.
    +
    +* In 'TableDefinition', the order of the type parameters has changed from
    +  @TableDefinition readEnity writeEntity key@ to @TableDefinition key
    +  writeEntity readEntity@. This make it more consistent with the order of these
    +  arguments in other types. 'TableParams' has been removed in favor of building
    +  a basic table definition with the require parameters first and adding or
    +  setting other optional items after initial construction.
    +
    +* 'RelationalMap' has been replaced by @SqlMarshaller@. Many functions have
    +  been renamed, but most functions have a direct or nearly direct translation
    +  from the old ones. See the docs on the individual functions such as
    +  'attrField' to see what has changed.
    +
    +* The auto-migration system is significantly improved. Standard indexes no
    +  longer need to be given explicit names. Indexes and constraints are now
    +  attached to 'TableDefinition' rather than being their own schema items.
    +  Indexes and constraints are no longer dropped explicitly -- they are dropped
    +  automatically by Orville when they have been removed from the table
    +  definiton.
    +
    +* A number of places that previously accepted @[]@ now require @NonEmpty@
    +  instead. This is done in places where an empty list would not be valid SQL.
    +  For examples of this change see 'insertRecordMany' and 'updateFields'.
    +
    +* 'whereAnd' and 'whereOr' (which took lists) have been replaced
    +  with binary boolean logic functions @andExpr@ and @orExpr@. These functions
    +  also have operator aliases (@(.&&)@, @(.||)@).
    +
    +The following items exported from this module have migration guide notes
    +available in their documentation:
    +
    +* 'TableDefinition'
    +* 'mkTableDefinition'
    +* 'TableParams'
    +* 'RelationalMap'
    +* 'fields'
    +* 'mapAttr'
    +* 'mapField'
    +* 'attrField'
    +* 'maybeMapper'
    +* 'prefixMap'
    +* 'partialMap'
    +* 'readOnlyMap'
    +* 'readOnlyField'
    +* 'OrvilleEnv'
    +* 'newOrvilleEnv'
    +* 'setStartTransactionSQL'
    +* 'aroundRunningQuery'
    +* 'addTransactionCallBack'
    +* 'OrvilleT'
    +* 'HasOrvilleContext'
    +* 'MonadOrville'
    +* 'runOrville'
    +* 'mapOrvilleT'
    +* 'MonadOrvilleControl'
    +* 'defaultLiftWithConnection'
    +* 'defaultLiftFinally'
    +* 'withCachedConnection'
    +* 'withTransaction'
    +* 'ColumnFlag'
    +* 'FieldDefinition'
    +* 'isFieldNullable'
    +* 'fieldOfType'
    +* 'textField'
    +* 'fixedTextField'
    +* 'unboundedTextField'
    +* 'dayField'
    +* 'utcTimeField'
    +* 'int32Field'
    +* 'int64Field'
    +* 'doubleField'
    +* 'boolField'
    +* 'automaticIdField'
    +* 'searchVectorField'
    +* 'nullableField'
    +* 'foreignKeyField'
    +* 'withFlag'
    +* 'withName'
    +* 'withConversion'
    +* 'fieldFromSql'
    +* 'fieldToSqlValue'
    +* 'SomeField'
    +* 'withPrefix'
    +* 'fieldFlags'
    +* 'uniqueIndex'
    +* 'simpleIndex'
    +* 'uniqueConstraint'
    +* 'dropConstraint'
    +* 'SchemaItem'
    +* 'SchemaDefinition'
    +* 'Record'
    +* 'WhereCondition'
    +* 'whereAnd'
    +* 'whereOr'
    +* 'whereIn'
    +* 'whereLike'
    +* 'whereLikeInsensitive'
    +* 'whereNotIn'
    +* 'whereQualified'
    +* 'whereRaw'
    +* 'whereToSql'
    +* 'isNull'
    +* 'isNotNull'
    +* 'migrateSchema'
    +* 'generateMigrationPlan'
    +* 'MigrationPlan'
    +* 'MigrationItem'
    +* 'migrationPlanItems'
    +* 'selectAll'
    +* 'selectFirst'
    +* 'deleteRecord'
    +* 'deleteWhere'
    +* 'findRecord'
    +* 'findRecords'
    +* 'findRecordsBy'
    +* 'insertRecord'
    +* 'insertRecordMany'
    +* 'insertRecordManyReturning'
    +* 'updateFields'
    +* 'updateRecord'
    +* 'createIndexesConcurrently'
    +* 'dropIndexesConcurrently'
    +
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +
    +module Database.Orville.PostgreSQL.Core
    +  ( TableDefinition(..) -- migration guide added
    +  , PrimaryKey
    +  , primaryKeyIn
    +  , primaryKeyEquals
    +  , primaryKeyDescription
    +  , primaryKeyToSql
    +  , primaryKey
    +  , compositePrimaryKey
    +  , primaryKeyPart
    +  , mkTableDefinition -- migration guide added
    +  , SqlType(..)
    +  , serial
    +  , bigserial
    +  , text
    +  , varText
    +  , unboundedText
    +  , integer
    +  , bigInteger
    +  , double
    +  , boolean
    +  , date
    +  , timestamp
    +  , textSearchVector
    +  , convertSqlType -- migration guide added
    +  , maybeConvertSqlType -- migration guide added
    +  , TableParams(..) -- migration guide added
    +  , RelationalMap -- migration guide added
    +  , fields -- migration guide added
    +  , mapAttr -- migration guide added
    +  , mapField -- migration guide added
    +  , attrField -- migration guide added
    +  , maybeMapper -- migration guide added
    +  , prefixMap -- migration guide added
    +  , partialMap -- migration guide added
    +  , readOnlyMap -- migration guide added
    +  , readOnlyField -- migration guide added
    +  , OrvilleEnv -- migration guide added
    +  , newOrvilleEnv -- migration guide added
    +  , setStartTransactionSQL -- migration guide added
    +  , aroundRunningQuery -- migration guide added
    +  , addTransactionCallBack -- migration guide added
    +  , ormEnvPool
    +  , TransactionEvent(..)
    +  , OrvilleT -- migration guide added
    +  , unOrvilleT
    +  , SqlValue
    +  , HasOrvilleContext(..) -- migration guide added
    +  , MonadOrville -- migration guide added
    +  , runOrville -- migration guide added
    +  , mapOrvilleT -- migration guide added
    +  , MonadOrvilleControl(..) -- migration guide added
    +  , defaultLiftWithConnection -- migration guide added
    +  , defaultLiftFinally -- migration guide added
    +  , QueryType(..)
    +  , withCachedConnection -- migration guide added
    +  , withTransaction -- migration guide added
    +  , ColumnFlag(..) -- migration guide added
    +  , ColumnDefault(toColumnDefaultSql)
    +  , Now(..)
    +  , FieldDefinition -- migration guide added
    +  , Nullable
    +  , NotNull
    +  , Nullability(..)
    +  , isFieldNullable -- migration guide added
    +  , fieldOfType -- migration guide added
    +  , textField -- migration guide added
    +  , fixedTextField -- migration guide added
    +  , unboundedTextField -- migration guide added
    +  , dayField -- migration guide added
    +  , utcTimeField -- migration guide added
    +  , int32Field -- migration guide added
    +  , int64Field -- migration guide added
    +  , doubleField -- migration guide added
    +  , boolField -- migration guide added
    +  , automaticIdField -- migration guide added
    +  , searchVectorField -- migration guide added
    +  , nullableField -- migration guide added
    +  , foreignKeyField -- migration guided added
    +  , withFlag -- migration guide added
    +  , withName -- migration guide added
    +  , withConversion -- migration guide added
    +  , fieldFromSql -- migration guide added
    +  , fieldToSqlValue -- migration guide added
    +  , SomeField(..) -- migration guide added
    +  , withPrefix -- migration guide added
    +  , fieldName
    +  , fieldType
    +  , fieldFlags -- migration guide added
    +  , IndexDefinition(..)
    +  , uniqueIndex -- migration guide added
    +  , simpleIndex -- migration guide added
    +  , simplePartialIndex
    +  , uniquePartialIndex
    +  , ConstraintDefinition(..)
    +  , SequenceDefinition(..)
    +  , uniqueConstraint -- migration guide added
    +  , dropConstraint -- migration guide added
    +  , FromSql
    +  , FromSqlError(..)
    +  , RowDataErrorDetails(..)
    +  , RowDataErrorReason(..)
    +  , MissingColumnDetails(..)
    +  , ConversionErrorDetails(..)
    +  , showFromSqlErrorMinimal
    +  , showFromSqlErrorForLogging
    +  , showSqlValueType
    +  , ColumnSpecifier(..)
    +  , col
    +  , ToSql
    +  , getField
    +  , getComponent
    +  , SchemaItem(..) -- migration guide added
    +  , SchemaDefinition -- migration guide added
    +  , Record -- migration guide added
    +  , CreatedAt
    +  , UpdatedAt
    +  , OccurredAt
    +  , TableComments
    +  , noComments
    +  , say
    +  , WhereCondition -- migration guide added
    +  , whereAnd -- migration guide added
    +  , whereOr -- migration guide added
    +  , whereIn -- migration guide added
    +  , whereLike -- migration guide added
    +  , whereLikeInsensitive -- migration guide added
    +  , whereNotIn -- migration guide added
    +  , whereQualified -- migration guide added
    +  , whereRaw -- migration guide added
    +  , whereToSql -- migration guide added
    +  , isNull -- migration guide added
    +  , isNotNull -- migration guide added
    +  , (.==)
    +  , (.<>)
    +  , (.<-)
    +  , (%==)
    +  , (.>)
    +  , (.>=)
    +  , (.<)
    +  , (.<=)
    +  , SelectOptions(..)
    +  , where_
    +  , distinct
    +  , order
    +  , limit
    +  , offset
    +  , groupBy
    +  , selectOptionsToSql
    +  , (<>)
    +  , FieldUpdate
    +  , fieldUpdate
    +  , (.:=)
    +  , OrderByClause(..)
    +  , SortDirection(..)
    +  , migrateSchema -- migration guide added
    +  , MigrationError(..)
    +  , generateMigrationPlan -- migration guide added
    +  , MigrationPlan -- migration guide added
    +  , MigrationItem(..) -- migration guide added
    +  , migrationPlanItems -- migration guide added
    +  , Pagination(..)
    +  , buildPagination
    +  , selectAll -- migration guide added
    +  , selectFirst -- migraiton guide added
    +  , deleteRecord -- migration guide added
    +  , deleteWhere -- migration guide added
    +  , findRecord -- migration guide added
    +  , findRecords -- migration guide added
    +  , findRecordsBy -- migration guide added
    +  , insertRecord -- migration guide added
    +  , insertRecordMany -- migration guide added
    +  , insertRecordManyReturning -- migration guide added
    +  , updateFields -- migration guide added
    +  , updateRecord -- migration guide added
    +  , sequenceNextVal
    +  , sequenceSetVal
    +  , sequenceCurrVal
    +  , createIndexesConcurrently -- migration guide added
    +  , dropIndexesConcurrently -- migration guide added
    +  ) where
    +
    +import Control.Monad (void, when)
    +import Control.Monad.Except
    +import Control.Monad.Reader
    +import Control.Monad.State
    +import Data.Convertible
    +import qualified Data.List as List
    +import qualified Data.Map.Strict as Map
    +import Data.Maybe (listToMaybe)
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import qualified Data.Map.Helpers as Map
    +import Database.Orville.PostgreSQL.Internal.ConstraintDefinition
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.FieldUpdate
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.GroupBy ()
    +import Database.Orville.PostgreSQL.Internal.IndexDefinition
    +import Database.Orville.PostgreSQL.Internal.MigrateSchema
    +import Database.Orville.PostgreSQL.Internal.MigrationError
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.OrderBy
    +import Database.Orville.PostgreSQL.Internal.PrimaryKey
    +import Database.Orville.PostgreSQL.Internal.RelationalMap
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +import Database.Orville.PostgreSQL.Internal.Sql
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +import Database.Orville.PostgreSQL.Internal.TableDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Internal.Where
    +import Database.Orville.PostgreSQL.Pagination
    +import Database.Orville.PostgreSQL.Raw
    +import Database.Orville.PostgreSQL.Select
    +
    +getField :: Convertible a SqlValue => (entity -> a) -> ToSql entity ()
    +getField f = do
    +  value <- asks f
    +  sqlValues <- get
    +  put (convert value : sqlValues)
    +
    +{- |
    +  Migration Guide: @selectAll@ has been renamed to @findEntitiesBy@
    +-}
    +selectAll ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> m [readEntity]
    +selectAll tableDef = runSelect . selectQueryTable tableDef
    +
    +
    +{- |
    +  Migration Guide: @selectFirst@ has been renamed to @findFirstEntityBy@
    +-}
    +selectFirst ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> m (Maybe readEntity)
    +selectFirst tableDef opts =
    +  listToMaybe <$> selectAll tableDef (limit 1 <> opts)
    +
    +deleteWhereBuild ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [WhereCondition]
    +  -> m Integer
    +deleteWhereBuild tableDef conds = do
    +  let deleteSql = mkDeleteClause (tableName tableDef)
    +  let whereSql = whereClause conds
    +  let values = whereValues conds
    +  let querySql = deleteSql ++ " " ++ whereSql
    +  withConnection $ \conn -> do
    +    executingSql DeleteQuery querySql $ do run conn querySql values
    +
    +{- |
    +  Migration Guide: @deleteWhere@ has been renamed to @deleteEntities@. It
    +  now takes a @Maybe BooleanExpr@ rather than @[WhereCondition]@
    +-}
    +deleteWhere ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [WhereCondition]
    +  -> m Integer
    +deleteWhere tableDef = deleteWhereBuild tableDef
    +
    +{- |
    +  Migration Guide: @findRecords@ has been renamed to @findEntities@. It now
    +  requires a @NonEmpty key@ rather than simply @[key]@ and returns a
    +  @[readEntity]@ instead of a @Map@.
    +-}
    +findRecords ::
    +     (Ord key, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> [key]
    +  -> m (Map.Map key readEntity)
    +findRecords _ [] = return Map.empty
    +findRecords tableDef keys = do
    +  let keyDef = tablePrimaryKey tableDef
    +      mkEntry record = (tableGetKey tableDef record, record)
    +  recordList <- selectAll tableDef (where_ $ primaryKeyIn keyDef keys)
    +  pure $ Map.fromList (map mkEntry recordList)
    +
    +{- |
    +  Migration Guide: @findRecordsBy@ has been renamed to @findEntitiesBy@. It
    +  no longer takes a @FieldDefinition@ to group by. Instead it simply returns
    +  a @[readEntity]@
    +-}
    +findRecordsBy ::
    +     (Ord fieldValue, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> m (Map.Map fieldValue [readEntity])
    +findRecordsBy tableDef field opts = do
    +  let builder = (,) <$> fieldFromSql field <*> tableFromSql tableDef
    +      query = selectQuery builder (fromClauseTable tableDef) opts
    +  Map.groupBy' id <$> runSelect query
    +
    +{- |
    +  Migration Guide: @findRecord@ has been renamed to @findEntity@
    +-}
    +findRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> m (Maybe readEntity)
    +findRecord tableDef key =
    +  let keyDef = tablePrimaryKey tableDef
    +   in selectFirst tableDef (where_ $ primaryKeyEquals keyDef key)
    +
    +{- |
    +  Migration Guide: @updateFields@ has been renamed to
    +  @updateFieldsAndReturnRowCount@, but now takes a @NonEmpty SetClause@ instead
    +  of a @[Field Update]@ and a @Maybe BooleanExpr@ instead of a
    +  @[WhereCondition]@.
    +
    +  @updateFields@ still exists as a variant of this function, but returns @()@
    +  rather than @Int@. @updateFieldsAndReturnEntities@ is now available as well.
    +-}
    +updateFields ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [FieldUpdate]
    +  -> [WhereCondition]
    +  -> m Integer
    +updateFields tableDef updates conds =
    +  updateSql (updateClause ++ " " ++ condClause) (updateValues ++ condValues)
    +  where
    +    condClause = whereClause conds
    +    condValues = whereValues conds
    +    updateValues = map fieldUpdateValue updates
    +    updateNames = map fieldUpdateName updates
    +    updateClause = mkUpdateClause (tableName tableDef) updateNames
    +
    +{- |
    +  Migration Guide: @updateRecord@ has been renamed to @updateEntity. Note that
    +  there are also new variant functions @updateAndReturnEntity@ and
    +  @updateEntityAndReturnRowCount@.
    +-}
    +updateRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> writeEntity
    +  -> m ()
    +updateRecord tableDef key record = do
    +  let keyDef = tablePrimaryKey tableDef
    +      conds = [primaryKeyEquals keyDef key]
    +      fields = tableAssignableFields tableDef
    +      builder = tableToSql tableDef
    +      updates = zipWith FieldUpdate fields (runToSql builder record)
    +  void $ updateFields tableDef updates conds
    +
    +{- |
    +  Migration Guide: @insertRecord@ has been renamed to @insertAndReturnEntity@.
    +  Note there are also new variant functions @insertEntity@ and
    +  @insertEntityAndReturnRowCount@ that return @()@ and @Int@ respectively.
    +-}
    +insertRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> writeEntity
    +  -> m readEntity
    +insertRecord tableDef newRecord = do
    +  results <- insertRecordManyReturning tableDef [newRecord]
    +  case results of
    +    [entity] -> pure entity
    +    [] -> error "Didn't get a record back from the database!"
    +    _ -> error "Got more than one record back from the database!"
    +
    +{- |
    +  Migration Guide: @insertRecordManyReturning@ has been renamed to
    +  @insertAndReturnEntities@.
    +-}
    +insertRecordManyReturning ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [writeEntity]
    +  -> m [readEntity]
    +insertRecordManyReturning _ [] = pure []
    +insertRecordManyReturning tableDef newRecords = do
    +  let builder = tableFromSql tableDef
    +      returnSelects = expr <$> fromSqlSelects builder
    +      returnColumns =
    +        List.intercalate ", " $ map (rawExprToSql . generateSql) returnSelects
    +      insertSql =
    +        mkInsertManyClause
    +          (tableName tableDef)
    +          (tableAssignableColumnNames tableDef)
    +          (length newRecords) ++
    +        " RETURNING " ++ returnColumns
    +      vals = concatMap (runToSql $ tableToSql tableDef) newRecords
    +  rows <-
    +    withConnection $ \conn -> do
    +      executingSql InsertQuery insertSql $ do
    +        insert <- prepare conn insertSql
    +        void $ execute insert vals
    +        fetchAllRowsAL' insert
    +  decodeSqlRows builder rows
    +
    +{- |
    +  Migration Guide: @insertRecordMany@ has been renamed to @insertEntities@. It
    +  now requires a @NonEmpty writeEntity@ rather than @[writeEntity]@. Note that
    +  there are also new variant functions @insertAndReturnEntities@ and
    +  @insertEntitiesAndReturnRowCount@.
    +-}
    +insertRecordMany ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> [writeEntity]
    +  -> m ()
    +insertRecordMany tableDef newRecords = do
    +  let insertSql =
    +        mkInsertManyClause
    +          (tableName tableDef)
    +          (tableAssignableColumnNames tableDef)
    +          (length newRecords)
    +  let builder = tableToSql tableDef
    +  when (not $ null newRecords) $
    +    withConnection $ \conn -> do
    +      executingSql InsertQuery insertSql $ do
    +        insert <- prepare conn insertSql
    +        void $ execute insert (concatMap (runToSql builder) newRecords)
    +
    +{- |
    +  Migration Guide: @deleteRecord@ has been renamed to @deleteEntity@. Note
    +  that there are also new variant functions @deleteAndReturnEntity@ and
    +  @deleteEntityAndReturnRowCount@ that return @Maybe readEntity@ and @Int@
    +  respectively.
    +-}
    +deleteRecord ::
    +     MonadOrville conn m
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> m ()
    +deleteRecord tableDef key = do
    +  let keyDef = tablePrimaryKey tableDef
    +  n <- deleteWhere tableDef [primaryKeyEquals keyDef key]
    +  if n /= 1
    +    then error $
    +         "Expected to delete exactly 1 row for deleteRecord\
    +               \but actually deleted" ++
    +         show n
    +    else pure ()
    +
    +sequenceNextVal ::
    +     MonadOrville conn m
    +  => SequenceDefinition
    +  -> m Int
    +sequenceNextVal seqDef = do
    +  n <- selectSql "SELECT nextval(?)"
    +                 [SqlString $ sequenceName seqDef]
    +                 (fieldFromSql $ int64Field "nextval")
    +  case n of
    +    [r] -> pure $ fromIntegral r
    +    _ -> error $ "Failed to execute nextval for sequence " ++ sequenceName seqDef ++ "!"
    +
    +sequenceSetVal ::
    +     MonadOrville conn m
    +  => SequenceDefinition
    +  -> Int
    +  -> m Int
    +sequenceSetVal seqDef v = do
    +  n <- selectSql "SELECT setval(?, ?)"
    +                 [SqlString $ sequenceName seqDef, SqlInt64 $ fromIntegral v]
    +                 (fieldFromSql $ int64Field "setval")
    +  case n of
    +    [r] -> pure $ fromIntegral r
    +    _ -> error $ "Failed to execute setval for sequence " ++ sequenceName seqDef ++ "!"
    +
    +sequenceCurrVal ::
    +     MonadOrville conn m
    +  => SequenceDefinition
    +  -> m Int
    +sequenceCurrVal seqDef = do
    +  n <- selectSql "SELECT currval(?)"
    +                 [SqlString $ sequenceName seqDef]
    +                 (fieldFromSql $ int64Field "currval")
    +  case n of
    +    [r] -> pure $ fromIntegral r
    +    _ -> error $ "Failed to get current value for sequence " ++ sequenceName seqDef ++ "!"
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html new file mode 100644 index 0000000..b404bc4 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Expr.html @@ -0,0 +1,24 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Expr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Expr
    +  ( RawExpr
    +  , rawSql
    +  , GenerateSql(..)
    +  , Expr
    +  , rawSqlExpr
    +  , expr
    +  , NameExpr
    +  , NameForm
    +  , unescapedName
    +  , SelectExpr
    +  , SelectForm(..)
    +  , selectColumn
    +  , qualified
    +  , aliased
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html new file mode 100644 index 0000000..4e3f80b --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.ConstraintDefinition.html @@ -0,0 +1,46 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.ContraintDefinition
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.ConstraintDefinition
    +  ( uniqueConstraint
    +  , dropConstraint
    +  ) where
    +
    +import Data.List (intercalate)
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{- |
    +  Migration Guide: @uniqueConstraint@ no longer accepts a name parameter.
    +  Instead the constraint is migrated automatically based on the structure of
    +  existing constraints found in the database. It also no longer accepts a
    +  @TableDefinition@. Instead you should use @addTableConstraints@ to add the
    +  @ConstraintDefinition@ to the table that you wish to apply the constraint to.
    +-}
    +uniqueConstraint ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> [SomeField]
    +  -> ConstraintDefinition
    +uniqueConstraint name tableDef fields =
    +  ConstraintDefinition
    +    { constraintName = name
    +    , constraintTable = tableName tableDef
    +    , constraintBody =
    +        "UNIQUE (" ++ intercalate "," (map someEscapedFieldName fields) ++ ")"
    +    }
    +  where
    +    someEscapedFieldName (SomeField f) = escapedFieldName f
    +
    +{- |
    +  Migration Guide: @dropConstraint@ has been removed. Constraints are now
    +  dropped automatically during auto-migration when they are removed from the
    +  @TableDefinition@.
    +-}
    +dropConstraint ::
    +     TableDefinition readEntity writeEntity key -> String -> SchemaItem
    +dropConstraint tableDef = DropConstraint (tableName tableDef)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html new file mode 100644 index 0000000..b2cfc0d --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Execute.html @@ -0,0 +1,31 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Execute
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Execute where
    +
    +import Control.Monad.IO.Class
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Monad
    +
    +executingSql :: MonadOrville conn m => QueryType -> String -> IO a -> m a
    +executingSql queryType sql action = do
    +  runningQuery <-
    +    (\queryType -> ormEnvRunningQuery queryType)
    +      <$> getOrvilleEnv
    +  liftIO $ runningQuery queryType sql (catchSqlErr sql action)
    +
    +catchSqlErr :: String -> IO a -> IO a
    +catchSqlErr sql action =
    +  catchSql
    +    action
    +    (\e ->
    +       let updatedErr =
    +             SqlError
    +               (seState e)
    +               (seNativeError e)
    +               (seErrorMsg e ++ " SQL: " ++ sql)
    +        in throwSqlError updatedErr)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html new file mode 100644 index 0000000..8d4e977 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.Expr.html @@ -0,0 +1,66 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.Expr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-#LANGUAGE CPP#-}
    +
    +module Database.Orville.PostgreSQL.Internal.Expr.Expr where
    +
    +import Data.String
    +
    +data RawExpr
    +  = RawExprString String
    +  | RawExprAppend RawExpr
    +                  RawExpr
    +  | RawExprConcat [RawExpr]
    +
    +rawSql :: String -> RawExpr
    +rawSql = RawExprString
    +
    +rawExprToSql :: RawExpr -> String
    +rawExprToSql = go ""
    +  where
    +    go rest (RawExprString s) = s ++ rest
    +    go rest (RawExprAppend r1 r2) = go (go rest r2) r1
    +    go rest (RawExprConcat exprs) = foldr (flip go) rest exprs
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup RawExpr where
    +  (<>) = RawExprAppend
    +#endif
    +
    +instance Monoid RawExpr where
    +  mempty = RawExprString ""
    +  mappend = RawExprAppend
    +  mconcat = RawExprConcat
    +
    +instance IsString RawExpr where
    +  fromString = rawSql
    +
    +newtype Expr a =
    +  Expr (Either RawExpr a)
    +
    +class QualifySql form where
    +  qualified :: form -> String -> form
    +
    +instance QualifySql a => QualifySql (Expr a) where
    +  qualified (Expr (Right a)) table = Expr . Right $ qualified a table
    +  qualified (Expr (Left raw)) _ = Expr . Left $ raw
    +
    +class GenerateSql expr where
    +  generateSql :: expr -> RawExpr
    +
    +instance GenerateSql RawExpr where
    +  generateSql = id
    +
    +instance GenerateSql a => GenerateSql (Expr a) where
    +  generateSql (Expr (Right a)) = generateSql a
    +  generateSql (Expr (Left raw)) = raw
    +
    +rawSqlExpr :: String -> Expr a
    +rawSqlExpr = Expr . Left . rawSql
    +
    +expr :: a -> Expr a
    +expr = Expr . Right
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html new file mode 100644 index 0000000..ad60a77 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.NameExpr.html @@ -0,0 +1,41 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE OverloadedStrings #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Expr.NameExpr where
    +
    +import Data.String
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +
    +type NameExpr = Expr NameForm
    +
    +data NameForm = NameForm
    +  { nameFormTable :: Maybe String
    +  , nameFormName :: String
    +  } deriving (Eq, Ord)
    +
    +instance IsString NameForm where
    +  fromString str = NameForm {nameFormTable = Nothing, nameFormName = str}
    +
    +instance QualifySql NameForm where
    +  qualified form table = form {nameFormTable = Just table}
    +
    +instance QueryKeyable NameForm where
    +  queryKey = QKField . unescapedName
    +
    +instance GenerateSql NameForm where
    +  generateSql (NameForm Nothing name) = "\"" <> rawSql name <> "\""
    +  generateSql (NameForm (Just table) name) =
    +    "\"" <> rawSql table <> "\".\"" <> rawSql name <> "\""
    +
    +unescapedName :: NameForm -> String
    +unescapedName (NameForm Nothing name) = name
    +unescapedName (NameForm (Just table) name) = table <> "." <> name
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html new file mode 100644 index 0000000..3316264 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.SelectExpr.html @@ -0,0 +1,45 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.SelectExpr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE OverloadedStrings #-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Expr.SelectExpr where
    +
    +import Data.Maybe
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +
    +type SelectExpr = Expr SelectForm
    +
    +data SelectForm = SelectForm
    +  { selectFormColumn :: NameForm
    +  , selectFormAlias :: Maybe NameForm
    +  }
    +
    +selectColumn :: NameForm -> SelectForm
    +selectColumn name = SelectForm name Nothing
    +
    +selectFormOutput :: SelectForm -> NameForm
    +selectFormOutput = fromMaybe <$> selectFormColumn <*> selectFormAlias
    +
    +aliased :: SelectForm -> NameForm -> SelectForm
    +aliased sf name = sf {selectFormAlias = Just name}
    +
    +instance QualifySql SelectForm where
    +  qualified form table =
    +    form {selectFormColumn = (selectFormColumn form) `qualified` table}
    +
    +instance GenerateSql SelectForm where
    +  generateSql (SelectForm {..}) =
    +    generateSql selectFormColumn <> asOutput selectFormAlias
    +
    +asOutput :: Maybe NameForm -> RawExpr
    +asOutput Nothing = mempty
    +asOutput (Just name) = " AS " <> generateSql name
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html new file mode 100644 index 0000000..2ebfba6 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.WhereExpr.html @@ -0,0 +1,164 @@ +
    module Database.Orville.PostgreSQL.Internal.Expr.WhereExpr
    +  ( WhereExpr
    +  , WhereForm
    +  , (.==)
    +  , (.<>)
    +  , (.>)
    +  , (.>=)
    +  , (.<)
    +  , (.<=)
    +  , (%==)
    +  , (.<-)
    +  , whereValues
    +  , whereIn
    +  , whereNotIn
    +  , whereLike
    +  , whereLikeInsensitive
    +  , whereNull
    +  , whereNotNull
    +  , whereRaw
    +  ) where
    +
    +import qualified Data.List as List
    +
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +
    +type WhereExpr = Expr WhereForm
    +
    +data WhereForm
    +  = WhereAlwaysFalse
    +  | WhereAlwaysTrue
    +  | WhereBinOp String
    +               NameForm
    +               SqlValue
    +  | WhereIn NameForm
    +            [SqlValue]
    +  | WhereNotIn NameForm
    +               [SqlValue]
    +  | WhereLike NameForm
    +              SqlValue
    +  | WhereLikeInsensitive NameForm
    +                         SqlValue
    +  | WhereNull NameForm
    +  | WhereNotNull NameForm
    +  | WhereRaw String
    +             [SqlValue]
    +
    +instance QualifySql WhereForm where
    +  qualified cond@WhereAlwaysFalse _ = cond
    +  qualified cond@WhereAlwaysTrue _ = cond
    +  qualified (WhereBinOp op field value) table =
    +    WhereBinOp op (field `qualified` table) value
    +  qualified (WhereIn field values) table =
    +    WhereIn (field `qualified` table) values
    +  qualified (WhereNotIn field values) table =
    +    WhereNotIn (field `qualified` table) values
    +  qualified (WhereLike field value) table =
    +    WhereLike (field `qualified` table) value
    +  qualified (WhereLikeInsensitive field value) table =
    +    WhereLikeInsensitive (field `qualified` table) value
    +  qualified (WhereNull field) table = WhereNull (field `qualified` table)
    +  qualified (WhereNotNull field) table = WhereNotNull (field `qualified` table)
    +  qualified raw@(WhereRaw _ _) _ = raw
    +
    +instance QueryKeyable WhereForm where
    +  queryKey WhereAlwaysFalse = qkOp "FALSE" QKEmpty
    +  queryKey WhereAlwaysTrue = qkOp "TRUE" QKEmpty
    +  queryKey (WhereBinOp op field value) = qkOp2 op field value
    +  queryKey (WhereIn field values) = qkOp2 "IN" field values
    +  queryKey (WhereNotIn field values) = qkOp2 "NOT IN" field values
    +  queryKey (WhereLike field value) = qkOp2 "LIKE" field value
    +  queryKey (WhereLikeInsensitive field value) = qkOp2 "ILIKE" field value
    +  queryKey (WhereNull field) = qkOp "IS NULL" field
    +  queryKey (WhereNotNull field) = qkOp "NOT IS NULL" field
    +  queryKey (WhereRaw raw values) = qkOp raw values
    +
    +instance GenerateSql WhereForm where
    +  generateSql WhereAlwaysFalse = rawSql "TRUE = FALSE"
    +  generateSql WhereAlwaysTrue = rawSql "TRUE = TRUE"
    +  generateSql (WhereBinOp op field _) =
    +    (generateSql field) <> rawSql (" " <> op <> " ?")
    +  generateSql (WhereIn field values) =
    +    (generateSql field) <> rawSql (" IN (" <> quesses <> ")")
    +    where
    +      quesses = List.intercalate "," (map (const "?") values)
    +  generateSql (WhereNotIn field values) =
    +    (generateSql field) <> rawSql (" NOT IN (" <> quesses <> ")")
    +    where
    +      quesses = List.intercalate "," (map (const "?") values)
    +  generateSql (WhereLike field _) = (generateSql field) <> rawSql " LIKE ?"
    +  generateSql (WhereLikeInsensitive field _) =
    +    (generateSql field) <> rawSql " ILIKE ?"
    +  generateSql (WhereNull field) = (generateSql field) <> rawSql " IS NULL"
    +  generateSql (WhereNotNull field) =
    +    (generateSql field) <> rawSql " IS NOT NULL"
    +  generateSql (WhereRaw raw _) = rawSql raw
    +
    +(.==) :: NameForm -> SqlValue -> WhereForm
    +name .== value = WhereBinOp "=" name value
    +
    +(.<>) :: NameForm -> SqlValue -> WhereForm
    +name .<> value = WhereBinOp "<>" name value
    +
    +(.>) :: NameForm -> SqlValue -> WhereForm
    +name .> value = WhereBinOp ">" name value
    +
    +(.>=) :: NameForm -> SqlValue -> WhereForm
    +name .>= value = WhereBinOp ">=" name value
    +
    +(.<) :: NameForm -> SqlValue -> WhereForm
    +name .< value = WhereBinOp "<" name value
    +
    +(.<=) :: NameForm -> SqlValue -> WhereForm
    +name .<= value = WhereBinOp "<=" name value
    +
    +(%==) :: NameForm -> SqlValue -> WhereForm
    +name %== value = WhereBinOp "@@" name value
    +
    +(.<-) :: NameForm -> [SqlValue] -> WhereForm
    +name .<- values = whereIn name values
    +
    +whereIn :: NameForm -> [SqlValue] -> WhereForm
    +whereIn _ [] = WhereAlwaysFalse
    +whereIn field values = WhereIn field (List.nub values)
    +
    +whereNotIn :: NameForm -> [SqlValue] -> WhereForm
    +whereNotIn _ [] = WhereAlwaysTrue
    +whereNotIn field values = WhereNotIn field (List.nub values)
    +
    +whereLike :: NameForm -> SqlValue -> WhereForm
    +whereLike = WhereLike
    +
    +whereLikeInsensitive :: NameForm -> SqlValue -> WhereForm
    +whereLikeInsensitive = WhereLikeInsensitive
    +
    +whereNull :: NameForm -> WhereForm
    +whereNull = WhereNull
    +
    +whereNotNull :: NameForm -> WhereForm
    +whereNotNull = WhereNotNull
    +
    +whereRaw :: String -> [SqlValue] -> WhereForm
    +whereRaw = WhereRaw
    +
    +whereValues :: [WhereForm] -> [SqlValue]
    +whereValues = List.concatMap whereValuesInternal
    +
    +whereValuesInternal :: WhereForm -> [SqlValue]
    +whereValuesInternal (WhereAlwaysFalse) = []
    +whereValuesInternal (WhereAlwaysTrue) = []
    +whereValuesInternal (WhereBinOp _ _ value) = [value]
    +whereValuesInternal (WhereIn _ values) = values
    +whereValuesInternal (WhereNotIn _ values) = values
    +whereValuesInternal (WhereLike _ value) = [value]
    +whereValuesInternal (WhereLikeInsensitive _ value) = [value]
    +whereValuesInternal (WhereNull _) = []
    +whereValuesInternal (WhereNotNull _) = []
    +whereValuesInternal (WhereRaw _ values) = values
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html new file mode 100644 index 0000000..b3309ec --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Expr.html @@ -0,0 +1,15 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Expr
    +  ( module Database.Orville.PostgreSQL.Internal.Expr.Expr
    +  , module Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +  , module Database.Orville.PostgreSQL.Internal.Expr.SelectExpr
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.Expr
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +import Database.Orville.PostgreSQL.Internal.Expr.SelectExpr
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html new file mode 100644 index 0000000..695d84b --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldDefinition.html @@ -0,0 +1,235 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FieldDefintion
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.FieldDefinition where
    +
    +import Data.Int (Int32, Int64)
    +import Data.Text (Text)
    +import Data.Time (Day, UTCTime)
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr.NameExpr (NameForm(..))
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{- |
    +  Migration Guide: @textField@ has been renamed to @boundedTextField@. It now
    +  takes an @Int32@ rather than an @Int@
    +-}
    +textField :: String -> Int -> FieldDefinition NotNull Text
    +textField name len = fieldOfType (varText len) name
    +
    +{- |
    +  Migration Guide: @fixedTextField@ retains the same name. It now
    +  takes an @Int32@ rather than an @Int@
    +-}
    +fixedTextField :: String -> Int -> FieldDefinition NotNull Text
    +fixedTextField name len = fieldOfType (text len) name
    +
    +{- |
    +  Migration Guide: @unboundedTextField@ retains the same name.
    +-}
    +unboundedTextField :: String -> FieldDefinition NotNull Text
    +unboundedTextField = fieldOfType unboundedText
    +
    +{- |
    +  Migration Guide: @dayField@ has been renamed to @dateField@
    +-}
    +dayField :: String -> FieldDefinition NotNull Day
    +dayField = fieldOfType date
    +
    +{- |
    +  Migration Guide: @utcTimeField@ has been renamed to @utcTimestampField@
    +-}
    +utcTimeField :: String -> FieldDefinition NotNull UTCTime
    +utcTimeField = fieldOfType timestamp
    +
    +{- |
    +  Migration guide: @int32Field@ has been renamed to @integerField@
    +-}
    +int32Field :: String -> FieldDefinition NotNull Int32
    +int32Field = fieldOfType integer
    +
    +{- |
    +  Migration guide: @int64Field@ has been renamed to @bigIntegerField@
    +-}
    +int64Field :: String -> FieldDefinition NotNull Int64
    +int64Field = fieldOfType bigInteger
    +
    +{- |
    +  Migration guide: @doubleField@ retains the same name.
    +-}
    +doubleField :: String -> FieldDefinition NotNull Double
    +doubleField = fieldOfType double
    +
    +{- |
    +  Migration guide: @boolField@ has been renamed to @booleanField@
    +-}
    +boolField :: String -> FieldDefinition NotNull Bool
    +boolField = fieldOfType boolean
    +
    +{- |
    +  Migration guide: @automaticIdField@ has been renamed to @serialField@
    +-}
    +automaticIdField :: String -> FieldDefinition NotNull Int32
    +automaticIdField = fieldOfType serial
    +
    +{- |
    +  Migration guide: @searchVectorField@ has been renamed to @textSearchVectorField@
    +-}
    +searchVectorField :: String -> FieldDefinition NotNull Text
    +searchVectorField = fieldOfType textSearchVector
    +
    +{-|
    +  Migration Guide: @nullableField@ retains the same name
    +
    +  Makes a 'NotNull' field 'Nullable' by wrapping the Haskell type of the field
    +  in 'Maybe'. The field will be marked as 'NULL' in the database schema and
    +  the value 'Nothing' will be used to represent 'NULL' values when converting
    +  to and from sql.
    +-}
    +nullableField :: FieldDefinition NotNull a -> FieldDefinition Nullable (Maybe a)
    +nullableField field =
    +  let
    +    nullableType sqlType =
    +      sqlType
    +        { sqlTypeToSql = maybe SqlNull (sqlTypeToSql sqlType)
    +        , sqlTypeFromSql =
    +            \sql ->
    +              case sql of
    +                SqlNull ->
    +                  Right Nothing
    +
    +                _ ->
    +                  Just <$> sqlTypeFromSql sqlType sql
    +        }
    +  in
    +    FieldDefinition
    +      (fieldName field)
    +      (nullableType $ fieldType field)
    +      (fieldFlags field)
    +      Nullable
    +
    +{-|
    +  Adds a `Maybe` wrapper to a field that is already nullable. (If your field is
    +  'NotNull', you wanted 'nullableField' instead of this function). Note that
    +  fields created using this function have asymetric encoding and decoding of
    +  'NULL' values. Because the provided field is 'Nullable', 'NULL' values decode
    +  from the database already have a representation in the 'a' type, so 'NULL'
    +  will be decoded as 'Just <value of type a for NULL>'. This means if you
    +  insert a 'Nothing' value using the field, it will be read back as 'Just'
    +  value. This is useful for building high level combinators that might need to
    +  make fields 'Nullable' but need the value to be decoded in its underlying
    +  type when reading back (e.g. 'maybeMapper' from 'RelationalMap').
    +-}
    +asymmetricNullableField :: FieldDefinition Nullable a -> FieldDefinition Nullable (Maybe a)
    +asymmetricNullableField field =
    +  let
    +    nullableType sqlType =
    +      sqlType
    +        { sqlTypeToSql = maybe SqlNull (sqlTypeToSql sqlType)
    +        , sqlTypeFromSql = \sql -> Just <$> sqlTypeFromSql sqlType sql
    +        }
    +  in
    +    FieldDefinition
    +      (fieldName field)
    +      (nullableType $ fieldType field)
    +      (fieldFlags field)
    +      Nullable
    +
    +{- |
    +  Migration Guide: @isFieldNullable@ has been replaced with
    +  @fieldIsNotNullable@, which has the same signture but the @Bool@ returned is
    +  the opposite.
    +-}
    +isFieldNullable :: FieldDefinition nullability a -> Bool
    +isFieldNullable field =
    +  case checkNullability field of
    +    NullableField _ -> True
    +    NotNullField _ -> False
    +
    +{- |
    +  Migration Guide: @foreignKeyField@ has been removed. It is replaced by
    +  @addForeignKeyConstraint@ which adds a foreign key constraint to an existing
    +  @FieldDefinition@.
    +-}
    +foreignKeyField ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability key
    +  -> FieldDefinition nullability key
    +foreignKeyField name refTable refField =
    +  FieldDefinition
    +    name
    +    (foreignRefType $ fieldType refField)
    +    [References refTable refField]
    +    (fieldNullability refField)
    +
    +{- |
    +  Migration Guide: @fieldOfType@ is essentially unchanged in the new orville.
    +-}
    +fieldOfType :: SqlType a -> String -> FieldDefinition NotNull a
    +fieldOfType sqlType name =
    +  FieldDefinition
    +    name
    +    sqlType
    +    []
    +    NotNull
    +
    +isAssignedByDatabase :: ColumnFlag -> Bool
    +isAssignedByDatabase AssignedByDatabase = True
    +isAssignedByDatabase _ = False
    +
    +escapedFieldName :: FieldDefinition nullability a -> String
    +escapedFieldName field = "\"" ++ fieldName field ++ "\""
    +
    +{- |
    +  Migration Guide: @withFlag@ has been removed. See the migration guide
    +  on 'ColumnFlag' regarding the new API.
    +-}
    +withFlag :: FieldDefinition nullability a -> ColumnFlag -> FieldDefinition nullability a
    +withFlag field newFlag = field {fieldFlags = newFlag : fieldFlags field}
    +
    +{- |
    +  Migration Guide: @withName@ has been removed.
    +-}
    +withName :: FieldDefinition nullability a -> String -> FieldDefinition nullability a
    +withName field newName = field {fieldName = newName}
    +
    +{- |
    +  Migration Guide: @withConversion@ has been replaced with @convertField@,
    +  whose arguments are flipped from those of @withConversion@. Note there is
    +  also now a @coerceField@ function that can be used with @newtype@ wrappers,
    +  provided the constructor is available where @coerceField@ is used.
    +-}
    +withConversion ::
    +     FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b
    +withConversion field mapType = field {fieldType = mapType $ fieldType field}
    +
    +isAssignedByDatabaseField :: FieldDefinition nullability a -> Bool
    +isAssignedByDatabaseField field = any isAssignedByDatabase $ fieldFlags field
    +
    +{- |
    +  Migration Guide: @withPrefix@ has been replaced by @prefixField@ whose
    +  arguments are flipped relative to @withPrefix@
    +-}
    +withPrefix :: FieldDefinition nullability a -> String -> FieldDefinition nullability a
    +withPrefix field prefix = field `withName` (prefix ++ "_" ++ fieldName field)
    +
    +fieldToNameForm :: FieldDefinition nullability a -> NameForm
    +fieldToNameForm field = NameForm Nothing (fieldName field)
    +
    +{- |
    +  Migration Guide: @fieldToSqlValue@ has been renamed to @fieldValueToSqlValue@
    +-}
    +fieldToSqlValue :: FieldDefinition nullability a -> a -> SqlValue
    +fieldToSqlValue = sqlTypeToSql . fieldType
    +
    +{- |
    +  Migration Guide: @fieldFromSqlValue@ has been renamed to @fieldValueFromSqlValue@
    +-}
    +fieldFromSqlValue :: FieldDefinition nullability a -> SqlValue -> Either RowDataErrorReason a
    +fieldFromSqlValue = sqlTypeFromSql . fieldType
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html new file mode 100644 index 0000000..5a5121c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FieldUpdate.html @@ -0,0 +1,24 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FieldUpdate
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +
    +module Database.Orville.PostgreSQL.Internal.FieldUpdate where
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +fieldUpdate :: FieldDefinition nullability a -> a -> FieldUpdate
    +fieldUpdate fieldDef a =
    +  FieldUpdate (SomeField fieldDef) (fieldToSqlValue fieldDef a)
    +
    +(.:=) :: FieldDefinition nullability a -> a -> FieldUpdate
    +(.:=) = fieldUpdate
    +
    +fieldUpdateName :: FieldUpdate -> String
    +fieldUpdateName = someFieldName . fieldUpdateField
    +  where
    +    someFieldName (SomeField f) = fieldName f
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html new file mode 100644 index 0000000..2fcabe0 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromClause.html @@ -0,0 +1,25 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FromClause
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.FromClause where
    +
    +import Database.Orville.PostgreSQL.Internal.Sql
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +newtype FromClause =
    +  FromClause String
    +
    +fromClauseRaw :: String -> FromClause
    +fromClauseRaw = FromClause
    +
    +fromClauseTableName :: String -> FromClause
    +fromClauseTableName name = fromClauseRaw ("FROM " ++ escapedName name)
    +
    +fromClauseTable :: TableDefinition readEntity writeEntity key -> FromClause
    +fromClauseTable = fromClauseTableName . tableName
    +
    +fromClauseToSql :: FromClause -> String
    +fromClauseToSql (FromClause sql) = sql
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html new file mode 100644 index 0000000..22d0b81 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.FromSql.html @@ -0,0 +1,90 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.FromSql
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.FromSql where
    +
    +import Control.Exception.Lifted (throw)
    +import Control.Monad
    +import qualified Data.ByteString.Char8 as BS
    +import qualified Data.ByteString.Lazy.Char8 as LBS
    +import Data.Convertible
    +import Data.Maybe
    +import Data.String (fromString)
    +import qualified Data.Text as T
    +import qualified Data.Text.Lazy as LT
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +convertFromSql :: Convertible SqlValue a => SqlValue -> Either FromSqlError a
    +convertFromSql =
    +  either (Left . simpleConversionError . prettyConvertError) Right . safeConvert
    +
    +col :: (ColumnSpecifier col, Convertible SqlValue a) => col -> FromSql a
    +col spec = joinFromSqlError (convertFromSql <$> getColumn (selectForm spec))
    +
    +{- |
    +  Migration Guide: @fieldFromSql@ has been replaced with @fieldValueFromSqlValue@
    +-}
    +fieldFromSql :: FieldDefinition nullability a -> FromSql a
    +fieldFromSql field =
    +  joinFromSqlError (fromSqlValue <$> getColumn (selectForm field))
    +  where
    +    fromSqlValue sql =
    +      case fieldFromSqlValue field sql of
    +        Right a -> Right a
    +        Left err ->
    +          Left $
    +          RowDataError
    +            RowDataErrorDetails
    +              { rowErrorReason = err
    +              , rowErrorColumnName = fieldName field
    +              , rowErrorPrimaryKeys = []
    +              }
    +
    +class ColumnSpecifier col where
    +  selectForm :: col -> SelectForm
    +
    +instance ColumnSpecifier SelectForm where
    +  selectForm = id
    +
    +instance ColumnSpecifier NameForm where
    +  selectForm = selectColumn
    +
    +instance ColumnSpecifier (FieldDefinition nullability a) where
    +  selectForm = selectColumn . fromString . fieldName
    +
    +instance ColumnSpecifier [Char] where
    +  selectForm = selectColumn . fromString
    +
    +instance ColumnSpecifier T.Text where
    +  selectForm = selectColumn . fromString . T.unpack
    +
    +instance ColumnSpecifier LT.Text where
    +  selectForm = selectColumn . fromString . LT.unpack
    +
    +instance ColumnSpecifier BS.ByteString where
    +  selectForm = selectColumn . fromString . BS.unpack
    +
    +instance ColumnSpecifier LBS.ByteString where
    +  selectForm = selectColumn . fromString . LBS.unpack
    +
    +type ResultSet = [[(String, SqlValue)]]
    +
    +decodeSqlRows ::
    +     MonadOrville conn m => FromSql result -> ResultSet -> m [result]
    +decodeSqlRows builder rows =
    +  fmap catMaybes $
    +  forM rows $ \row -> do
    +    case runFromSql builder row of
    +      Right result -> pure $ Just result
    +      Left err -> throw err
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html new file mode 100644 index 0000000..dc850ad --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.GroupBy.html @@ -0,0 +1,36 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.GroupBy
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.GroupBy where
    +
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data GroupByClause =
    +  GroupByClause String
    +                [SqlValue]
    +
    +instance QueryKeyable GroupByClause where
    +  queryKey (GroupByClause sql vals) = QKList [QKField sql, queryKey vals]
    +
    +groupingSql :: GroupByClause -> String
    +groupingSql (GroupByClause sql _) = sql ++ " "
    +
    +groupingValues :: GroupByClause -> [SqlValue]
    +groupingValues (GroupByClause _ values) = values
    +
    +class ToGroupBy a where
    +  toGroupBy :: a -> GroupByClause
    +
    +instance ToGroupBy (FieldDefinition nullability a) where
    +  toGroupBy fieldDef = GroupByClause (fieldName fieldDef) []
    +
    +instance ToGroupBy (String, [SqlValue]) where
    +  toGroupBy (sql, values) = GroupByClause sql values
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html new file mode 100644 index 0000000..029cdbc --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.IndexDefinition.html @@ -0,0 +1,103 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.IndexDefinition
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.IndexDefinition
    +  ( uniqueIndex
    +  , simpleIndex
    +  , simplePartialIndex
    +  , uniquePartialIndex
    +  ) where
    +
    +import Data.List (intercalate)
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{- |
    +  Migration Guide: @uniqueIndex@ no longer requires a name to be specified.
    +  Migration will be done automatically by inspecting the structure of the
    +  indexes that exist in the database. It also no longer accepts a
    +  @TableDefinition@ at the time of creating the @IndexDefinition@. Instead you
    +  should use @addTableIndexes@ to add the @IndexDefinition@ to the
    +  @TableDefinition@ for the table that you wish to index.
    +
    +  If you wish to specify the index name explicitly, you can use
    +  @uniqueNamedIndex@ instead. If you do so, index migration will be managed by
    +  comparing to the names of existing indexes rather than checking that the
    +  index structure matches the Haskell definition.
    +-}
    +uniqueIndex ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> [SomeField]
    +  -> IndexDefinition
    +uniqueIndex name tableDef fields =
    +  mkIndexDefinition True name tableDef fields []
    +
    +{- |
    +  Migration Guide: @simpleIndex@ has been renamed to @nonUniqueIndex@. It no
    +  longer requires a name to be specified. Migration will be done automatically
    +  be inspecting the structure of the indexes that exist in the database. It
    +  also no longer accepts a @TableDefinition@ at the time of creating the
    +  @IndexDefinition@. Instead you should use @addTableIndexes@ to add the
    +  @IndexDefinition@ to the @TableDefinition@ for the table that you wish to
    +  index.
    +
    +  If you wish to specify the index name explicitly, you can use
    +  @nonUniqueNamedIndex@ instead. If you do so, index migration will be managed
    +  by comparing to the names of existing indexes rather than checking that the
    +  index structure matches the Haskell definition.
    +-}
    +simpleIndex ::
    +     String
    +  -> TableDefinition readEntity writeEntity key
    +  -> [SomeField]
    +  -> IndexDefinition
    +simpleIndex name tableDef fields =
    +  mkIndexDefinition False name tableDef fields []
    +
    +indexFieldsBody :: [SomeField] -> String
    +indexFieldsBody fields = "(" ++ intercalate "," (map name fields) ++ ")"
    +  where
    +    name (SomeField field) = escapedFieldName field
    +
    +-- | Works much the same as `uniqueIndex` but takes a list of strings that are the conditions of a
    +-- where clause on index creation for partial indexes
    +uniquePartialIndex :: String
    +                   -> TableDefinition readEntity writeEntity key
    +                   -> [SomeField]
    +                   -> [String]
    +                   -> IndexDefinition
    +uniquePartialIndex =
    +  mkIndexDefinition True
    +
    +-- | Works much the same as `simpleIndex` but takes a list of strings that are the conditions of a
    +-- where clause on index creation for partial indexes
    +simplePartialIndex :: String
    +                   -> TableDefinition readEntity writeEntity key
    +                   -> [SomeField]
    +                   -> [String]
    +                   -> IndexDefinition
    +simplePartialIndex =
    +  mkIndexDefinition False
    +
    +mkIndexDefinition :: Bool
    +                  -> String
    +                  -> TableDefinition readEntity writeEntity key
    +                  -> [SomeField]
    +                  -> [String]
    +                  -> IndexDefinition
    +mkIndexDefinition unique name tableDef fields whereStrs =
    +  let
    +    whereStr [] = ""
    +    whereStr strs = "WHERE " <> intercalate " AND " (fmap (\a -> "(" <> a <> ")") strs)
    +  in
    +    IndexDefinition
    +      { indexName = name
    +      , indexUnique = unique
    +      , indexTable = tableName tableDef
    +      , indexBody = indexFieldsBody fields <> whereStr whereStrs
    +      }
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html new file mode 100644 index 0000000..ede6c98 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MappendCompat.html @@ -0,0 +1,15 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Expr.NameExpr
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MappendCompat
    +  ( (<>)
    +  ) where
    +#if MIN_VERSION_base(4,11,0)
    +#else
    +import Data.Monoid ((<>))
    +#endif
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html new file mode 100644 index 0000000..df92905 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateConstraint.html @@ -0,0 +1,51 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateConstraint
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateConstraint
    +  ( createConstraintPlan
    +  , dropConstraintPlan
    +  ) where
    +
    +import Control.Monad
    +import Data.List
    +
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +createConstraintPlan ::
    +     ConstraintDefinition -> SchemaState -> Maybe MigrationPlan
    +createConstraintPlan constraintDef schemaState = do
    +  guard
    +    (not $
    +     schemaStateConstraintExists (constraintName constraintDef) schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (Constraint constraintDef)
    +      (intercalate
    +         " "
    +         [ "ALTER TABLE"
    +         , "\"" ++ constraintTable constraintDef ++ "\""
    +         , "ADD CONSTRAINT"
    +         , "\"" ++ constraintName constraintDef ++ "\""
    +         , constraintBody constraintDef
    +         ])
    +
    +dropConstraintPlan :: String -> String -> SchemaState -> Maybe MigrationPlan
    +dropConstraintPlan tableName constraintName schemaState = do
    +  guard (schemaStateConstraintExists constraintName schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (DropConstraint tableName constraintName)
    +      (intercalate
    +         " "
    +         [ "ALTER TABLE"
    +         , "\"" ++ tableName ++ "\""
    +         , "DROP CONSTRAINT"
    +         , "\"" ++ constraintName ++ "\""
    +         ])
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html new file mode 100644 index 0000000..8493cac --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateIndex.html @@ -0,0 +1,45 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateIndex
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateIndex
    +  ( createIndexPlan
    +  , dropIndexPlan
    +  ) where
    +
    +import Control.Monad
    +import Data.List
    +
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +createIndexPlan :: IndexDefinition -> SchemaState -> Maybe MigrationPlan
    +createIndexPlan indexDef schemaState = do
    +  guard (not $ schemaStateIndexExists (indexName indexDef) schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (Index indexDef)
    +      (intercalate
    +         " "
    +         [ "CREATE"
    +         , if indexUnique indexDef
    +             then "UNIQUE"
    +             else ""
    +         , "INDEX"
    +         , "\"" ++ indexName indexDef ++ "\""
    +         , "ON"
    +         , "\"" ++ indexTable indexDef ++ "\""
    +         , indexBody indexDef
    +         ])
    +
    +dropIndexPlan :: String -> SchemaState -> Maybe MigrationPlan
    +dropIndexPlan name schemaState = do
    +  guard (schemaStateIndexExists name schemaState)
    +  -- Here we drop the index only if it exists so that during the migration plan
    +  -- should something else prior cause the index to be dropped we will not cause an error.
    +  pure $ migrationDDLForItem (DropIndex name) ("DROP INDEX IF EXISTS " ++ "\"" ++ name ++ "\"")
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html new file mode 100644 index 0000000..81f6300 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSchema.html @@ -0,0 +1,253 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateSchema
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE DeriveDataTypeable #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateSchema
    +  ( migrateSchema
    +  , generateMigrationPlan
    +  , createIndexesConcurrently
    +  , dropIndexesConcurrently
    +  ) where
    +
    +import Control.Concurrent (threadDelay)
    +import qualified Control.Exception as Exc
    +import Control.Monad
    +import Control.Monad.Catch
    +import Control.Monad.IO.Class
    +import Data.Foldable
    +import Data.Int
    +import Data.List
    +import Data.String
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FromClause
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.MigrateConstraint
    +import Database.Orville.PostgreSQL.Internal.MigrateIndex
    +import Database.Orville.PostgreSQL.Internal.MigrateSequence
    +import Database.Orville.PostgreSQL.Internal.MigrateTable
    +import Database.Orville.PostgreSQL.Internal.MigrationError
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Select
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Raw
    +import Database.Orville.PostgreSQL.Select
    +
    +orvilleLockScope :: Int32
    +orvilleLockScope = 17772
    +
    +migrationLockId :: Int32
    +migrationLockId = 7995632
    +
    +tryLockExpr :: SelectExpr
    +tryLockExpr =
    +  rawSqlExpr $
    +  "pg_try_advisory_xact_lock(" <> fromString (show orvilleLockScope) <> "," <>
    +  fromString (show migrationLockId) <>
    +  ") as result"
    +
    +waitForLockExpr :: SelectExpr
    +waitForLockExpr =
    +  rawSqlExpr $
    +  "pg_advisory_xact_lock(" <> fromString (show orvilleLockScope) <> "," <>
    +  fromString (show migrationLockId) <>
    +  ") as result"
    +
    +lockResult :: FromSql Bool
    +lockResult = col ("result" :: String)
    +
    +withLockedTransaction :: (MonadOrville conn m, MonadThrow m) => m a -> m a
    +withLockedTransaction action = do
    +  go (0 :: Int)
    +  where
    +    go attempts = do
    +      result <- runWithTransaction
    +      case result of
    +        Just a -> pure a
    +        Nothing -> do
    +          when (attempts >= 25) $ do
    +            throwM $
    +              MigrationLockExcessiveRetryError
    +                "Giving up after 25 attempts to aquire the migration lock."
    +          liftIO $ threadDelay 10000
    +          go $ attempts + 1
    +    runWithTransaction =
    +      withTransaction $ do
    +        [locked] <-
    +          runSelect $
    +          selectQueryColumns [tryLockExpr] lockResult (fromClauseRaw "") mempty
    +        if locked
    +          then Just <$> action
    +          else do
    +            void $
    +              runSelect $
    +              selectQueryColumns
    +                [waitForLockExpr]
    +                (pure ())
    +                (fromClauseRaw "")
    +                mempty
    +            pure Nothing
    +
    +{-|
    +   Migration Guide: @migrateSchema@ has been renamed to @autoMigrateSchema@
    +
    +   migrateSchema will attempt to make changes to the actual database schema
    +   that it it matches the provided SchemaDefinition. Unsafe migrations such as
    +   dropping tables or columns are never attempted unless the SchemaDefinition
    +   explicitly states that the items are safe to drop. Column types may be changed,
    +   but will fail if the database cannot successfully make the request type change.
    +  -}
    +migrateSchema :: MonadOrville conn m => SchemaDefinition -> m ()
    +migrateSchema schemaDef =
    +  withConnection $ \conn -> do
    +    withLockedTransaction $ do
    +      plan <- nonTransactionallyGenerateMigrationPlan conn schemaDef
    +      case plan of
    +        Nothing -> pure ()
    +        Just somethingToDo ->
    +          nonTransactionallyExecuteMigrationPlan conn somethingToDo
    +
    +{-|
    +   Migration Guide: @generateMigrationPlan@ retains the same name. It has
    +   changed to always return a @MigrationPlan@. You can use check whether
    +   @migrationPlanSteps@ is as empty list if you wish to determine whether any
    +   migrations will be performed by the plan.
    +
    +
    +   generateMigrationPlan inspects the state of the actual database schema and
    +   constructs a plan describing what changes would be made to make it match the
    +   provided SchemaDefinition. If the actual schema already matches the
    +   definition, Nothing will be returned.
    + -}
    +generateMigrationPlan ::
    +     MonadOrville conn m => SchemaDefinition -> m (Maybe MigrationPlan)
    +generateMigrationPlan schemaDef =
    +  withConnection $ \conn -> do
    +    withLockedTransaction $ do
    +      nonTransactionallyGenerateMigrationPlan conn schemaDef
    +
    +nonTransactionallyGenerateMigrationPlan ::
    +     MonadOrville conn m => conn -> SchemaDefinition -> m (Maybe MigrationPlan)
    +nonTransactionallyGenerateMigrationPlan conn schemaDef =
    +  liftIO $ buildMigrationPlan schemaDef <$> loadSchemaState conn
    +
    +nonTransactionallyExecuteMigrationPlan ::
    +     MonadOrville conn m => conn -> MigrationPlan -> m ()
    +nonTransactionallyExecuteMigrationPlan conn plan = do
    +  forM_ (migrationPlanItems plan) $ \(MigrationItem schemaItem ddl) ->
    +    executingSql DDLQuery ddl $ do
    +      stmt <- prepare conn ddl
    +      executeRaw stmt `Exc.catch`
    +        (Exc.throw . MigrationExecutionError schemaItem)
    +
    +buildMigrationPlan :: SchemaDefinition -> SchemaState -> Maybe MigrationPlan
    +buildMigrationPlan schemaDef schemaState = foldMap mkPlan schemaDef
    +  where
    +    mkPlan element =
    +      case element of
    +        Table tableDef -> migrateTablePlan tableDef schemaState
    +        DropTable name -> dropTablePlan name schemaState
    +        Index indexDef -> createIndexPlan indexDef schemaState
    +        DropIndex name -> dropIndexPlan name schemaState
    +        Constraint constraintDef ->
    +          createConstraintPlan constraintDef schemaState
    +        DropConstraint tablName name ->
    +          dropConstraintPlan tablName name schemaState
    +        Sequence seqDef ->
    +          createSequencePlan seqDef schemaState
    +        DropSequence name ->
    +          dropSequencePlan name schemaState
    +
    +{-|
    +   Migration Plan: @createIndexesConcurrently@ has been removed. You should now
    +   use @setIndexCreationStrategy Asynchronous@ instead.
    +
    +   createIndexesConcurrently will create the given indexes, if they do not exist using the
    +    PostgreSQL concurrently feature. However, this does *not* mean the the function happens
    +    concurrently. This will wait for PostgreSQL to return, but other operations to the table will be
    +    allowed during index creation.
    +
    +   Note: PostgreSQL does not allow CREATE INDEX CONCURRENTLY to appear inside of a transaction. Use
    +   this function with care.
    +-}
    +createIndexesConcurrently :: MonadOrville conn m
    +                          => [IndexDefinition]
    +                          -> m ()
    +createIndexesConcurrently indexDefs =
    +  withConnection $ \conn -> do
    +    traverse_ (createIndexConcurrently conn) indexDefs
    +
    +-- internal helper function that takes a connection and performs a single index creation.
    +createIndexConcurrently :: MonadOrville conn m
    +                        => conn
    +                        -> IndexDefinition
    +                        -> m ()
    +createIndexConcurrently conn indexDef =
    +  let ddl =
    +        (intercalate
    +          " "
    +          [ "CREATE"
    +          , if indexUnique indexDef
    +            then "UNIQUE"
    +            else ""
    +          , "INDEX"
    +          , "CONCURRENTLY"
    +          , "IF NOT EXISTS"
    +          , "\"" ++ indexName indexDef ++ "\""
    +          , "ON"
    +          , "\"" ++ indexTable indexDef ++ "\""
    +          , indexBody indexDef
    +          ])
    +  in
    +    executingSql DDLQuery ddl $ do
    +      stmt <- prepare conn ddl
    +      executeRaw stmt
    +
    +
    +{-|
    +   Migration Guide: @dropIndexesConcurrently@ has been removed.
    +
    +   dropIndexesConcurrently will drop each of the given indexes with the CONCURRENTLY keyword,
    +   allowing for other table operations to continue while the index is dropped. However there are
    +   several caveats that come with this as noted at
    +   https://www.postgresql.org/docs/9.6/sql-dropindex.html . Much like 'createIndexesConcurrently'
    +   this cannot be used in a transaction. But further this cannot drop indexes that support UNIQUE or
    +   PRIMARY KEY constraints.
    +
    +   Use this with care.
    +-}
    +dropIndexesConcurrently :: MonadOrville conn m
    +                        => [String]
    +                        -> m ()
    +dropIndexesConcurrently idxNames =
    +  withConnection $ \conn -> do
    +    traverse_ (dropIndexConcurrently conn) idxNames
    +
    +dropIndexConcurrently :: MonadOrville conn m
    +                      => conn
    +                      -> String
    +                      -> m ()
    +dropIndexConcurrently conn idxName =
    +  let ddl =
    +        (intercalate
    +          " "
    +          [ "DROP"
    +          , "INDEX"
    +          , "CONCURRENTLY"
    +          , "IF EXISTS"
    +          , "\"" ++ idxName ++ "\""
    +          ])
    +  in
    +    executingSql DDLQuery ddl $ do
    +      stmt <- prepare conn ddl
    +      executeRaw stmt
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html new file mode 100644 index 0000000..2e1831c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateSequence.html @@ -0,0 +1,43 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateSequence
    +Copyright : Flipstone Technology Partners 2016-2019
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.MigrateSequence
    +  ( createSequencePlan
    +  , dropSequencePlan
    +  ) where
    +
    +import Control.Monad (guard)
    +import Data.List (intercalate)
    +
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +createSequencePlan :: SequenceDefinition -> SchemaState -> Maybe MigrationPlan
    +createSequencePlan seqDef schemaState = do
    +  guard (not $ schemaStateSequenceExists (sequenceName seqDef) schemaState)
    +  pure $
    +    migrationDDLForItem
    +      (Sequence seqDef)
    +      (intercalate
    +         " "
    +         [ "CREATE SEQUENCE"
    +         , "\"" ++ sequenceName seqDef ++ "\""
    +         , maybe "" ("INCREMENT BY " ++) $ show <$> sequenceIncrement seqDef
    +         , maybe "" ("MINVALUE " ++) $ show <$> sequenceMinValue seqDef
    +         , maybe "" ("MAXVALUE " ++) $ show <$> sequenceMaxValue seqDef
    +         , maybe "" ("START WITH " ++) $ show <$> sequenceStart seqDef
    +         , maybe "" ("CACHE " ++) $ show <$> sequenceCache seqDef
    +         , cycleClause $ sequenceCycle seqDef
    +         ])
    +  where
    +    cycleClause True = "CYCLE"
    +    cycleClause _ = "NO CYCLE"
    +
    +dropSequencePlan :: String -> SchemaState -> Maybe MigrationPlan
    +dropSequencePlan name schemaState = do
    +  guard (schemaStateSequenceExists name schemaState)
    +  pure $ migrationDDLForItem (DropSequence name) ("DROP SEQUENCE " ++ "\"" ++ name ++ "\"" )
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html new file mode 100644 index 0000000..a6c8e28 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrateTable.html @@ -0,0 +1,171 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrateTable
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE ExistentialQuantification #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrateTable
    +  ( migrateTablePlan
    +  , dropTablePlan
    +  ) where
    +
    +import Control.Monad
    +import qualified Data.List as List
    +import Data.Maybe
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.MigrationPlan
    +import Database.Orville.PostgreSQL.Internal.PrimaryKey
    +import Database.Orville.PostgreSQL.Internal.SchemaState
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +migrateTablePlan ::
    +     TableDefinition readEntity writeEntity key
    +  -> SchemaState
    +  -> Maybe MigrationPlan
    +migrateTablePlan tableDef schemaState =
    +  case schemaStateTableColumns (tableName tableDef) schemaState of
    +    Nothing ->
    +      Just $ migrationDDLForItem (Table tableDef) (mkCreateTableDDL tableDef)
    +    Just columns ->
    +      migrationDDLForItem (Table tableDef) <$>
    +      mkMigrateTableDDL columns tableDef
    +
    +dropTablePlan :: String -> SchemaState -> Maybe MigrationPlan
    +dropTablePlan name schemaState = do
    +  guard (schemaStateTableExists name schemaState)
    +  pure $ migrationDDLForItem (DropTable name) (mkDropTableDDL name)
    +
    +mkMigrateTableDDL ::
    +     [(String, SqlColDesc)]
    +  -> TableDefinition readEntity writeEntity key
    +  -> Maybe String
    +mkMigrateTableDDL columns tableDef =
    +  if null stmts
    +    then Nothing
    +    else Just $ "ALTER TABLE \"" ++ tableName tableDef ++ "\" " ++ cols
    +  where
    +    fields = tableFields tableDef
    +    fieldNamesToDelete = tableSafeToDelete tableDef
    +    fieldColumn fieldDef = lookup (fieldName fieldDef) columns
    +    colStmt (SomeField f) = mkMigrateColumnDDL f (fieldColumn f)
    +    dropStmt name = mkDropColumnDDL name (lookup name columns)
    +    stmts =
    +      List.concatMap colStmt fields ++
    +      List.concatMap dropStmt fieldNamesToDelete
    +    cols = List.intercalate ", " $ stmts
    +
    +mkMigrateColumnTypeDDL :: FieldDefinition nullability a
    +                       -> SqlColDesc
    +                       -> Maybe String
    +mkMigrateColumnTypeDDL fieldDef colDesc =
    +  let fieldDesc = sqlFieldDesc fieldDef
    +      name = rawExprToSql . generateSql . NameForm Nothing $ fieldName fieldDef
    +   in if colType fieldDesc /= colType colDesc ||
    +         colSize fieldDesc /= colSize colDesc
    +        then Just $
    +             "ALTER COLUMN " ++
    +             name ++
    +             " SET DATA TYPE " ++ sqlTypeDDL (fieldType fieldDef)
    +        else Nothing
    +
    +mkMigrateColumnNullDDL :: FieldDefinition nullability a
    +                       -> SqlColDesc
    +                       -> Maybe String
    +mkMigrateColumnNullDDL fieldDef colDesc =
    +  let fieldDesc = sqlFieldDesc fieldDef
    +      fieldNull = fromMaybe True (colNullable fieldDesc)
    +      colNull = fromMaybe True (colNullable colDesc)
    +      name = rawExprToSql . generateSql . NameForm Nothing $ fieldName fieldDef
    +   in if fieldNull && not colNull
    +        then Just $ "ALTER COLUMN " ++ name ++ " DROP NOT NULL"
    +        else if not fieldNull && colNull
    +               then Just $
    +                    "ALTER COLUMN " ++ name ++ " SET NOT NULL"
    +               else Nothing
    +
    +mkMigrateColumnDDL :: FieldDefinition nullability a
    +                   -> Maybe SqlColDesc
    +                   -> [String]
    +mkMigrateColumnDDL fieldDef Nothing = ["ADD COLUMN " ++ mkFieldDDL fieldDef]
    +mkMigrateColumnDDL fieldDef (Just desc) =
    +  catMaybes
    +    [ mkMigrateColumnTypeDDL fieldDef desc
    +    , mkMigrateColumnNullDDL fieldDef desc
    +    ]
    +
    +mkDropColumnDDL :: String -> Maybe SqlColDesc -> [String]
    +mkDropColumnDDL _ Nothing = []
    +mkDropColumnDDL name (Just _) = ["DROP COLUMN " ++ (rawExprToSql . generateSql . NameForm Nothing) name]
    +
    +mkFlagDDL :: ColumnFlag -> Maybe String
    +mkFlagDDL Unique = Just "UNIQUE"
    +mkFlagDDL (Default def) = Just $ "DEFAULT " ++ toColumnDefaultSql def
    +mkFlagDDL (References table field) =
    +  Just $ "REFERENCES \"" ++ tableName table ++ "\" (" ++ (rawExprToSql . generateSql . NameForm Nothing . fieldName) field ++ ")"
    +mkFlagDDL (ColumnDescription _) = Nothing
    +mkFlagDDL AssignedByDatabase = Nothing
    +
    +mkFieldDDL :: FieldDefinition nullability a -> String
    +mkFieldDDL field = name ++ " " ++ sqlType ++ " " ++ flagSql
    +  where
    +    name = rawExprToSql . generateSql . fieldToNameForm $ field
    +    sqlType = sqlTypeDDL (fieldType field)
    +    flagSql =
    +      List.intercalate " " (notNull : mapMaybe mkFlagDDL (fieldFlags field))
    +    notNull =
    +      if isFieldNullable field
    +        then "NULL"
    +        else "NOT NULL"
    +
    +mkPrimaryKeyDDL :: PrimaryKey key -> String
    +mkPrimaryKeyDDL keyDef =
    +  let
    +    names =
    +      mapPrimaryKeyParts (\_ field -> fieldToNameForm field) keyDef
    +  in
    +    concat
    +      [ "PRIMARY KEY ("
    +      , List.intercalate ", " (map (rawExprToSql . generateSql) names)
    +      , ")"
    +      ]
    +
    +mkCreateTableDDL :: TableDefinition readEntity writeEntity key -> String
    +mkCreateTableDDL tableDef =
    +  let
    +    mkSomeFieldDDL (SomeField f) =
    +      mkFieldDDL f
    +
    +    fields =
    +      List.intercalate ", " $ map mkSomeFieldDDL (tableFields tableDef)
    +
    +    primaryKeyDDL =
    +      mkPrimaryKeyDDL (tablePrimaryKey tableDef)
    +  in
    +    concat
    +      [ "CREATE TABLE \""
    +      , tableName tableDef
    +      , "\" ("
    +      , fields
    +      , ", "
    +      , primaryKeyDDL
    +      , ")"
    +      ]
    +
    +mkDropTableDDL :: String -> String
    +mkDropTableDDL name = "DROP TABLE \"" ++ name ++ "\""
    +
    +sqlFieldDesc :: FieldDefinition nullability a -> SqlColDesc
    +sqlFieldDesc field =
    +  SqlColDesc
    +    { colType = sqlTypeId $ fieldType field
    +    , colSize = sqlTypeSqlSize $ fieldType field
    +    , colNullable = Just (isFieldNullable field)
    +    , colOctetLength = Nothing
    +    , colDecDigits = Nothing
    +    }
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html new file mode 100644 index 0000000..f52dfae --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationError.html @@ -0,0 +1,68 @@ +
    module Database.Orville.PostgreSQL.Internal.MigrationError
    +  ( MigrationError(..)
    +  ) where
    +
    +import Control.Exception (Exception, SomeException, displayException)
    +import qualified Data.List as List
    +import Data.Typeable (Typeable)
    +
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data MigrationError
    +  = MigrationLockExcessiveRetryError String
    +  | MigrationExecutionError SchemaItem
    +                            SomeException
    +  deriving (Typeable)
    +
    +instance Exception MigrationError
    +
    +--
    +-- This Show instance is not great, in fact it's horribly inconsistent. I'm leaving it like
    +-- this for now to avoid be derailed.
    +--
    +instance Show MigrationError where
    +  show err =
    +    case err of
    +      MigrationLockExcessiveRetryError msg ->
    +        "MigrationLockExcessiveRetryError " ++ show msg
    +      MigrationExecutionError (Table tableDef) someException ->
    +        formatTableMigrationException tableDef someException
    +      MigrationExecutionError schemaItem someException ->
    +        concat ["MigrationError ", show schemaItem, show someException]
    +
    +formatTableMigrationException ::
    +     TableDefinition readEntity writeEntity key -> SomeException -> String
    +formatTableMigrationException tableDef exception = message
    +  where
    +    message =
    +      "There was an error migrating table " ++
    +      name ++
    +      ".\n\
    +                  \The error is:\n\
    +                  \\n\
    +                  \ " ++
    +      displayException exception ++
    +      "\\n\
    +                  \\n\
    +                  \\n\
    +                  \Here are the developer comments regarding the table:\n\
    +                  \\n\
    +                  \ " ++
    +      comments ++
    +      "\
    +                  \\n"
    +    name = tableName tableDef
    +    comments = formatTableComments " " tableDef
    +
    +formatTableComments ::
    +     String -> TableDefinition readEntity writeEntity key -> String
    +formatTableComments indent tableDef =
    +  List.intercalate ("\n" ++ indent) commentLines
    +  where
    +    commentLines = map formatTableComment comments
    +    comments = runComments (tableComments tableDef)
    +
    +formatTableComment :: TableComment -> String
    +formatTableComment c =
    +  List.intercalate " - " [tcWhat c, show (tcWhen c), tcWho c]
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html new file mode 100644 index 0000000..7d6bfc1 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.MigrationPlan.html @@ -0,0 +1,68 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.MigrationPlan
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Internal.MigrationPlan
    +  ( MigrationPlan
    +  , MigrationItem(..)
    +  , DDL
    +  , migrationDDLForItem
    +  , migrationPlanItems
    +  ) where
    +
    +import qualified Data.DList as DList
    +
    +import Database.Orville.PostgreSQL.Internal.Types (SchemaItem)
    +
    +type DDL = String
    +
    +{- |
    +  Migration Guide: @MigrationItem@ has been renamed to @MigrationStep@, which
    +  is now a simple @RawSql@ wrapper. You can use @RawSql.toExampleBytes@ if you
    +  wish to render it to a bytestring for display purposes.
    +-}
    +data MigrationItem = MigrationItem
    +  { migrationItemSchemaItem :: SchemaItem
    +  , migrationItemDDL :: DDL
    +  }
    +
    +{- |
    +  Migration Guide: @MigrationPlan@ retains the same name.
    +-}
    +data MigrationPlan =
    +  MigrationPlan MigrationItem
    +                (DList.DList MigrationItem)
    +
    +migrationDDLForItem :: SchemaItem -> DDL -> MigrationPlan
    +migrationDDLForItem schemaItem ddl =
    +  MigrationPlan (MigrationItem schemaItem ddl) DList.empty
    +
    +append :: MigrationPlan -> MigrationPlan -> MigrationPlan
    +append (MigrationPlan itemA restA) (MigrationPlan itemB restB) =
    +  MigrationPlan itemA $ DList.append restA $ DList.cons itemB restB
    +
    +{- |
    +  Migration Guide: @migrationPlanItems@ has been renamed to
    +  @migrationPlanSteps@
    +-}
    +migrationPlanItems :: MigrationPlan -> [MigrationItem]
    +migrationPlanItems (MigrationPlan item rest) =
    +  DList.toList $ DList.cons item rest
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup MigrationPlan where
    +  (<>) = append
    +#else
    +instance Monoid MigrationPlan
    +  -- MigrationPlan doesn't support mempty, so don't provide a Monoid instance for
    +  -- base versions that have migrated to Semigroup.
    +  where
    +    mempty =
    +      error
    +        "mempty for MigrationPlan used, but MigrationPlan cannot be empty! MigrationPlan only support Monoid prior to base 4.11.0"
    +    mappend = append
    +#endif
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html new file mode 100644 index 0000000..5135255 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Monad.html @@ -0,0 +1,393 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE FunctionalDependencies #-}
    +{-# LANGUAGE RankNTypes #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Monad where
    +
    +import Control.Applicative
    +import Control.Monad (MonadPlus)
    +import Control.Monad.Base
    +import Control.Monad.Catch (MonadCatch, MonadMask(..), MonadThrow)
    +import Control.Monad.Except
    +import Control.Monad.IO.Class (MonadIO)
    +import Control.Monad.Reader (ReaderT(..), ask, local, mapReaderT, runReaderT)
    +import Control.Monad.State (StateT, mapStateT)
    +import Control.Monad.Trans.Class (MonadTrans(lift))
    +import Data.Pool
    +import Database.HDBC hiding (withTransaction)
    +
    +#if MIN_VERSION_base(4,11,0)
    +import Control.Monad.Fail (MonadFail)
    +#endif
    +
    +data ConnectionEnv conn = ConnectionEnv
    +  { ormTransactionOpen :: Bool
    +  , ormConnection :: conn
    +  }
    +
    +data QueryType
    +  = SelectQuery
    +  | InsertQuery
    +  | UpdateQuery
    +  | DeleteQuery
    +  | DDLQuery
    +  deriving (Ord, Eq, Enum, Show, Read)
    +
    +{-|
    +  Migration Guide: @OrvilleEnv@ has been renamed to @OrvilleState@. It no
    +  longer has any type paremeters. The connection type is fixed and cannot be
    +  changed.
    +
    + 'OrvilleEnv' tracks all the environment information required for an
    + 'OrvilleT conn m' Monad to operate. Use 'newOrvilleEnv' to construct
    + one.
    +  -}
    +data OrvilleEnv conn = OrvilleEnv
    +  { ormEnvConnectionEnv :: Maybe (ConnectionEnv conn)
    +  , ormEnvStartTransactionSQL :: String
    +  , ormEnvRunningQuery :: forall a. QueryType -> String -> IO a -> IO a
    +  , ormEnvTransactionCallback :: TransactionEvent -> IO ()
    +  , ormEnvPool :: Pool conn
    +  }
    +
    +data TransactionEvent
    +  = TransactionStart
    +  | TransactionCommit
    +  | TransactionRollback
    +  deriving (Ord, Eq, Enum, Show, Read)
    +
    +defaultStartTransactionSQL :: String
    +defaultStartTransactionSQL = "START TRANSACTION"
    +
    +{- |
    +  Migration Guide: @setStartTransactionSQL@ has been renamed to @setBeginTransactionExpr@
    +-}
    +setStartTransactionSQL :: String -> OrvilleEnv conn -> OrvilleEnv conn
    +setStartTransactionSQL sql env = env {ormEnvStartTransactionSQL = sql}
    +
    +defaultRunningQuery :: QueryType -> String -> IO a -> IO a
    +defaultRunningQuery _ _ action = action
    +
    +defaultTransactionCallback :: TransactionEvent -> IO ()
    +defaultTransactionCallback = const (pure ())
    +
    +{- |
    +  Migration Guide: @aroundRunningQuery@ has been renamed to @addSqlExecutionCallback@
    +-}
    +aroundRunningQuery ::
    +     (forall a. QueryType -> String -> IO a -> IO a)
    +  -> OrvilleEnv conn
    +  -> OrvilleEnv conn
    +aroundRunningQuery outside env = env {ormEnvRunningQuery = layeredAround}
    +  where
    +    layeredAround, inside :: QueryType -> String -> IO a -> IO a
    +    layeredAround queryType sql action =
    +      outside queryType sql (inside queryType sql action)
    +    inside = ormEnvRunningQuery env
    +
    +{- |
    +  Migration Guide: @addTransactionCallBack@ retains the same name
    +-}
    +addTransactionCallBack ::
    +     (TransactionEvent -> IO ()) -> OrvilleEnv conn -> OrvilleEnv conn
    +addTransactionCallBack callback env =
    +  env {ormEnvTransactionCallback = wrappedCallback}
    +  where
    +    wrappedCallback event = do
    +      ormEnvTransactionCallback env event
    +      callback event
    +
    +{-|
    +  Migration Guide: @newOrvilleEnv@ has been renamed to @newOrvilleState@. The
    +  new function requires a parameter to be passed before the connection pool to
    +  specify the level of detail to be used when Orville reports errors.
    +
    + 'newOrvilleEnv' initialized an 'OrvilleEnv' for service. The connection
    + pool provided will be used to obtain connections to the database ase
    + required. You can use the 'Database.Orville.PostgreSQL.Connection.createConnectionPool'
    + utility function to create a connection pool to a PosgreSQL server.
    +-}
    +newOrvilleEnv :: Pool conn -> OrvilleEnv conn
    +newOrvilleEnv =
    +  OrvilleEnv
    +    Nothing
    +    defaultStartTransactionSQL
    +    defaultRunningQuery
    +    defaultTransactionCallback
    +
    +setConnectionEnv :: ConnectionEnv conn -> OrvilleEnv conn -> OrvilleEnv conn
    +setConnectionEnv c ormEnv = ormEnv {ormEnvConnectionEnv = Just c}
    +
    +{- |
    +  Migration Guide: @OrvilleT@ has been removed. In its place you can simply use
    +  a @ReaderT OrvilleState@. If you have another @ReaderT@ layer in your monad
    +  stack you can add the @OrvilleState@ to the reader context for that layer
    +  instead, which is more efficient than having multiple @ReaderT@ layers. If
    +  you have a simple case of @OrvilleT conn IO@ the new Orville offers a simpler
    +  @Orville@ monad (not a transformer) to get you started.
    +-}
    +newtype OrvilleT conn m a = OrvilleT
    +  { unOrvilleT :: ReaderT (OrvilleEnv conn) m a
    +  } deriving ( Functor
    +             , Applicative
    +             , Alternative
    +             , Monad
    +             , MonadPlus
    +             , MonadIO
    +             , MonadThrow
    +             , MonadCatch
    +             , MonadMask
    +#if MIN_VERSION_base (4,11,0)
    +             , MonadFail
    +#endif
    +             )
    +
    +{- |
    +  Migration Guide: @mapOrvilleT@ has been removed because @OrvilleT@ has been
    +  removed. If you're replacing @OrvilleT@ with @ReaderT@ then @mapOrvilleT@
    +  should be replaced with @mapReaderT@.
    +-}
    +mapOrvilleT ::
    +     Monad n => (m a -> n b) -> OrvilleT conn m a -> OrvilleT conn n b
    +mapOrvilleT f (OrvilleT action) = OrvilleT $ mapReaderT f action
    +
    +{- |
    +  Migration Guide: @runOrville@ now operates on the concrete @Orville@ monad
    +  becase @OrvilleT@ has been removed. Assuming you are replacing usages of
    +  @OrvilleT@ with @ReaderT@ you will want to replace usages of @runOrville@
    +  with @runReaderT@.
    +-}
    +runOrville :: OrvilleT conn m a -> OrvilleEnv conn -> m a
    +runOrville = runReaderT . unOrvilleT
    +
    +newConnectionEnv :: conn -> ConnectionEnv conn
    +newConnectionEnv = ConnectionEnv False
    +
    +withConnectionEnv :: MonadOrville conn m => (ConnectionEnv conn -> m a) -> m a
    +withConnectionEnv action = do
    +  ormEnv <- getOrvilleEnv
    +  case ormEnvConnectionEnv ormEnv of
    +    Just connected -> action connected
    +    Nothing ->
    +      liftWithConnection (withResource (ormEnvPool ormEnv)) $ \conn -> do
    +        let connected = newConnectionEnv conn
    +        localOrvilleEnv (const $ ormEnv {ormEnvConnectionEnv = Just connected}) $
    +          action connected
    +
    +withConnection :: MonadOrville conn m => (conn -> m a) -> m a
    +withConnection action = withConnectionEnv (action . ormConnection)
    +
    +instance MonadTrans (OrvilleT conn) where
    +  lift = OrvilleT . lift
    +
    +instance (MonadError e m) => MonadError e (OrvilleT conn m) where
    +  throwError = lift . throwError
    +  catchError action handler =
    +    OrvilleT ((unOrvilleT action) `catchError` (unOrvilleT . handler))
    +
    +instance MonadBase b m => MonadBase b (OrvilleT conn m) where
    +  liftBase = lift . liftBase
    +
    +{-|
    +  Migration Guide: @HasOrvilleContext@ has been renamed to @HasOrvilleState@.
    +  @getOrvilleEnv@ and @localOrvilleEnv@ have been renamed to @askOrvilleState@
    +  and @localOrvilleState@.
    +
    +  'HasOrvilleContext' defines the operations that must be available in your own
    +  monad for managing the connection pool that Orville functions will use to
    +  access the database and manage transaction state. In most cases you can
    +  include 'OrvilleT' in your Monad stack and then automatically derive an
    +  instance of 'HasOrvilleContext'.
    +
    +  You could also provide your own implementations of these functions
    +  instead of using 'OrvilleT', if that is the easiest approach for
    +  your Monad.
    + -}
    +class IConnection conn =>
    +      HasOrvilleContext conn m
    +  | m -> conn
    +  where
    +  getOrvilleEnv :: m (OrvilleEnv conn)
    +  -- ^ getOrvilleEnv fetches the Orville environment from the Monad context.
    +  -- Analogous to 'ask' from the 'Reader' monad.
    +  localOrvilleEnv :: (OrvilleEnv conn -> OrvilleEnv conn) -> m a -> m a -- ^ localOrvilleEnv locally modifies the Orville environment for the
    +  -- scope of the provided action. This allows Orville to track with
    +  -- a connection is acquired, open transactions, etc. Analogous to 'local'
    +  -- from the 'Reader' monad.
    +
    +{-|
    +   Migration Guide: @MonadOrvilleControl@ retains the same name. The
    +   @liftFinally@ member has been removed. There are new @liftCatch@ and
    +   @liftMask@ members that must be implemented, however. Instances of the new
    +   @MonadOrvilleControl@ are provided for @IO@ and @ReaderT@. Helper functions
    +   for implmenting the members via @UnliftIO@ can be found in
    +   @Orville.PostgreSQL.UnliftIO@.
    +
    +   'MonadOrvilleControl' provides an interface for the kinds of IO operations
    +   that Orville functions need to lift into the Monad providing the
    +   'MonadOrville' instance. This typeclass allows users to provide their
    +   own lifting strategies in case the Monad stack in question has special
    +   needs. If you are only using 'ReaderT' and 'OrvilleT' layers in your
    +   monad stack, you can probably implement this for your own Monad wrapper
    +   type using the provided default functions and providing functions to
    +   wrap and unwrapper your Monad layer:
    +
    +   @
    +    instance MonadOrvilleControl MyMonad where
    +      liftWithConnection = defaultLiftWithConnection wrapMyMonad unWrapMyMonad
    +      liftFinally = defaultLiftFinally wrapMyMonad unWrapMyMonad
    +   @
    +
    +   If you are using transformers in your monad stack beyond 'ReaderT', they
    +   probably don't provide 'MonadOrvilleControl' instances (e.g. third party
    +   libraries). In this case, see 'Database.Orville.PostgreSQL.MonadUnliftIO' for more
    +   help. If you're still stuck (because your library doesn't support
    +   'MonadTransControl'), try 'Database.Orville.PostgreSQL.MonadBaseControl' instead. If
    +   you're *still* stuck after that, please file an issue on Github at
    +   https://github.com/flipstone/orville so we can can help out!
    +  -}
    +class MonadOrvilleControl m where
    +  liftWithConnection ::
    +       (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b
    +  liftFinally :: (forall a b. IO a -> IO b -> IO a) -> m c -> m d -> m c
    +
    +{-|
    +  Migration Guide: @MonadOrville@ retains the same name, but the @conn@
    +  parameter has been removed. @MonadFail@ and @MonadThrow@ have been removed as
    +  superclass constraints.
    +
    +  'MonadOrville' does not have any methods of its own. Instead it brings all
    +  the typeclass constraints required by Orville functions that need to access
    +  the database into a single typeclass. In some cases you can include
    +  'OrvilleT' in your Monad stack and then automatically derive an instance of
    +  'MonadOrville'. However, more likely you are using some third party monad
    +  somewhere in your stack that does not han a 'MonadOrvilleControl' instance.
    +  In this case you won't be able to derive 'MonadOrville', but providing a
    +  simple empty instance will do:
    +
    +  @
    +    instance O.MonadOrville Postgres.Connection MyMonad
    +  @
    + -}
    +class ( Monad m
    +      , MonadIO m
    +      , HasOrvilleContext conn m
    +      , MonadThrow m
    +      , MonadOrvilleControl m
    +#if MIN_VERSION_base(4,11,0)
    +      , MonadFail m
    +#endif
    +      ) =>
    +      MonadOrville conn m
    +
    +
    +instance MonadOrvilleControl IO where
    +  liftWithConnection ioWithConn = ioWithConn
    +  liftFinally ioFinally = ioFinally
    +
    +{-|
    +   Migration Guide: @defaultLiftWithConnection@ has been removed. In its
    +   place you can use either the @ReaderT@ instance of @MonadOrvilleControl@
    +   or the helpers in @Orville.PostgreSQL.UnliftIO@.
    +
    +   defaultLiftWithConnection provides a simple definition of
    +   'liftWithConnection' for 'MonadOrvilleControl' instances when the Monad in
    +   question is a wrapper around a type that already implements
    +   'MonadOrvilleControl'
    +  -}
    +defaultLiftWithConnection ::
    +     MonadOrvilleControl m
    +  => (forall a. m a -> n a)
    +  -> (forall a. n a -> m a)
    +  -> (forall a. (conn -> IO a) -> IO a)
    +  -> (conn -> n b)
    +  -> n b
    +defaultLiftWithConnection wrapT unWrapT ioWithConn action =
    +  wrapT $ liftWithConnection ioWithConn (unWrapT . action)
    +
    +{-|
    +   Migration Guide: @defaultLiftWithConnection@ has been removed (along with
    +   @liftFinally@)
    +
    +   defaultLiftFinally provides a simple definition of
    +   'liftWithConnection' for 'MonadOrvilleControl' instances when the Monad in
    +   question is a wrapper around a type that already implements
    +   'MonadOrvilleControl'
    +  -}
    +defaultLiftFinally ::
    +     MonadOrvilleControl m
    +  => (forall a. m a -> n a)
    +  -> (forall a. n a -> m a)
    +  -> (forall a b. IO a -> IO b -> IO a)
    +  -> n c
    +  -> n d
    +  -> n c
    +defaultLiftFinally wrapT unWrapT ioFinally action cleanup =
    +  wrapT $ liftFinally ioFinally (unWrapT action) (unWrapT cleanup)
    +
    +startTransactionSQL :: MonadOrville conn m => m String
    +startTransactionSQL = ormEnvStartTransactionSQL <$> getOrvilleEnv
    +
    +instance (Monad m, HasOrvilleContext conn m) =>
    +         HasOrvilleContext conn (ReaderT a m) where
    +  getOrvilleEnv = lift getOrvilleEnv
    +  localOrvilleEnv modEnv = mapReaderT (localOrvilleEnv modEnv)
    +
    +-- ReaderT is trivial enough that we just provide a 'MonadOrvilleControl'
    +-- instance for it here rather than relying on either MonadUnliftIO or
    +-- MonadBaseControl at all. This allows Monad stacks that only use 'ReaderT'
    +-- and 'OrvilleT' over IO to be built without needing to know anything more
    +-- about lifting IO operations beyond the types in this module.
    +instance MonadOrvilleControl m => MonadOrvilleControl (ReaderT a m) where
    +  liftWithConnection ioWithConn action = do
    +    ReaderT $ \env ->
    +      liftWithConnection ioWithConn (flip runReaderT env . action)
    +  liftFinally ioFinally action cleanup = do
    +    ReaderT $ \env ->
    +      liftFinally ioFinally (runReaderT action env) (runReaderT cleanup env)
    +
    +instance ( Monad m
    +         , MonadThrow m
    +         , MonadIO m
    +         , IConnection conn
    +         , MonadOrville conn m
    +         ) =>
    +         MonadOrville conn (ReaderT a m)
    +
    +instance MonadOrvilleControl m => MonadOrvilleControl (OrvilleT conn m) where
    +  liftWithConnection = defaultLiftWithConnection OrvilleT unOrvilleT
    +  liftFinally = defaultLiftFinally OrvilleT unOrvilleT
    +
    +instance (IConnection conn, Monad m) =>
    +         HasOrvilleContext conn (OrvilleT conn m) where
    +  getOrvilleEnv = OrvilleT ask
    +  localOrvilleEnv modEnv (OrvilleT a) = OrvilleT (local modEnv a)
    +
    +instance ( Monad m
    +         , MonadThrow m
    +         , MonadIO m
    +         , IConnection conn
    +         , MonadOrvilleControl m
    +#if MIN_VERSION_base (4,11,0)
    +         , MonadFail m
    +#endif
    +         ) =>
    +         MonadOrville conn (OrvilleT conn m)
    +
    +-- We can provide 'HasOrvilleContext' for 'StateT' here, but not 'MonadOrvilleControl'
    +-- because we do not want to force a decision on the end use about how the 'StateT'
    +-- state should be managed during control functions (e.g. 'liftFinally'). See the
    +-- 'MonadBaseControl' module for an instance of 'MonadOrvilleControl' for 'StateT', if
    +-- you are brave enough to use 'MonadBaseControl'.
    +instance (Monad m, HasOrvilleContext conn m) =>
    +         HasOrvilleContext conn (StateT s m) where
    +  getOrvilleEnv = lift getOrvilleEnv
    +  localOrvilleEnv modEnv = mapStateT (localOrvilleEnv modEnv)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html new file mode 100644 index 0000000..3759aaa --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.OrderBy.html @@ -0,0 +1,51 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.OrderBy
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.OrderBy where
    +
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data SortDirection
    +  = Ascending
    +  | Descending
    +  deriving (Show)
    +
    +instance QueryKeyable SortDirection where
    +  queryKey dir = QKOp (sqlDirection dir) QKEmpty
    +
    +sqlDirection :: SortDirection -> String
    +sqlDirection Ascending = "ASC"
    +sqlDirection Descending = "DESC"
    +
    +data OrderByClause =
    +  OrderByClause String
    +                [SqlValue]
    +                SortDirection
    +
    +instance QueryKeyable OrderByClause where
    +  queryKey (OrderByClause sql vals dir) =
    +    QKList [QKField sql, queryKey vals, queryKey dir]
    +
    +sortingSql :: OrderByClause -> String
    +sortingSql (OrderByClause sql _ sortDir) = sql ++ " " ++ sqlDirection sortDir
    +
    +sortingValues :: OrderByClause -> [SqlValue]
    +sortingValues (OrderByClause _ values _) = values
    +
    +class ToOrderBy a where
    +  toOrderBy :: a -> SortDirection -> OrderByClause
    +
    +instance ToOrderBy (FieldDefinition nullability a) where
    +  toOrderBy fieldDef = OrderByClause (rawExprToSql . generateSql . NameForm Nothing $ fieldName fieldDef) []
    +
    +instance ToOrderBy (String, [SqlValue]) where
    +  toOrderBy (sql, values) = OrderByClause sql values
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html new file mode 100644 index 0000000..b0dd83c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.PrimaryKey.html @@ -0,0 +1,136 @@ +
    {-# LANGUAGE RankNTypes #-}
    +module Database.Orville.PostgreSQL.Internal.PrimaryKey
    +  ( primaryKeyIn
    +  , primaryKeyEquals
    +  , primaryKeyDescription
    +  , primaryKeyToSql
    +  , primaryKey
    +  , compositePrimaryKey
    +  , primaryKeyPart
    +  , mapPrimaryKeyParts
    +  ) where
    +
    +import qualified Data.List as List
    +import qualified Database.HDBC as HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition (fieldToSqlValue)
    +import Database.Orville.PostgreSQL.Internal.Types (PrimaryKey(..), PrimaryKeyPart(..), FieldDefinition(fieldName), NotNull)
    +import Database.Orville.PostgreSQL.Internal.Where (WhereCondition, whereIn, (.==), whereAnd, whereOr)
    +
    +{-|
    +  'primaryKeyIn' builds a 'WhereCondition' that will match all rows where the
    +  primary key is equal to one of the given values. For single-field primary
    +  keys this is equivalent to 'whereIn', but 'primaryKeyIn' also handles
    +  composite primary keys.
    +-}
    +primaryKeyIn :: PrimaryKey key -> [key] -> WhereCondition
    +primaryKeyIn keyDef@(PrimaryKey first rest) keys =
    +  case rest of
    +    [] ->
    +      -- Special case the single field case to an in clause rather
    +      -- than a large OR
    +      case first of
    +        PrimaryKeyPart getPart field ->
    +          whereIn field (map getPart keys)
    +    _ ->
    +      whereOr (map (primaryKeyEquals keyDef) keys)
    +
    +{-|
    +  'primaryKeyEquals' builds a 'WhereCondition' that will match the row where
    +  the primary key is equal to the given value. For single-field primary keys
    +  this is equivalent to '.==', but 'primaryKeyEquals also handles composite
    +  primary keys.
    +-}
    +primaryKeyEquals :: PrimaryKey key -> key -> WhereCondition
    +primaryKeyEquals keyDef key =
    +  let
    +    partEq getPart partField =
    +      partField .== getPart key
    +  in
    +    whereAnd (mapPrimaryKeyParts partEq keyDef)
    +
    +{-|
    +  'primaryKeyDescription' builds a user-readable representation of the
    +  primary key for use in error messages and such. It is a comma-delimited
    +  list of the names of the fields that make up the primary key.
    +-}
    +primaryKeyDescription :: PrimaryKey key -> String
    +primaryKeyDescription keyDef =
    +  let
    +    partName _ field =
    +      fieldName field
    +  in
    +    List.intercalate ", " (mapPrimaryKeyParts partName keyDef)
    +
    +{-|
    +  'primaryKeyToSql' converts a Haskell value for a primary key into the
    +  (possibly multiple) sql values that represent the primary key in the
    +  database.
    +-}
    +primaryKeyToSql :: PrimaryKey key -> key -> [HDBC.SqlValue]
    +primaryKeyToSql keyDef key =
    +  let
    +    partSqlValue getPart partField =
    +      fieldToSqlValue partField (getPart key)
    +  in
    +    mapPrimaryKeyParts partSqlValue keyDef
    +
    +{-|
    +  'primaryKey' constructs a single-field primary key from the 'FieldDefinition'
    +  that corresponds to the primary key's column. This is generally used while
    +  building a 'TableDefinition'.
    +-}
    +primaryKey :: FieldDefinition NotNull key -> PrimaryKey key
    +primaryKey fieldDef =
    +  PrimaryKey (PrimaryKeyPart id fieldDef) []
    +
    +{-|
    +  'compositePrimaryKey' constructs a multi-field primary key from the given
    +  parts, each of which corresponds to one field in the primary key.  You should
    +  use this while building a 'TableDefinition' for a table that you want to have
    +  a multi-column primary key. See 'primaryKeyPart' for how to build the parts
    +  to be passed as parameters. Note: there is no special significance to the
    +  first argument other than requiring that there is at least one field in the
    +  primary key.
    +-}
    +compositePrimaryKey :: PrimaryKeyPart key
    +                    -> [PrimaryKeyPart key]
    +                    -> PrimaryKey key
    +compositePrimaryKey =
    +  PrimaryKey
    +
    +{-|
    +  'primaryKeyPart' builds on section of a composite primary key based on the
    +  field definition that corresponds to that column of the primary key. The
    +  function given is used to decompose the Haskell value for the composite key
    +  into the individual parts so they can be converted to sql for things like
    +  building 'WhereCondition'
    +-}
    +primaryKeyPart :: (key -> part)
    +               -> FieldDefinition NotNull part
    +               -> PrimaryKeyPart key
    +primaryKeyPart =
    +  PrimaryKeyPart
    +
    +{-|
    +  'mapPrimaryKeyParts' provides a way to access the innards of a 'PrimaryKey'
    +  definition to extract information. The given function will be called on
    +  each part of the primary key in order and the list of results is returned.
    +  Note that single-field and multi-field primary keys are treated the same by
    +  this function, with the single-field case simply behaving as composite key
    +  with just one part.
    +-}
    +mapPrimaryKeyParts :: (forall part.
    +                         (key -> part)
    +                        -> FieldDefinition NotNull part
    +                        -> a
    +                      )
    +                   -> PrimaryKey key
    +                   -> [a]
    +mapPrimaryKeyParts f (PrimaryKey first rest) =
    +  let
    +    doPart (PrimaryKeyPart getPart field) =
    +      f getPart field
    +  in
    +    map doPart (first:rest)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html new file mode 100644 index 0000000..12ceee8 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryCache.html @@ -0,0 +1,134 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.QueryCache
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +
    +module Database.Orville.PostgreSQL.Internal.QueryCache
    +  ( QueryCached
    +  , runQueryCached
    +  , selectCached
    +  , selectFirstCached
    +  , findRecordCached
    +  , findRecordsCached
    +  , findRecordsByCached
    +  , unsafeLift
    +  ) where
    +
    +import Control.Monad.Catch (MonadThrow)
    +import Control.Monad.Trans
    +import Control.Monad.Trans.State
    +import qualified Data.Map as Map
    +import qualified Data.Map.Helpers as Map
    +import Data.Maybe
    +
    +import Data.String (fromString)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.PrimaryKey
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +import Database.Orville.PostgreSQL.Internal.TableDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Select
    +
    +type QueryCache = Map.Map QueryKey ResultSet
    +
    +newtype QueryCached m a =
    +  QueryCached (StateT QueryCache m a)
    +  deriving (Functor, Applicative, Monad)
    +
    +runQueryCached :: Monad m => QueryCached m a -> m a
    +runQueryCached (QueryCached statet) = evalStateT statet Map.empty
    +
    +cached ::
    +     Monad m => QueryKey -> QueryCached m ResultSet -> QueryCached m ResultSet
    +cached key action = do
    +  cache <- QueryCached get
    +  case Map.lookup key cache of
    +    Just result -> do
    +      pure result
    +    Nothing -> do
    +      result <- action
    +      QueryCached $ put (Map.insert key result cache)
    +      pure result
    +
    +selectCachedRows ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> QueryCached m ResultSet
    +selectCachedRows tableDef opts =
    +  cached key $
    +  unsafeLift $
    +  runSelect $ selectQueryRows selects (fromClauseTable tableDef) opts
    +  where
    +    selects = expr . selectColumn . fromString <$> tableColumnNames tableDef
    +    key = mconcat [queryKey tableDef, queryKey opts]
    +
    +selectCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> QueryCached m [readEntity]
    +selectCached tableDef opts = do
    +  rows <- selectCachedRows tableDef opts
    +  unsafeLift $ decodeSqlRows (tableFromSql tableDef) rows
    +
    +selectFirstCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> QueryCached m (Maybe readEntity)
    +selectFirstCached tableDef opts =
    +  listToMaybe <$> selectCached tableDef (limit 1 <> opts)
    +
    +findRecordsCached ::
    +     (MonadThrow m, MonadOrville conn m, Ord key)
    +  => TableDefinition readEntity writeEntity key
    +  -> [key]
    +  -> QueryCached m (Map.Map key readEntity)
    +findRecordsCached tableDef keys = do
    +  let
    +    primKey = tablePrimaryKey tableDef
    +    mkEntry record = (tableGetKey tableDef record, record)
    +
    +  recordList <- selectCached tableDef (where_ $ primaryKeyIn primKey keys)
    +  pure $ Map.fromList (map mkEntry recordList)
    +
    +findRecordCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> key
    +  -> QueryCached m (Maybe readEntity)
    +findRecordCached tableDef key =
    +  let
    +    primKey = tablePrimaryKey tableDef
    +   in
    +    selectFirstCached tableDef (where_ $ primaryKeyEquals primKey key)
    +
    +findRecordsByCached ::
    +     (Ord fieldValue, MonadThrow m, MonadOrville conn m)
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> QueryCached m (Map.Map fieldValue [readEntity])
    +findRecordsByCached tableDef field opts = do
    +  let builder = (,) <$> fieldFromSql field <*> tableFromSql tableDef
    +  rows <- selectCachedRows tableDef opts
    +  Map.groupBy' id <$> unsafeLift (decodeSqlRows builder rows)
    +
    +-- this is unsafe in the sense that it does not provide
    +-- any guarantees that the action won't chance values in
    +-- the database, rendering the cache incorrect. It is not
    +-- exposed publically, but all usages of it here need to
    +-- be examined for correctness manually.
    +--
    +unsafeLift :: Monad m => m a -> QueryCached m a
    +unsafeLift = QueryCached . lift
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html new file mode 100644 index 0000000..a921233 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.QueryKey.html @@ -0,0 +1,133 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.QueryKey
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP #-}
    +
    +module Database.Orville.PostgreSQL.Internal.QueryKey where
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +
    +import Data.Time.LocalTime
    +import Database.HDBC
    +
    +data QueryKey
    +  = QKValue OrdSqlValue
    +  | QKField String
    +  | QKTable String
    +  | QKOp String
    +         QueryKey
    +  | QKList [QueryKey]
    +  | QKEmpty
    +  deriving (Eq, Ord)
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup QueryKey where
    +  (<>) = appendQueryKeys
    +#endif
    +instance Monoid QueryKey where
    +  mempty = QKEmpty
    +  mappend = appendQueryKeys
    +  mconcat = QKList
    +
    +appendQueryKeys :: QueryKey -> QueryKey -> QueryKey
    +appendQueryKeys a b = QKList [a, b]
    +
    +class QueryKeyable a where
    +  queryKey :: a -> QueryKey
    +
    +instance QueryKeyable QueryKey where
    +  queryKey = id
    +
    +instance QueryKeyable a => QueryKeyable [a] where
    +  queryKey = foldMap queryKey
    +
    +instance QueryKeyable a => QueryKeyable (Maybe a) where
    +  queryKey = foldMap queryKey
    +
    +instance QueryKeyable SqlValue where
    +  queryKey = QKValue . OrdSqlValue
    +
    +qkOp :: (QueryKeyable a) => String -> a -> QueryKey
    +qkOp op a = QKOp op $ queryKey a
    +
    +qkOp2 :: (QueryKeyable a, QueryKeyable b) => String -> a -> b -> QueryKey
    +qkOp2 op a b = QKOp op $ QKList [queryKey a, queryKey b]
    +
    +newtype OrdSqlValue =
    +  OrdSqlValue SqlValue
    +
    +instance Ord OrdSqlValue where
    +  compare (OrdSqlValue s) (OrdSqlValue s') = compareSqlValue s s'
    +
    +instance Eq OrdSqlValue where
    +  a == b = compare a b == EQ
    +
    +compareSqlValue :: SqlValue -> SqlValue -> Ordering
    +compareSqlValue (SqlString v) (SqlString v') = compare v v'
    +compareSqlValue (SqlString _) _ = LT
    +compareSqlValue _ (SqlString _) = GT
    +compareSqlValue (SqlByteString v) (SqlByteString v') = compare v v'
    +compareSqlValue (SqlByteString _) _ = LT
    +compareSqlValue _ (SqlByteString _) = GT
    +compareSqlValue (SqlWord32 v) (SqlWord32 v') = compare v v'
    +compareSqlValue (SqlWord32 _) _ = LT
    +compareSqlValue _ (SqlWord32 _) = GT
    +compareSqlValue (SqlWord64 v) (SqlWord64 v') = compare v v'
    +compareSqlValue (SqlWord64 _) _ = LT
    +compareSqlValue _ (SqlWord64 _) = GT
    +compareSqlValue (SqlInt32 v) (SqlInt32 v') = compare v v'
    +compareSqlValue (SqlInt32 _) _ = LT
    +compareSqlValue _ (SqlInt32 _) = GT
    +compareSqlValue (SqlInt64 v) (SqlInt64 v') = compare v v'
    +compareSqlValue (SqlInt64 _) _ = LT
    +compareSqlValue _ (SqlInt64 _) = GT
    +compareSqlValue (SqlInteger v) (SqlInteger v') = compare v v'
    +compareSqlValue (SqlInteger _) _ = LT
    +compareSqlValue _ (SqlInteger _) = GT
    +compareSqlValue (SqlChar v) (SqlChar v') = compare v v'
    +compareSqlValue (SqlChar _) _ = LT
    +compareSqlValue _ (SqlChar _) = GT
    +compareSqlValue (SqlBool v) (SqlBool v') = compare v v'
    +compareSqlValue (SqlBool _) _ = LT
    +compareSqlValue _ (SqlBool _) = GT
    +compareSqlValue (SqlDouble v) (SqlDouble v') = compare v v'
    +compareSqlValue (SqlDouble _) _ = LT
    +compareSqlValue _ (SqlDouble _) = GT
    +compareSqlValue (SqlRational v) (SqlRational v') = compare v v'
    +compareSqlValue (SqlRational _) _ = LT
    +compareSqlValue _ (SqlRational _) = GT
    +compareSqlValue (SqlLocalDate v) (SqlLocalDate v') = compare v v'
    +compareSqlValue (SqlLocalDate _) _ = LT
    +compareSqlValue _ (SqlLocalDate _) = GT
    +compareSqlValue (SqlLocalTimeOfDay v) (SqlLocalTimeOfDay v') = compare v v'
    +compareSqlValue (SqlLocalTimeOfDay _) _ = LT
    +compareSqlValue _ (SqlLocalTimeOfDay _) = GT
    +compareSqlValue (SqlZonedLocalTimeOfDay v z) (SqlZonedLocalTimeOfDay v' z') =
    +  compare v v' <> compare z z'
    +compareSqlValue (SqlZonedLocalTimeOfDay _ _) _ = LT
    +compareSqlValue _ (SqlZonedLocalTimeOfDay _ _) = GT
    +compareSqlValue (SqlLocalTime v) (SqlLocalTime v') = compare v v'
    +compareSqlValue (SqlLocalTime _) _ = LT
    +compareSqlValue _ (SqlLocalTime _) = GT
    +compareSqlValue (SqlZonedTime (ZonedTime v z)) (SqlZonedTime (ZonedTime v' z')) =
    +  compare v v' <> compare z z'
    +compareSqlValue (SqlZonedTime _) _ = LT
    +compareSqlValue _ (SqlZonedTime _) = GT
    +compareSqlValue (SqlUTCTime v) (SqlUTCTime v') = compare v v'
    +compareSqlValue (SqlUTCTime _) _ = LT
    +compareSqlValue _ (SqlUTCTime _) = GT
    +compareSqlValue (SqlDiffTime v) (SqlDiffTime v') = compare v v'
    +compareSqlValue (SqlDiffTime _) _ = LT
    +compareSqlValue _ (SqlDiffTime _) = GT
    +compareSqlValue (SqlPOSIXTime v) (SqlPOSIXTime v') = compare v v'
    +compareSqlValue (SqlPOSIXTime _) _ = LT
    +compareSqlValue _ (SqlPOSIXTime _) = GT
    +compareSqlValue (SqlEpochTime v) (SqlEpochTime v') = compare v v'
    +compareSqlValue (SqlEpochTime _) _ = LT
    +compareSqlValue _ (SqlEpochTime _) = GT
    +compareSqlValue (SqlTimeDiff v) (SqlTimeDiff v') = compare v v'
    +compareSqlValue (SqlTimeDiff _) _ = LT
    +compareSqlValue _ (SqlTimeDiff _) = GT
    +compareSqlValue SqlNull SqlNull = EQ
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html new file mode 100644 index 0000000..9bf59fb --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.RelationalMap.html @@ -0,0 +1,288 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.RelationalMap
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE GADTs #-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.RelationalMap
    +  ( mkTableDefinition
    +  , TableParams(..)
    +  , RelationalMap
    +  , fields
    +  , mapAttr
    +  , mapField
    +  , attrField
    +  , maybeMapper
    +  , prefixMap
    +  , partialMap
    +  , readOnlyMap
    +  , readOnlyField
    +  ) where
    +
    +import Control.Monad (join, when)
    +import Control.Monad.Reader (ask)
    +import Control.Monad.State (modify)
    +import Data.Profunctor (Profunctor(lmap, rmap))
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{-|
    + MigrationGuide: @TableParams@ no longer exists. See the migration guide
    + for 'mkTableDefinition'
    +
    + 'TableParams' is the simplest way to make a 'TableDefinition'. You
    + can use 'mkTableDefinition' to make a definition from the simplified
    + params. Where 'TableDefinition' requires the 'tableFields', 'tableFromSql',
    + and 'tableToSql' to all be defined separately and kept in sync, 'TableParams'
    + provides a single 'tblMapper' field that specifies all three simultaneously
    + and ensures they are consistent with one another.
    + -}
    +data TableParams readEntity writeEntity key = TableParams
    +  { tblName :: String
    +      -- ^ The name of the table in the database
    +  , tblMapper :: RelationalMap writeEntity readEntity
    +      -- ^ The relational mapping that defines how the Haskell entity type
    +      -- is converted both to and from sql. The fields utilized in the mapping
    +      -- are used to automatically build the list of 'FieldDefinitions' that
    +      -- define the structure of the table in the database.
    +  , tblSafeToDelete :: [String]
    +      -- ^ A list of any columns that may be deleted from the table by Orville.
    +      -- (Orville will never delete a column without being told it is safe)
    +  , tblPrimaryKey :: PrimaryKey key
    +      -- ^ A function to set the key on the entity
    +  , tblGetKey :: readEntity -> key
    +      -- ^ A function to get the key on the entity
    +  , tblComments :: TableComments ()
    +      -- ^ Any comments that might be interesting for developers to see. These
    +      -- comments will get printed in the log if there is an erro while attempting
    +      -- to migrate the table.
    +  }
    +
    +{-|
    +  Migration Guide: This function has in the new orville to take the table name,
    +  primary key definition and a @SqlMarshaller@ (formerly @RelationalMap@).
    +  Other options such as constraints, indexes, and columns to drop can be added
    +  to the @TableDefinition@ after the initial instantiation. The @TableParams@
    +  type has been dropped for the new orville.
    +
    +
    + 'mkTableDefinition' converts a 'TableParams' to 'TableDefinition'. Usually
    + this is used directly on a record literal of the 'TableParams'. For
    + example:
    +
    + @
    +  data Foo key = Foo key { fooId :: Record }
    +  myTable :: TableDefinition Foo
    +  myTable = mkTableDefinition $
    +    TableParams
    +      { tblName = "foo"
    +      , tblMapper = User <$> attrField fooId idField
    +      , tableSafeToDelete = []
    +      , tblSetKey = \key foo -> foo { fooId = key }
    +      , tblGetKey = fooId
    +      , tblComments = []
    +      }
    +
    + @
    + -}
    +mkTableDefinition ::
    +     TableParams readEntity writeEntity key
    +  -> TableDefinition readEntity writeEntity key
    +mkTableDefinition (TableParams {..}) =
    +  TableDefinition
    +    { tableFields = fields tblMapper
    +    , tableFromSql = mkFromSql tblPrimaryKey tblMapper
    +    , tableToSql = mkToSql tblMapper
    +    , tablePrimaryKey = tblPrimaryKey
    +    , tableName = tblName
    +    , tableSafeToDelete = tblSafeToDelete
    +    , tableGetKey = tblGetKey
    +    , tableComments = tblComments
    +    }
    +
    +{- |
    +  Migration guide: This type has been replaced with the @SqlMarshaller@ type in
    +  the new orville. The interface is similar, though the names of the functions
    +  have been updated in many cases. See the migration guides for those functions
    +  to find their new names.
    +-}
    +data RelationalMap a b where
    +  RM_Field :: FieldDefinition nullability a -> RelationalMap a a
    +  RM_Nest :: (a -> b) -> RelationalMap b c -> RelationalMap a c
    +  RM_Pure :: b -> RelationalMap a b
    +  RM_Apply
    +    :: RelationalMap a (b -> c) -> RelationalMap a b -> RelationalMap a c
    +  RM_Partial :: RelationalMap a (Either String a) -> RelationalMap a a
    +  RM_ReadOnly :: RelationalMap a b -> RelationalMap c b
    +  RM_MaybeTag
    +    :: RelationalMap (Maybe a) (Maybe b) -> RelationalMap (Maybe a) (Maybe b)
    +
    +instance Functor (RelationalMap a) where
    +  fmap f rm = pure f <*> rm
    +
    +instance Applicative (RelationalMap a) where
    +  pure = RM_Pure
    +  (<*>) = RM_Apply
    +
    +instance Profunctor RelationalMap where
    +  rmap = fmap
    +  lmap = mapAttr
    +
    +{- |
    +  Migration Guide: @mapAttr@ has been renamed to @marshallNested@
    +-}
    +mapAttr :: (a -> b) -> RelationalMap b c -> RelationalMap a c
    +mapAttr = RM_Nest
    +
    +{- |
    +  Migration Guide: @mapField@ has been removed, though its functional
    +  equivalent is @marshallReadOnlyField@
    +-}
    +mapField :: FieldDefinition nullability a -> RelationalMap a a
    +mapField = RM_Field
    +
    +{- |
    +  Migration Guide: @partialMap@ has been renamed to @marshallPartial@
    +-}
    +partialMap :: RelationalMap a (Either String a) -> RelationalMap a a
    +partialMap = RM_Partial
    +
    +{- |
    +  Migration Guide: @readOnlyMap@ has been renamed to @marshallReadOnly@
    +-}
    +readOnlyMap :: RelationalMap a b -> RelationalMap c b
    +readOnlyMap = RM_ReadOnly
    +
    +{- |
    +  Migration Guide: @attrField@ has been renamed to @marshallField@
    +-}
    +attrField :: (a -> b) -> FieldDefinition nullability b -> RelationalMap a b
    +attrField get = mapAttr get . mapField
    +
    +{- |
    +  Migration Guide: @readOnlyField@ has been renamed to @marshallReadOnlyField@
    +-}
    +readOnlyField :: FieldDefinition nullability a -> RelationalMap b a
    +readOnlyField = readOnlyMap . mapField
    +
    +{- |
    +  Migration Guide: @prefixMap@ has been renamed to @prefixMarshaller@
    +-}
    +prefixMap :: String -> RelationalMap a b -> RelationalMap a b
    +prefixMap prefix (RM_Nest f rm) = RM_Nest f (prefixMap prefix rm)
    +prefixMap prefix (RM_Field f) = RM_Field (f `withPrefix` prefix)
    +prefixMap prefix (RM_Apply rmF rmA) =
    +  RM_Apply (prefixMap prefix rmF) (prefixMap prefix rmA)
    +prefixMap prefix (RM_Partial rm) = RM_Partial (prefixMap prefix rm)
    +prefixMap prefix (RM_ReadOnly rm) = RM_ReadOnly (prefixMap prefix rm)
    +prefixMap prefix (RM_MaybeTag rm) = RM_MaybeTag (prefixMap prefix rm)
    +prefixMap _ rm@(RM_Pure _) = rm
    +
    +{- |
    +  Migration Guide: @maybeMapper@ has been renamed to @marshallMaybe@
    +-}
    +maybeMapper :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b)
    +maybeMapper
    +    -- rewrite the mapper to handle null fields, then tag
    +    -- it as having been done so we don't double-map it
    +    -- in a future `maybeMapper` call.
    +    --
    + = RM_MaybeTag . go
    +  where
    +    go :: RelationalMap a b -> RelationalMap (Maybe a) (Maybe b)
    +    go (RM_Nest f rm) = RM_Nest (fmap f) (go rm)
    +    go (RM_Field f) =
    +      case checkNullability f of
    +        NotNullField notNullField ->
    +          RM_Field (nullableField notNullField)
    +
    +        NullableField nullField ->
    +          -- When the underlying field is already nullable we need to make sure
    +          -- that 'NULL' is decoded to a 'Just'. Otherwise when the field is
    +          -- 'NULL' it causes the entire 'RelationalMap' to resolve to a
    +          -- 'Nothing' as if _all_ fields were 'NULL', even if they were not.
    +          RM_Field (asymmetricNullableField nullField)
    +
    +    go (RM_Pure a) = RM_Pure (pure a)
    +    go (RM_Apply rmF rmA) = RM_Apply (fmap (<*>) $ go rmF) (go rmA)
    +    go (RM_Partial rm) = RM_Partial (flipError <$> go rm)
    +      where
    +        flipError :: Maybe (Either String a) -> Either String (Maybe a)
    +        flipError (Just (Right a)) = Right (Just a)
    +        flipError (Just (Left err)) = Left err
    +        flipError Nothing = Right Nothing
    +    go (RM_ReadOnly rm) = RM_ReadOnly (go rm)
    +    go rm@(RM_MaybeTag _) = fmap Just $ mapAttr join $ rm
    +
    +{- |
    +  Migration Guide: The fields in new orville's @SqlMarshaller@ are somewhat
    +  more sophisticated than those of a @RelationalMap@. The 'fields' function is
    +  no longer offered with this simple interface as a result, but the
    +  @foldMarshallerFields@ function can be used in combination with the
    +  @collectFromField@ helper to collect the desired information from each field.
    +-}
    +fields :: RelationalMap a b -> [SomeField]
    +fields (RM_Field field) = [SomeField field]
    +fields (RM_Apply rm1 rm2) = fields rm1 ++ fields rm2
    +fields (RM_Nest _ rm) = fields rm
    +fields (RM_Partial rm) = fields rm
    +fields (RM_MaybeTag rm) = fields rm
    +fields (RM_Pure _) = []
    +fields (RM_ReadOnly rm) =
    +  map (someFieldWithFlag AssignedByDatabase) (fields rm)
    +  where
    +    someFieldWithFlag flag (SomeField f) = SomeField (f `withFlag` flag)
    +
    +mkFromSql :: PrimaryKey key -> RelationalMap a b -> FromSql b
    +mkFromSql (PrimaryKey pKeyPart pKeyParts) relMap =
    +  fromSql
    +    { runFromSql = \columns ->
    +        -- lookup the primary key columns
    +        let keyNames = map getColName (pKeyPart : pKeyParts)
    +            primKeys = filter ((`elem` keyNames) . fst) columns
    +
    +         in case runFromSql fromSql columns of
    +              -- Add the primary key(s) to relevant error messages
    +              Left (RowDataError details) ->
    +                Left $ RowDataError details
    +                         { rowErrorPrimaryKeys = primKeys }
    +
    +              Left (ConversionError details) ->
    +                Left $ ConversionError details
    +                         { convErrorPrimaryKeys = primKeys }
    +
    +              x -> x
    +    }
    +  where
    +    fromSql = fromRelMap relMap
    +
    +    getColName (PrimaryKeyPart _ fieldDef) = fieldName fieldDef
    +
    +    fromRelMap :: RelationalMap a b -> FromSql b
    +    fromRelMap (RM_Field field) = fieldFromSql field
    +    fromRelMap (RM_Nest _ rm) = fromRelMap rm
    +    fromRelMap (RM_ReadOnly rm) = fromRelMap rm
    +    fromRelMap (RM_MaybeTag rm) = fromRelMap rm
    +    fromRelMap (RM_Pure b) = pure b
    +    fromRelMap (RM_Apply rmF rmC) = fromRelMap rmF <*> fromRelMap rmC
    +    fromRelMap (RM_Partial rm) = do
    +      joinFromSqlError (wrapError <$> fromRelMap rm)
    +    wrapError = either (Left . simpleConversionError) Right
    +
    +mkToSql :: RelationalMap a b -> ToSql a ()
    +mkToSql (RM_Field field) =
    +  when (not $ isAssignedByDatabaseField field) $ do
    +    value <- ask
    +    modify (fieldToSqlValue field value :)
    +mkToSql (RM_Nest f rm) = getComponent f (mkToSql rm)
    +mkToSql (RM_Apply rmF rmC) = mkToSql rmF >> mkToSql rmC
    +mkToSql (RM_Partial rm) = mkToSql rm
    +mkToSql (RM_MaybeTag rm) = mkToSql rm
    +mkToSql (RM_ReadOnly _) = pure ()
    +mkToSql (RM_Pure _) = pure ()
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html new file mode 100644 index 0000000..0e3091c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SchemaState.html @@ -0,0 +1,102 @@ +
    module Database.Orville.PostgreSQL.Internal.SchemaState
    +  ( SchemaState
    +  , schemaStateTableColumns
    +  , schemaStateTableExists
    +  , schemaStateIndexExists
    +  , schemaStateConstraintExists
    +  , schemaStateSequenceExists
    +  , loadSchemaState
    +  ) where
    +
    +import Control.Monad (forM, void)
    +import Data.Convertible (convert)
    +import qualified Database.HDBC as HDBC
    +
    +import qualified Data.Map.Strict as Map
    +import qualified Data.Set as Set
    +
    +type TableName = String
    +
    +type IndexName = String
    +
    +type ConstraintName = String
    +
    +type SequenceName = String
    +
    +type Columns = [(String, HDBC.SqlColDesc)]
    +
    +data SchemaState = SchemaState
    +  { schemaStateTables :: Map.Map TableName Columns
    +  , schemaStateIndexes :: Set.Set IndexName
    +  , schemaStateConstraints :: Set.Set ConstraintName
    +  , schemaStateSequences :: Set.Set SequenceName
    +  }
    +
    +schemaStateTableColumns :: TableName -> SchemaState -> Maybe Columns
    +schemaStateTableColumns name = Map.lookup name . schemaStateTables
    +
    +schemaStateTableExists :: TableName -> SchemaState -> Bool
    +schemaStateTableExists name = Map.member name . schemaStateTables
    +
    +schemaStateIndexExists :: IndexName -> SchemaState -> Bool
    +schemaStateIndexExists name = Set.member name . schemaStateIndexes
    +
    +schemaStateConstraintExists :: ConstraintName -> SchemaState -> Bool
    +schemaStateConstraintExists name = Set.member name . schemaStateConstraints
    +
    +schemaStateSequenceExists :: SequenceName -> SchemaState -> Bool
    +schemaStateSequenceExists name = Set.member name . schemaStateSequences
    +
    +loadSchemaState :: HDBC.IConnection conn => conn -> IO SchemaState
    +loadSchemaState conn = do
    +  SchemaState <$> getTables conn
    +              <*> getIndexes conn
    +              <*> getConstraints conn
    +              <*> getSequences conn
    +
    +getTables :: HDBC.IConnection conn => conn -> IO (Map.Map TableName Columns)
    +getTables conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT table_name from information_schema.tables where table_schema = current_schema();"
    +  void $ HDBC.execute query []
    +  tables <- map (convert . head) <$> HDBC.fetchAllRows' query
    +  fmap Map.fromList $
    +    forM tables $ \table -> do
    +      columns <- HDBC.describeTable conn table
    +      pure (table, columns)
    +
    +getIndexes :: HDBC.IConnection conn => conn -> IO (Set.Set IndexName)
    +getIndexes conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT indexname FROM pg_indexes WHERE schemaname = current_schema();"
    +  void $ HDBC.execute query []
    +  Set.fromList <$> map (convert . head) <$> HDBC.fetchAllRows' query
    +
    +getConstraints :: HDBC.IConnection conn => conn -> IO (Set.Set ConstraintName)
    +getConstraints conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT conname \
    +                        \FROM pg_constraint \
    +                        \JOIN pg_namespace ON pg_namespace.oid = pg_constraint.connamespace \
    +                        \WHERE nspname = current_schema()"
    +  void $ HDBC.execute query []
    +  Set.fromList <$> map (convert . head) <$> HDBC.fetchAllRows' query
    +
    +getSequences :: HDBC.IConnection conn => conn -> IO (Set.Set SequenceName)
    +getSequences conn = do
    +  query <-
    +    HDBC.prepare
    +      conn
    +      "SELECT c.relname \
    +                          \FROM pg_class AS c \
    +                          \JOIN pg_namespace AS ns ON c.relnamespace = ns.oid \
    +                          \WHERE c.relkind = 'S' AND current_schema() = ns.nspname;"
    +  void $ HDBC.execute query []
    +  Set.fromList <$> map (convert . head) <$> HDBC.fetchAllRows' query
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html new file mode 100644 index 0000000..f84c2aa --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Select.html @@ -0,0 +1,77 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Select
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Select where
    +
    +import Control.Monad.Reader
    +import qualified Data.List as List
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition (fieldToNameForm)
    +import Database.Orville.PostgreSQL.Internal.FromClause
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +data Select row = Select
    +  { selectBuilder :: FromSql row
    +  , selectSql :: String
    +  , selectValues :: [SqlValue]
    +  }
    +
    +selectQueryColumns ::
    +     [SelectExpr] -> FromSql row -> FromClause -> SelectOptions -> Select row
    +selectQueryColumns selectExprs builder fromClause opts =
    +  selectQueryRaw builder querySql (selectOptValues opts)
    +  where
    +    columns =
    +      List.intercalate ", " $ map (rawExprToSql . generateSql) selectExprs
    +    querySql =
    +      List.concat
    +        [ selectClause opts
    +        , columns
    +        , " "
    +        , fromClauseToSql fromClause
    +        , " "
    +        , selectOptClause opts
    +        ]
    +
    +selectQuery :: FromSql row -> FromClause -> SelectOptions -> Select row
    +selectQuery builder =
    +  selectQueryColumns (expr <$> fromSqlSelects builder) builder
    +
    +selectQueryTable ::
    +     TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> Select readEntity
    +selectQueryTable tbl = selectQuery (tableFromSql tbl) (fromClauseTable tbl)
    +
    +selectQueryRows ::
    +     [SelectExpr] -> FromClause -> SelectOptions -> Select [(String, SqlValue)]
    +selectQueryRows exprs = selectQueryColumns exprs rowFromSql
    +
    +selectQueryRaw :: FromSql row -> String -> [SqlValue] -> Select row
    +selectQueryRaw = Select
    +
    +selectQueryRawRows :: String -> [SqlValue] -> Select [(String, SqlValue)]
    +selectQueryRawRows = selectQueryRaw rowFromSql
    +
    +-- N.B. This FromSql does *not* contain an accurate list of the columns
    +-- it decodes, because it does not decode any columns at all. It is not
    +-- suitable for uses where the FromSql is used to generate the columns in
    +-- a select clause. It is not exposed publically for this reason.
    +--
    +rowFromSql :: FromSql [(String, SqlValue)]
    +rowFromSql =
    +  FromSql
    +    { fromSqlSelects =
    +        error
    +          "Database.Orville.PostgreSQL.Select.rowFromSql: fromSqlColumnNames was accessed. This is a bug."
    +    , runFromSql = Right <$> ask
    +    }
    +
    +selectField :: FieldDefinition nulability a -> SelectForm
    +selectField field = selectColumn (fieldToNameForm field)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html new file mode 100644 index 0000000..305862a --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SelectOptions.html @@ -0,0 +1,147 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.SelectOptions
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE CPP#-}
    +{-# LANGUAGE RecordWildCards #-}
    +
    +module Database.Orville.PostgreSQL.Internal.SelectOptions where
    +
    +import Data.Convertible
    +import qualified Data.List as List
    +import Data.Maybe
    +import Data.Monoid
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition ()
    +import Database.Orville.PostgreSQL.Internal.GroupBy
    +import Database.Orville.PostgreSQL.Internal.OrderBy
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types ()
    +import Database.Orville.PostgreSQL.Internal.Where
    +
    +data SelectOptions = SelectOptions
    +  { selectDistinct :: First Bool
    +  , selectOptWhere :: [WhereCondition]
    +  , selectOptOrder :: [OrderByClause]
    +  , selectOptLimit :: First Int
    +  , selectOptOffset :: First Int
    +  , selectOptGroup :: [GroupByClause]
    +  }
    +
    +selectOptLimitSql :: SelectOptions -> Maybe SqlValue
    +selectOptLimitSql = fmap convert . getFirst . selectOptLimit
    +
    +selectOptOffsetSql :: SelectOptions -> Maybe SqlValue
    +selectOptOffsetSql = fmap convert . getFirst . selectOptOffset
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup SelectOptions where
    +  (<>) = appendSelectOptions
    +#endif
    +
    +instance Monoid SelectOptions where
    +  mempty = SelectOptions mempty mempty mempty mempty mempty mempty
    +  mappend = appendSelectOptions
    +
    +appendSelectOptions :: SelectOptions -> SelectOptions -> SelectOptions
    +appendSelectOptions opt opt' =
    +  SelectOptions
    +    (selectDistinct  opt <> selectDistinct  opt')
    +    (selectOptWhere  opt <> selectOptWhere  opt')
    +    (selectOptOrder  opt <> selectOptOrder  opt')
    +    (selectOptLimit  opt <> selectOptLimit  opt')
    +    (selectOptOffset opt <> selectOptOffset opt')
    +    (selectOptGroup  opt <> selectOptGroup  opt')
    +
    +instance QueryKeyable SelectOptions where
    +  queryKey opt =
    +    mconcat
    +      [ qkOp "WHERE" $ selectOptWhere opt
    +      , qkOp "GROUP" $ selectOptGroup opt
    +      , qkOp "ORDER" $ selectOptOrder opt
    +      , qkOp "LIMIT" $ selectOptLimitSql opt
    +      , qkOp "OFFSET" $ selectOptOffsetSql opt
    +      ]
    +
    +selectClause :: SelectOptions -> String
    +selectClause opts =
    +  case selectDistinct opts of
    +    First (Just True)  -> "SELECT DISTINCT "
    +    _ -> "SELECT "
    +
    +selectOptClause :: SelectOptions -> String
    +selectOptClause opts =
    +  List.intercalate
    +    " "
    +    [ selectWhereClause opts
    +    , selectGroupByClause opts
    +    , selectOrderByClause opts
    +    , selectLimitClause opts
    +    , selectOffsetClause opts
    +    ]
    +
    +selectWhereClause :: SelectOptions -> String
    +selectWhereClause = whereClause . selectOptWhere
    +
    +selectOrderByClause :: SelectOptions -> String
    +selectOrderByClause = clause . selectOptOrder
    +  where
    +    clause [] = ""
    +    clause sortClauses =
    +      "ORDER BY " ++ List.intercalate ", " (map sortingSql sortClauses)
    +
    +selectGroupByClause :: SelectOptions -> String
    +selectGroupByClause = clause . selectOptGroup
    +  where
    +    clause [] = ""
    +    clause groupClauses =
    +      "GROUP BY " ++ List.intercalate ", " (map groupingSql groupClauses)
    +
    +selectOptValues :: SelectOptions -> [SqlValue]
    +selectOptValues opts =
    +  concat
    +    [ whereValues $ selectOptWhere opts
    +    , concatMap groupingValues $ selectOptGroup opts
    +    , concatMap sortingValues $ selectOptOrder opts
    +    , maybeToList $ selectOptLimitSql opts
    +    , maybeToList $ selectOptOffsetSql opts
    +    ]
    +
    +selectLimitClause :: SelectOptions -> String
    +selectLimitClause opts =
    +  case getFirst $ selectOptLimit opts of
    +    Nothing -> ""
    +    Just _ -> "LIMIT ?"
    +
    +selectOffsetClause :: SelectOptions -> String
    +selectOffsetClause opts =
    +  case getFirst $ selectOptOffset opts of
    +    Nothing -> ""
    +    Just _ -> "OFFSET ?"
    +
    +distinct :: SelectOptions
    +distinct = SelectOptions (First $ Just True) mempty mempty mempty mempty mempty
    +
    +where_ :: WhereCondition -> SelectOptions
    +where_ clause = SelectOptions mempty [clause] mempty mempty mempty mempty
    +
    +order :: ToOrderBy a => a -> SortDirection -> SelectOptions
    +order orderable dir =
    +  SelectOptions mempty mempty [toOrderBy orderable dir] mempty mempty mempty
    +
    +limit :: Int -> SelectOptions
    +limit n = SelectOptions mempty mempty mempty (First $ Just n) mempty mempty
    +
    +offset :: Int -> SelectOptions
    +offset n = SelectOptions mempty mempty mempty mempty (First $ Just n) mempty
    +
    +groupBy :: ToGroupBy a => a -> SelectOptions
    +groupBy groupable =
    +  SelectOptions mempty mempty mempty mempty mempty [toGroupBy groupable]
    +
    +selectOptionsToSql :: SelectOptions -> (String, [SqlValue])
    +selectOptionsToSql opts =
    +  (selectOptClause opts, selectOptValues opts)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html new file mode 100644 index 0000000..01395db --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Sql.html @@ -0,0 +1,45 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Sql
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.Sql where
    +
    +import qualified Data.List as List
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +
    +mkInsertClause :: String -> [String] -> String
    +mkInsertClause tblName columnNames = mkInsertManyClause tblName columnNames 1
    +
    +mkInsertManyClause :: String -> [String] -> Int -> String
    +mkInsertManyClause tblName columnNames recordCount =
    +  mkInsertIntoClause tblName columnNames ++ " VALUES " ++ placeholders
    +  where
    +    placeholder = "(" ++ (List.intercalate "," $ map (const "?") columnNames) ++ ")"
    +    placeholders = List.intercalate "," $ replicate recordCount placeholder
    +
    +mkInsertIntoClause :: String -> [String] -> String
    +mkInsertIntoClause tblName columnNames =
    +  "INSERT INTO " ++
    +  escapedName tblName ++ " (" ++ columns ++ ")"
    +  where
    +    escapedColumnNames = rawExprToSql . generateSql . NameForm Nothing <$> columnNames
    +    columns = List.intercalate "," $ escapedColumnNames
    +
    +mkUpdateClause :: String -> [String] -> String
    +mkUpdateClause tblName columnNames =
    +  "UPDATE " ++ escapedName tblName ++ " SET " ++ placeholders
    +  where
    +    escapedColumnNames = rawExprToSql . generateSql . NameForm Nothing <$> columnNames
    +    placeholders = List.intercalate "," $ map columnUpdateSql escapedColumnNames
    +    columnUpdateSql column = column ++ " = ?"
    +
    +mkDeleteClause :: String -> String
    +mkDeleteClause tblName = "DELETE FROM " ++ escapedName tblName
    +
    +escapedName :: String -> String
    +escapedName name = concat ["\"", name, "\""]
    +-- If you came here looking for mkSelectClause, check out
    +-- Database.Orville.PostgreSQL.Internal.Select
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html new file mode 100644 index 0000000..1743f8b --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.SqlType.html @@ -0,0 +1,427 @@ +
    module Database.Orville.PostgreSQL.Internal.SqlType
    +  ( SqlType(..)
    +  , RowDataErrorReason(..)
    +  , serial
    +  , bigserial
    +  , text
    +  , unboundedText
    +  , varText
    +  , integer
    +  , bigInteger
    +  , double
    +  , boolean
    +  , date
    +  , timestamp
    +  , textSearchVector
    +  , foreignRefType
    +  , convertSqlType
    +  , maybeConvertSqlType
    +  , eitherConvertSqlType
    +  , showSqlValueType
    +  ) where
    +
    +import Control.Monad ((<=<))
    +import qualified Data.Int as Int
    +import qualified Data.Text as T
    +import qualified Data.Text.Encoding as Enc
    +import qualified Data.Time as Time
    +import Data.Typeable
    +import qualified Database.HDBC as HDBC
    +
    +{-|
    +  SqlType defines the mapping of a Haskell type (`a`) to a SQL column type in the
    +  database. This includes both how to convert the type to and from the raw values
    +  read from the database as well as the schema information required to create
    +  and migrate columns using the type.
    +  -}
    +data SqlType a = SqlType
    +  { sqlTypeDDL :: String
    +    -- ^ The raw SQL DDL to use when creating/migrating columns of this type
    +    -- (not including any NULL or NOT NULL declarations)
    +  , sqlTypeReferenceDDL :: Maybe String
    +    -- ^ The raw SQL DDL to use when creating/migrating columns with foreign
    +    -- keys to this type. This is used foreignRefType to build a new SqlType
    +    -- when making foreign key fields
    +  , sqlTypeId :: HDBC.SqlTypeId
    +    -- ^ 'sqlTypeId' will be compared to the 'colType' field found in the
    +    -- 'HDBC.SqlColDesc' return by 'describeTable' when determining whether
    +    -- a column type change is required when migrating the database.
    +  , sqlTypeSqlSize :: Maybe Int
    +    -- ^ 'sqlTypeSqlSize will be compared to the 'colSize' field found in the
    +    -- 'HDBC.SqlColDesc' return by 'describeTable' when determining whether
    +    -- a column type change is required when migrating the database.
    +  , sqlTypeToSql :: a -> HDBC.SqlValue
    +    -- ^ A function for converting Haskell values of this type into values to
    +    -- be stored in the database.
    +  , sqlTypeFromSql :: HDBC.SqlValue -> Either RowDataErrorReason a
    +    -- ^ A function for converting values of this are stored in the database
    +    -- into Haskell values. This function should return 'Left
    +    -- RowDataErrorReason' to indicate an error if the conversion is
    +    -- impossible. Otherwise it should return 'Right' the corresponding @a@
    +    -- value.
    +  }
    +
    +{-|
    +  'serial' defines a 32-bit auto-incrementing column type. This corresponds to
    +  the "SERIAL" type in PostgreSQL.
    +  -}
    +serial :: SqlType Int.Int32
    +serial =
    +  SqlType
    +    { sqlTypeDDL = "SERIAL"
    +    , sqlTypeReferenceDDL = Just "INTEGER"
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 4
    +    , sqlTypeToSql = int32ToSql
    +    , sqlTypeFromSql = int32FromSql
    +    }
    +
    +{-|
    +  'bigserial' defines a 64-bit auto-incrementing column type. This corresponds to
    +  the "BIGSERIAL" type in PostgresSQL.
    +  -}
    +bigserial :: SqlType Int.Int64
    +bigserial =
    +  SqlType
    +    { sqlTypeDDL = "BIGSERIAL"
    +    , sqlTypeReferenceDDL = Just "BIGINT"
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = int64ToSql
    +    , sqlTypeFromSql = int64FromSql
    +    }
    +
    +{-|
    +  'text' defines a fixed length text field type. This corresponds to a
    +  "CHAR(len)" type in SQL.
    +  -}
    +text :: Int -> SqlType T.Text
    +text len =
    +  SqlType
    +    { sqlTypeDDL = concat ["CHAR(", show len, ")"]
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlCharT
    +    , sqlTypeSqlSize = Just len
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +{-|
    +  'varText' defines a variable text field type with a max length. This
    +  corresponds to a "VARCHAR(len)" type in SQL.
    +  -}
    +varText :: Int -> SqlType T.Text
    +varText len =
    +  SqlType
    +    { sqlTypeDDL = concat ["VARCHAR(", show len, ")"]
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlVarCharT
    +    , sqlTypeSqlSize = Just len
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +{-|
    +  'unboundedText' defines a fixed length text field type. This corresponds to a
    +  "TEXT" type in PostgreSQL.
    +  -}
    +unboundedText :: SqlType T.Text
    +unboundedText =
    +  SqlType
    +    { sqlTypeDDL = concat ["TEXT"]
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlVarCharT
    +    , sqlTypeSqlSize = Nothing
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +
    +{-|
    +  'integer' defines a 32-bit integer type. This corresponds to the "INTEGER" type in SQL.
    +  -}
    +integer :: SqlType Int.Int32
    +integer =
    +  SqlType
    +    { sqlTypeDDL = "INTEGER"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 4
    +    , sqlTypeToSql = int32ToSql
    +    , sqlTypeFromSql = int32FromSql
    +    }
    +
    +{-|
    +  'bigInteger' defines a 64-bit integer type. This corresponds to the "BIGINT"
    +  type in SQL.
    +  -}
    +bigInteger :: SqlType Int.Int64
    +bigInteger =
    +  SqlType
    +    { sqlTypeDDL = "BIGINT"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlBigIntT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = int64ToSql
    +    , sqlTypeFromSql = int64FromSql
    +    }
    +
    +{-|
    +  'double' defines a floating point numeric type. This corresponds to the "DOUBLE
    +  PRECISION" type in SQL.
    +  -}
    +double :: SqlType Double
    +double =
    +  SqlType
    +    { sqlTypeDDL = "DOUBLE PRECISION"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlFloatT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = doubleToSql
    +    , sqlTypeFromSql = doubleFromSql
    +    }
    +
    +{-|
    +  'boolean' defines a True/False boolean type. This corresponds to the "BOOLEAN"
    +  type in SQL.
    +  -}
    +boolean :: SqlType Bool
    +boolean =
    +  SqlType
    +    { sqlTypeDDL = "BOOLEAN"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlBitT
    +    , sqlTypeSqlSize = Just 1
    +    , sqlTypeToSql = booleanToSql
    +    , sqlTypeFromSql = booleanFromSql
    +    }
    +
    +{-|
    +  'date' defines a type representing a calendar date (without time zone). It corresponds
    +  to the "DATE" type in SQL.
    +  -}
    +date :: SqlType Time.Day
    +date =
    +  SqlType
    +    { sqlTypeDDL = "DATE"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlDateT
    +    , sqlTypeSqlSize = Just 4
    +    , sqlTypeToSql = dayToSql
    +    , sqlTypeFromSql = dayFromSql
    +    }
    +
    +{-|
    +  'timestamp' defines a type representing a particular point in time (without time zone).
    +  It corresponds to the "TIMESTAMP with time zone" type in SQL.
    +
    +  Note: This is NOT a typo. The "TIMESTAMP with time zone" type in SQL does not include
    +  any actual time zone information. For an excellent explanation of the complexities
    +  involving this type, please see Chris Clark's blog post about it:
    +  http://blog.untrod.com/2016/08/actually-understanding-timezones-in-postgresql.html
    +  -}
    +timestamp :: SqlType Time.UTCTime
    +timestamp =
    +  SqlType
    +    { sqlTypeDDL = "TIMESTAMP with time zone"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlTimestampWithZoneT
    +    , sqlTypeSqlSize = Just 8
    +    , sqlTypeToSql = utcTimeToSql
    +    , sqlTypeFromSql = utcTimeFromSql
    +    }
    +
    +{-|
    +  'textSearchVector' defines a type for indexed text searching. It corresponds to the
    +  "TSVECTOR" type in PostgreSQL.
    +  -}
    +textSearchVector :: SqlType T.Text
    +textSearchVector =
    +  SqlType
    +    { sqlTypeDDL = "TSVECTOR"
    +    , sqlTypeReferenceDDL = Nothing
    +    , sqlTypeId = HDBC.SqlUnknownT "3614"
    +    , sqlTypeSqlSize = Nothing
    +    , sqlTypeToSql = textToSql
    +    , sqlTypeFromSql = textFromSql
    +    }
    +
    +{-|
    +  'foreignRefType' creates a 'SqlType' suitable for columns will be foreign
    +  keys referencing a column of the given 'SqlType'. For most types the
    +  underlying sql type with be identical, but for special types (such as
    +  autoincrementing primary keys), the type construted by 'foreignRefType' with
    +  have regular underlying sql type. Each 'SqlType' definition must specify any
    +  special handling required when creating foreign reference types by setting
    +  the 'sqlTypeReferenceDDL' field to an appropriate value.
    +  -}
    +foreignRefType :: SqlType a -> SqlType a
    +foreignRefType sqlType =
    +  case sqlTypeReferenceDDL sqlType of
    +    Nothing -> sqlType
    +    Just refDDL -> sqlType {sqlTypeDDL = refDDL, sqlTypeReferenceDDL = Nothing}
    +
    +{-|
    +  Migration Guide: @maybeConvertSqlType@ has been replaced with
    +  @tryConvertSqlType@, which allows an error message to be returned when
    +  conversion fails.
    +
    +  'maybeConvertSqlType' changes the Haskell type used by a 'SqlType' without
    +  changing the column type that will be used in the database schema. The
    +  functions given will be used to convert the now Haskell type to and from the
    +  original type when reading and writing values from the database. When reading
    +  an @a@ value from the database, the conversion function should produce
    +  'Nothing' if the value cannot be successfully converted to a @b@.
    +  -}
    +maybeConvertSqlType :: (b -> a) -> (a -> Maybe b) -> SqlType a -> SqlType b
    +maybeConvertSqlType bToA aToB =
    +  eitherConvertSqlType bToA
    +    $ maybe (Left $ DecodingFailure "SqlType conversion failed") Right . aToB
    +
    +{-|
    +  'eitherConvertSqlType' changes the Haskell type used by a 'SqlType' without
    +  changing the column type that will be used in the database schema. The
    +  functions given will be used to convert the new Haskell type to and from the
    +  original type when reading and writing values from the database. When reading
    +  an @a@ value from the database, the conversion function should produce
    +  @Left "reason"@ if the value cannot be successfully converted to a @b@.
    +-}
    +eitherConvertSqlType :: (b -> a) -> (a -> Either RowDataErrorReason b) -> SqlType a -> SqlType b
    +eitherConvertSqlType bToA aToB sqlType =
    +  sqlType
    +    { sqlTypeToSql = sqlTypeToSql sqlType . bToA
    +    , sqlTypeFromSql = aToB <=< sqlTypeFromSql sqlType
    +    }
    +
    +{-|
    +  Migration Guide: @convertSqlType@ retains the same name
    +
    +  'convertSqlType' changes the Haskell type used by a 'SqlType' in the same manner
    +  as 'maybeConvertSqlType' in cases where an 'a' can always be converted to a 'b'.
    +  -}
    +convertSqlType :: (b -> a) -> (a -> b) -> SqlType a -> SqlType b
    +convertSqlType bToA aToB = maybeConvertSqlType bToA (Just . aToB)
    +
    +int32ToSql :: Int.Int32 -> HDBC.SqlValue
    +int32ToSql = HDBC.SqlInt32
    +
    +int32FromSql :: HDBC.SqlValue -> Either RowDataErrorReason Int.Int32
    +int32FromSql sql =
    +  case sql of
    +    HDBC.SqlInt32 n -> Right n
    +    HDBC.SqlInteger n -> toBoundedInteger n
    +    sqlValue -> Left $ mismatchError "int32" sqlValue
    +
    +int64ToSql :: Int.Int64 -> HDBC.SqlValue
    +int64ToSql = HDBC.SqlInt64
    +
    +int64FromSql :: HDBC.SqlValue -> Either RowDataErrorReason Int.Int64
    +int64FromSql sql =
    +  case sql of
    +    HDBC.SqlInt64 n -> Right n
    +    HDBC.SqlInteger n -> toBoundedInteger n
    +    sqlValue -> Left $ mismatchError "int64" sqlValue
    +
    +textToSql :: T.Text -> HDBC.SqlValue
    +textToSql = HDBC.SqlByteString . Enc.encodeUtf8
    +
    +textFromSql :: HDBC.SqlValue -> Either RowDataErrorReason T.Text
    +textFromSql sql =
    +  case sql of
    +    HDBC.SqlByteString bytes -> Right $ Enc.decodeUtf8 bytes
    +    HDBC.SqlString string -> Right $ T.pack string
    +    sqlValue -> Left $ mismatchError "text" sqlValue
    +
    +doubleToSql :: Double -> HDBC.SqlValue
    +doubleToSql = HDBC.SqlDouble
    +
    +doubleFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Double
    +doubleFromSql sql =
    +  case sql of
    +    HDBC.SqlDouble d -> Right d
    +    sqlValue -> Left $ mismatchError "double" sqlValue
    +
    +booleanToSql :: Bool -> HDBC.SqlValue
    +booleanToSql = HDBC.SqlBool
    +
    +booleanFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Bool
    +booleanFromSql sql =
    +  case sql of
    +    HDBC.SqlBool b -> Right b
    +    sqlValue -> Left $ mismatchError "boolean" sqlValue
    +
    +dayToSql :: Time.Day -> HDBC.SqlValue
    +dayToSql = HDBC.SqlLocalDate
    +
    +dayFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Time.Day
    +dayFromSql sql =
    +  case sql of
    +    HDBC.SqlLocalDate d -> Right d
    +    sqlValue -> Left $ mismatchError "day" sqlValue
    +
    +utcTimeToSql :: Time.UTCTime -> HDBC.SqlValue
    +utcTimeToSql = HDBC.SqlUTCTime
    +
    +utcTimeFromSql :: HDBC.SqlValue -> Either RowDataErrorReason Time.UTCTime
    +utcTimeFromSql sql =
    +  case sql of
    +    HDBC.SqlUTCTime   t -> Right t
    +    HDBC.SqlZonedTime t -> Right (Time.zonedTimeToUTC t)
    +    sqlValue -> Left $ mismatchError "UTC time" sqlValue
    +
    +toBoundedInteger :: (Bounded num, Integral num) => Integer -> Either RowDataErrorReason num
    +toBoundedInteger source =
    +  let truncated = fromInteger source
    +      upper = toInteger (maxBound `asTypeOf` truncated)
    +      lower = toInteger (minBound `asTypeOf` truncated)
    +   in if lower <= source && source <= upper
    +        then Right truncated
    +        else Left $ IntegralOutOfBounds lower upper source
    +
    +-- | Error text for when the expected type doesn't match the Sql type
    +mismatchError :: String -> HDBC.SqlValue -> RowDataErrorReason
    +mismatchError expected actual =
    +  TypeMismatch expected (showSqlValueType actual)
    +
    +-- | User friendly identifier labels for 'SqlValues'
    +showSqlValueType :: HDBC.SqlValue -> String
    +showSqlValueType v =
    +  case v of
    +    HDBC.SqlString _ -> "string"
    +    HDBC.SqlByteString _ -> "bytestring"
    +    HDBC.SqlWord32 _ -> "word32"
    +    HDBC.SqlWord64 _ -> "word64"
    +    HDBC.SqlInt32 _ -> "int32"
    +    HDBC.SqlInt64 _ -> "int64"
    +    HDBC.SqlInteger _ -> "integer"
    +    HDBC.SqlChar _ -> "char"
    +    HDBC.SqlBool _ -> "bool"
    +    HDBC.SqlDouble _ -> "double"
    +    HDBC.SqlRational _ -> "rational"
    +    HDBC.SqlLocalDate _ -> "local date"
    +    HDBC.SqlLocalTimeOfDay _ -> "time of day"
    +    HDBC.SqlZonedLocalTimeOfDay _ _ -> "zoned local time of day"
    +    HDBC.SqlLocalTime _ -> "local time"
    +    HDBC.SqlZonedTime _ -> "zoned time"
    +    HDBC.SqlUTCTime _ -> "utc time"
    +    HDBC.SqlDiffTime _ -> "diff time"
    +    HDBC.SqlPOSIXTime _ -> "POSIX time"
    +    HDBC.SqlEpochTime _ -> "epoch time"
    +    HDBC.SqlTimeDiff _ -> "time diff"
    +    HDBC.SqlNull -> "null"
    +
    +data RowDataErrorReason
    +  = TypeMismatch
    +  -- ^ Sql value has a different type than expected
    +      !String -- ^ Actual type
    +      !String -- ^ Expected type
    +  | IntegralOutOfBounds
    +  -- ^ An integer value was outside the expected bounds.
    +      !Integer -- ^ Lower bound
    +      !Integer -- ^ Upper bound
    +      !Integer -- ^ Actual value
    +  | DecodingFailure !String
    +  -- ^ Generic decoding failure
    +  deriving Typeable
    +
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html new file mode 100644 index 0000000..9c298ee --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.TableDefinition.html @@ -0,0 +1,28 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.TableDefinition
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Internal.TableDefinition where
    +
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +tableColumnNames :: TableDefinition readEntity writeEntity key -> [String]
    +tableColumnNames = map someFieldName . tableFields
    +  where
    +    someFieldName (SomeField f) = fieldName f
    +
    +tableAssignableFields ::
    +     TableDefinition readEntity writeEntity key -> [SomeField]
    +tableAssignableFields =
    +  filter (not . isSomeAssignedByDatabaseField) . tableFields
    +  where
    +    isSomeAssignedByDatabaseField (SomeField f) = isAssignedByDatabaseField f
    +
    +tableAssignableColumnNames ::
    +     TableDefinition readEntity writeEntity key -> [String]
    +tableAssignableColumnNames = map someFieldName . tableAssignableFields
    +  where
    +    someFieldName (SomeField f) = fieldName f
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html new file mode 100644 index 0000000..3a74063 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Trigger.html @@ -0,0 +1,270 @@ +
    {-# LANGUAGE CPP #-}
    +{-# LANGUAGE FunctionalDependencies #-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE TypeFamilies #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Trigger where
    +
    +import Control.Applicative (Alternative)
    +import Control.Monad (MonadPlus)
    +import Control.Monad.Base (MonadBase)
    +import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow)
    +import Control.Monad.Except (MonadError(..))
    +import Control.Monad.IO.Class (MonadIO(liftIO))
    +import Control.Monad.Reader (ReaderT, ask, mapReaderT, runReaderT)
    +import Control.Monad.Trans (MonadTrans(lift))
    +import qualified Data.DList as DList
    +import Data.IORef
    +  ( IORef
    +  , atomicModifyIORef'
    +  , atomicWriteIORef
    +  , newIORef
    +  , readIORef
    +  )
    +import Data.Monoid ((<>))
    +import Data.Pool (Pool)
    +import qualified Database.HDBC as HDBC
    +import qualified Database.Orville.PostgreSQL as O
    +
    +#if MIN_VERSION_base(4,11,0)
    +import Control.Monad.Fail (MonadFail)
    +#endif
    +
    +class MonadTrigger trigger m | m -> trigger where
    +  runTriggers :: [trigger] -> m ()
    +
    +class InsertTrigger trigger readEntity where
    +  insertTriggers :: readEntity -> [trigger]
    +
    +class UpdateTrigger trigger readEntity writeEntity where
    +  updateTriggers :: readEntity -> writeEntity -> [trigger]
    +
    +class DeleteTrigger trigger readEntity where
    +  deleteTriggers :: readEntity -> [trigger]
    +
    +insertTriggered ::
    +     ( MonadThrow m
    +     , O.MonadOrville conn m
    +     , MonadTrigger trigger m
    +     , InsertTrigger trigger readEntity
    +     )
    +  => O.TableDefinition readEntity writeEntity key
    +  -> writeEntity
    +  -> m readEntity
    +insertTriggered tableDef writeEntity = do
    +  readEntity <- O.insertRecord tableDef writeEntity
    +  runTriggers $ insertTriggers readEntity
    +  pure readEntity
    +
    +updateTriggered ::
    +     ( MonadThrow m
    +     , O.MonadOrville conn m
    +     , MonadTrigger trigger m
    +     , UpdateTrigger trigger readEntity writeEntity
    +     )
    +  => O.TableDefinition readEntity writeEntity key
    +  -> readEntity
    +  -> writeEntity
    +  -> m ()
    +updateTriggered tableDef oldEntity newEntity = do
    +  O.updateRecord tableDef (O.tableGetKey tableDef oldEntity) newEntity
    +  runTriggers $ updateTriggers oldEntity newEntity
    +
    +deleteTriggered ::
    +     ( MonadThrow m
    +     , O.MonadOrville conn m
    +     , MonadTrigger trigger m
    +     , DeleteTrigger trigger readEntity
    +     )
    +  => O.TableDefinition readEntity writeEntity key
    +  -> readEntity
    +  -> m ()
    +deleteTriggered tableDef readEntity = do
    +  O.deleteRecord tableDef (O.tableGetKey tableDef readEntity)
    +  runTriggers $ deleteTriggers readEntity
    +
    +type RecordedTriggersRef trigger = IORef (RecordedTriggers trigger)
    +
    +data RecordedTriggers trigger = RecordedTriggers
    +  { committedTriggersDList :: DList.DList trigger
    +  , uncommittedTriggersDList :: Maybe (DList.DList trigger)
    +  }
    +
    +committedTriggers :: RecordedTriggers trigger -> [trigger]
    +committedTriggers = DList.toList . committedTriggersDList
    +
    +uncommittedTriggers :: RecordedTriggers trigger -> Maybe [trigger]
    +uncommittedTriggers = fmap DList.toList . uncommittedTriggersDList
    +
    +emptyTriggerData :: RecordedTriggers trigger
    +emptyTriggerData = RecordedTriggers mempty mempty
    +
    +atomicModifyIORef'_ :: IORef a -> (a -> a) -> IO ()
    +atomicModifyIORef'_ ref f = atomicModifyIORef' ref (\a -> (f a, ()))
    +
    +recordTriggers :: RecordedTriggersRef trigger -> [trigger] -> IO ()
    +recordTriggers ref triggers =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    case uncommittedTriggersDList recorded of
    +      Just uncommitted ->
    +        recorded
    +          { uncommittedTriggersDList =
    +              Just (uncommitted <> DList.fromList triggers)
    +          }
    +      Nothing ->
    +        recorded
    +          { committedTriggersDList =
    +              committedTriggersDList recorded <> DList.fromList triggers
    +          }
    +
    +startTriggerTxn :: RecordedTriggersRef trigger -> IO ()
    +startTriggerTxn ref =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    case uncommittedTriggers recorded of
    +      Just _ -> recorded
    +      Nothing -> recorded {uncommittedTriggersDList = Just DList.empty}
    +
    +commitTriggerTxn :: RecordedTriggersRef trigger -> IO ()
    +commitTriggerTxn ref =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    case uncommittedTriggersDList recorded of
    +      Just uncommitted ->
    +        recorded
    +          { uncommittedTriggersDList = Nothing
    +          , committedTriggersDList =
    +              committedTriggersDList recorded <> uncommitted
    +          }
    +      Nothing -> recorded
    +
    +rollbackTriggerTxn :: RecordedTriggersRef trigger -> IO ()
    +rollbackTriggerTxn ref =
    +  atomicModifyIORef'_ ref $ \recorded ->
    +    recorded {uncommittedTriggersDList = Nothing}
    +
    +newtype OrvilleTriggerT trigger conn m a = OrvilleTriggerT
    +  { unTriggerT :: ReaderT (RecordedTriggersRef trigger) (O.OrvilleT conn m) a
    +  } deriving ( Functor
    +             , Alternative
    +             , Applicative
    +             , Monad
    +             , MonadIO
    +             , MonadBase b
    +             , MonadThrow
    +             , MonadCatch
    +             , MonadMask
    +             , MonadPlus
    +#if MIN_VERSION_base (4,11,0)
    +             , MonadFail
    +#endif
    +             )
    +
    +instance MonadTrans (OrvilleTriggerT trigger conn) where
    +  lift = OrvilleTriggerT . lift . lift
    +
    +instance (MonadError e m) =>
    +         MonadError e (OrvilleTriggerT trigger conn m) where
    +  throwError = lift . throwError
    +  catchError action handler =
    +    OrvilleTriggerT ((unTriggerT action) `catchError` (unTriggerT . handler))
    +
    +instance (Monad m, HDBC.IConnection conn) =>
    +         O.HasOrvilleContext conn (OrvilleTriggerT trigger conn m) where
    +  getOrvilleEnv = OrvilleTriggerT $ lift O.getOrvilleEnv
    +  localOrvilleEnv f =
    +    OrvilleTriggerT . mapReaderT (O.localOrvilleEnv f) . unTriggerT
    +
    +instance MonadIO m =>
    +         MonadTrigger trigger (OrvilleTriggerT trigger conn m) where
    +  runTriggers triggers =
    +    OrvilleTriggerT $ do
    +      recordedTriggers <- ask
    +      liftIO $ recordTriggers recordedTriggers triggers
    +
    +instance (Monad m, O.MonadOrvilleControl m) =>
    +         O.MonadOrvilleControl (OrvilleTriggerT trigger conn m) where
    +  liftWithConnection = O.defaultLiftWithConnection OrvilleTriggerT unTriggerT
    +  liftFinally = O.defaultLiftFinally OrvilleTriggerT unTriggerT
    +
    +instance ( Monad m
    +         , MonadThrow m
    +         , MonadIO m
    +         , HDBC.IConnection conn
    +         , O.MonadOrvilleControl m
    +#if MIN_VERSION_base (4,11,0)
    +         , MonadFail m
    +#endif
    +         ) =>
    +         O.MonadOrville conn (OrvilleTriggerT trigger conn m)
    +
    +{-
    +   `askTriggers` retrieves triggers that have been recorded thus far. If you
    +   do not want to see the triggers returned again from future calls, you should
    +   use `clearTriggers` as well.
    + -}
    +askTriggers ::
    +     MonadIO m => OrvilleTriggerT trigger conn m (RecordedTriggers trigger)
    +askTriggers =
    +  OrvilleTriggerT $ do
    +    recordedTriggers <- ask
    +    liftIO $ readIORef recordedTriggers
    +
    +{-
    +   `clearTriggers` clears out the trigger list. This is useful if you have
    +   processed the trigger list and don't want to see those triggers again.
    + -}
    +clearTriggers :: MonadIO m => OrvilleTriggerT trigger conn m ()
    +clearTriggers =
    +  OrvilleTriggerT $ do
    +    recordedTriggers <- ask
    +    liftIO $ atomicWriteIORef recordedTriggers emptyTriggerData
    +
    +{-
    +   `runOrvilleTriggerT` runs an Orville actions that has triggering behavior and
    +   returns the triggers that were committed. Note there there will never be any
    +   *uncommitted* triggers at the end because any `withTransaction` block must
    +   by contained *within* the action passed  to `runOrvilleTriggerT`. If you
    +   layer `OrvilleTriggerT` on top of a Monad `m` that *also* allows for database
    +   connection activity, god rest your soul.
    +
    +   Note that if an exception occurs in `m` and is not caught within the action passed
    +   to `runOrvilleTriggerT`, you will lose any triggers that may have happened up to
    +   the point of the action, including those related to database operations that were
    +   successfully committed. If you wish to respond to those triggers, you need to perform
    +   some Exception handling inside the action given to `runOrvilleTriggerT` and use
    +   `askTriggers` to retrieve the triggers inside the exception handler.
    + -}
    +runOrvilleTriggerT ::
    +     (MonadIO m)
    +  => OrvilleTriggerT trigger conn m a
    +  -> Pool conn
    +  -> m (a, [trigger])
    +runOrvilleTriggerT triggerT pool = do
    +  ref <- liftIO $ newIORef emptyTriggerData
    +  let orvilleT = runReaderT (unTriggerT triggerT) ref
    +      orvilleEnv =
    +        O.addTransactionCallBack (trackTransactions ref) (O.newOrvilleEnv pool)
    +  a <- O.runOrville orvilleT orvilleEnv
    +  triggers <- committedTriggers <$> liftIO (readIORef ref)
    +  pure (a, triggers)
    +
    +mapOrvilleTriggerT :: Monad n
    +                   => (m a -> n b)
    +                   -> OrvilleTriggerT trigger conn m a
    +                   -> OrvilleTriggerT trigger conn n b
    +mapOrvilleTriggerT f triggerT =
    +  OrvilleTriggerT $
    +    mapReaderT (O.mapOrvilleT f) $
    +      unTriggerT triggerT
    +
    +liftOrville :: Monad m => O.OrvilleT conn m a -> OrvilleTriggerT trigger conn m a
    +liftOrville = OrvilleTriggerT . lift
    +
    +trackTransactions :: RecordedTriggersRef trigger -> O.TransactionEvent -> IO ()
    +trackTransactions recorded event =
    +  case event of
    +    O.TransactionStart -> startTriggerTxn recorded
    +    O.TransactionCommit -> commitTriggerTxn recorded
    +    O.TransactionRollback -> rollbackTriggerTxn recorded
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html new file mode 100644 index 0000000..481c923 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Types.html @@ -0,0 +1,430 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Types
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE DeriveDataTypeable #-}
    +{-# LANGUAGE ExistentialQuantification #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE GADTs #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Types where
    +
    +import Control.Exception
    +import Control.Monad (join)
    +import Control.Monad.Except
    +import Control.Monad.Reader
    +import Control.Monad.State
    +import Control.Monad.Writer
    +import qualified Data.Char as Char
    +import qualified Data.List as List
    +import Data.Typeable
    +import Database.HDBC
    +
    +import qualified Data.Time as Time
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.SqlType
    +
    +{- |
    +  Migration Guide: @Record@ has been removed. It's recommended that you
    +  create a separate record key type for each of your entities instead.
    +-}
    +type Record = Int
    +
    +type CreatedAt = Time.UTCTime
    +
    +type UpdatedAt = Time.UTCTime
    +
    +type OccurredAt = Time.UTCTime
    +
    +{- |
    +  Migration Guide: @ColumnFlag@ has been removed. Depending on flag constructor
    +  there may or may not be a replacement.
    +
    +  @ColumnDefault@ - replaced by the @setDefaultValue@ function in new orville
    +  @Unique@ - replaced by the @addUniqueConstraint@ function in new orville
    +  @References@ - replaced by the @addForeignKeyConstraint@ function in new orville
    +  @ColumnDescription@ - removed
    +  @AssignedByDatabase@ - removed, though many cases are handled by @marshallReadOnlyField@
    +
    +-}
    +data ColumnFlag
    +  = forall a. ColumnDefault a => Default a
    +  | Unique
    +  | forall readEntity writeEntity key nullability. References (TableDefinition readEntity writeEntity key)
    +                                                              (FieldDefinition nullability key)
    +  | ColumnDescription String
    +  | AssignedByDatabase
    +
    +class ColumnDefault a where
    +  toColumnDefaultSql :: a -> String
    +
    +data Now =
    +  Now
    +
    +instance ColumnDefault [Char] where
    +  toColumnDefaultSql s = "'" ++ s ++ "'"
    +
    +instance ColumnDefault Now where
    +  toColumnDefaultSql _ = "(now() at time zone 'utc')"
    +
    +instance ColumnDefault Integer where
    +  toColumnDefaultSql val = show val
    +
    +instance ColumnDefault Bool where
    +  toColumnDefaultSql True = "true"
    +  toColumnDefaultSql False = "false"
    +
    +-- | 'Nullable' is a values-less type used to track that a 'FieldDefinition'
    +-- represents a field that is marked nullable in the database schema. See the
    +-- 'Nullability' type for the value-level representation of field nullability.
    +data Nullable
    +
    +-- | 'NotNull is a values-less type used to track that a 'FieldDefinition'
    +-- represents a field that is marked not-null in the database schema.  See the
    +-- 'Nullability' type for the value-level representation of field nullability.
    +data NotNull
    +
    +-- | 'Nullability' represents whether a field will be marked as 'NULL' or 'NOT
    +-- NULL' in the database schema. It is a GADT so that the value constructors
    +-- can be used to record this knowledge in the type system as well. This allows
    +-- functions that work only on 'Nullable' or 'NotNull' fields to indicate this
    +-- in their type signatures as appropriate.
    +data Nullability nullability where
    +  Nullable :: Nullability Nullable
    +  NotNull  :: Nullability NotNull
    +
    +-- | A 'NullabilityCheck' is returned by the 'checkNullability' function, which
    +-- can be used when a function works on both 'Nullable' and 'NotNull' functions
    +-- but needs to deal with each type of field separately. It adds wrapper
    +-- constructors around the 'FieldDefinition' that you can pattern match on to
    +-- then work with a concrete 'Nullable' or 'NotNull' field.
    +data NullabilityCheck a
    +  = NullableField (FieldDefinition Nullable a)
    +  | NotNullField (FieldDefinition NotNull a)
    +
    +-- | Resolves the 'nullablity' of a field to a concrete type based on its
    +-- 'fieldNullability'. You can do this directly by pattern matching on the
    +-- value of 'fieldNullability' if you have the GADTs extension turned on, but
    +-- this function will do that for you so you don't need to turn GADTs on.
    +checkNullability :: FieldDefinition nullability a -> NullabilityCheck a
    +checkNullability field =
    +  case fieldNullability field of
    +    Nullable -> NullableField field
    +    NotNull  -> NotNullField field
    +
    +{- |
    +  Migration Guide: The signature of the @FieldDefinition@ type has not changed,
    +  but many of the constructors and accessors have. See the migration guides
    +  on individual functions for more info.
    +-}
    +data FieldDefinition nullability a =
    +  FieldDefinition
    +    { fieldName        :: String
    +    , fieldType        :: SqlType a
    +    , fieldFlags       :: [ColumnFlag] -- ^ @fieldFlags@ has been removed. See the new @fieldDefaultValue@ and @fieldTableConstraints@ functions
    +    , fieldNullability :: Nullability nullability
    +    }
    +
    +data SomeField =
    +  forall nullability a.
    +    SomeField (FieldDefinition nullability a)
    +
    +instance QueryKeyable (FieldDefinition nullability a) where
    +  queryKey field = QKField $ fieldName field
    +
    +data FieldUpdate = FieldUpdate
    +  { fieldUpdateField :: SomeField
    +  , fieldUpdateValue :: SqlValue
    +  }
    +
    +data TableComment = TableComment
    +  { tcWhat :: String
    +  , tcWhen :: (Int, Int, Int)
    +  , tcWho :: String
    +  }
    +
    +newtype TableComments a =
    +  TableComments (Writer [TableComment] a)
    +  deriving (Functor, Applicative, Monad)
    +
    +runComments :: TableComments a -> [TableComment]
    +runComments (TableComments commenter) = snd (runWriter commenter)
    +
    +noComments :: TableComments ()
    +noComments = return ()
    +
    +say :: String -> (Int, Int, Int) -> String -> TableComments ()
    +say msg msgDate commenter =
    +  TableComments $ writer ((), [TableComment msg msgDate commenter])
    +
    +data FromSqlError
    +  = RowDataError !RowDataErrorDetails
    +    -- ^ Captures a failure in the translation of a SQL value from a particular
    +    -- field to it's corresponding Haskell values.
    +  | MissingColumn !MissingColumnDetails
    +    -- ^ An expected column was not returned by the database
    +  | ConversionError !ConversionErrorDetails
    +    -- ^ A conversion between haskell representations failed at a point where
    +    -- we don't know what column the value came from. This is the case when
    +    -- using the 'partialMap' combinator.
    +  deriving Typeable
    +
    +instance Show FromSqlError where
    +  show = showFromSqlErrorMinimal
    +
    +data RowDataErrorDetails =
    +  RowDataErrorDetails
    +    { rowErrorReason :: !RowDataErrorReason
    +    , rowErrorColumnName :: !String
    +    -- ^ Column name for the erroneous value
    +    , rowErrorPrimaryKeys :: ![(String, SqlValue)]
    +    -- ^ Primary keys. Empty if not known
    +    } deriving Typeable
    +
    +data MissingColumnDetails =
    +  MissingColumnDetails
    +    { missingColumn :: !String
    +    , actualColumns :: ![String]
    +    }
    +
    +data ConversionErrorDetails =
    +  ConversionErrorDetails
    +    { convErrorReason :: !String
    +    , convErrorPrimaryKeys :: ![(String, SqlValue)]
    +    -- ^ Primary key value(s). Empty if not known
    +    }
    +
    +simpleConversionError :: String -> FromSqlError
    +simpleConversionError err =
    +  ConversionError ConversionErrorDetails { convErrorReason = err
    +                                         , convErrorPrimaryKeys = []
    +                                         }
    +
    +-- | Shows the error in a way that should not contain any potentially sensitive
    +-- data. This is used for the 'Show' instance.
    +showFromSqlErrorMinimal :: FromSqlError -> String
    +showFromSqlErrorMinimal err =
    +  case err of
    +    RowDataError details ->
    +      "Error decoding data from column '" <> rowErrorColumnName details <> "'"
    +    MissingColumn details -> showMissingColumnDetails details
    +    ConversionError details -> convErrorReason details
    +
    +-- | Shows the error in a way appropriate for logging within an application.
    +-- The resulting string contains information that is useful for debugging but
    +-- is potentially undesirable to expose outside of the application (such as
    +-- primary key values).
    +showFromSqlErrorForLogging :: FromSqlError -> String
    +showFromSqlErrorForLogging err =
    +  case err of
    +    RowDataError details ->
    +      concat
    +        [ "Error decoding data from column "
    +        , "'" <> rowErrorColumnName details <> "': "
    +        , showReason (rowErrorReason details)
    +        , showPrimaryKey (rowErrorPrimaryKeys details)
    +        ]
    +    MissingColumn details -> showMissingColumnDetails details
    +    ConversionError details ->
    +      convErrorReason details
    +        <> showPrimaryKey (convErrorPrimaryKeys details)
    +  where
    +    showReason reason =
    +      case reason of
    +        TypeMismatch expected actual ->
    +          "expected " <> expected <> " but got " <> actual
    +        IntegralOutOfBounds lower upper actual ->
    +          "expected an integral between " <> show lower
    +          <> " and " <> show upper <> " but got " <> show actual
    +        DecodingFailure failure -> failure
    +
    +    showPrimaryKey [] = ""
    +    showPrimaryKey keyValues = " (" <> keysStr <> ")"
    +      where
    +        keysStr = List.intercalate ", " $ map showKeyValue keyValues
    +        showKeyValue (key, sqlValue) = key <> ": " <> showSqlValue sqlValue
    +        -- removes the data constructor prefix
    +        showSqlValue sqlValue = drop 1 . dropWhile (not . Char.isSpace)
    +                              $ show sqlValue
    +
    +showMissingColumnDetails :: MissingColumnDetails -> String
    +showMissingColumnDetails details =
    +  concat
    +    [ "Column "
    +    , "'" <> missingColumn details <> "' "
    +    , "not found in result set. Actual Columns: "
    +    , "'" <> List.intercalate "', '" (actualColumns details) <> "'"
    +    ]
    +
    +instance Exception FromSqlError
    +
    +data FromSql a = FromSql
    +  { fromSqlSelects :: [SelectForm]
    +  , runFromSql :: [(String, SqlValue)] -> Either FromSqlError a
    +  }
    +
    +instance Functor FromSql where
    +  fmap f fA = fA {runFromSql = \values -> f <$> runFromSql fA values}
    +
    +instance Applicative FromSql where
    +  pure a = FromSql [] (\_ -> pure a)
    +  fF <*> fA =
    +    FromSql
    +      { fromSqlSelects = fromSqlSelects fF ++ fromSqlSelects fA
    +      , runFromSql = \values -> runFromSql fF values <*> runFromSql fA values
    +      }
    +
    +getColumn :: SelectForm -> FromSql SqlValue
    +getColumn selectForm =
    +  FromSql
    +    { fromSqlSelects = [selectForm]
    +    , runFromSql =
    +        \values -> do
    +          let colName = unescapedName $ selectFormOutput selectForm
    +          case lookup colName values of
    +            Just sqlValue -> pure sqlValue
    +            Nothing ->
    +              throwError $
    +              MissingColumn
    +                MissingColumnDetails
    +                  { missingColumn = colName
    +                  , actualColumns = map fst values
    +                  }
    +    }
    +
    +joinFromSqlError :: FromSql (Either FromSqlError a) -> FromSql a
    +joinFromSqlError fE =
    +  fE {runFromSql = \columns -> join $ runFromSql fE columns}
    +
    +newtype ToSql a b = ToSql
    +  { unToSql :: ReaderT a (State [SqlValue]) b
    +  } deriving ( Functor
    +             , Applicative
    +             , Monad
    +             , MonadState [SqlValue]
    +             , MonadReader a
    +             )
    +
    +runToSql :: ToSql a b -> a -> [SqlValue]
    +runToSql tosql a = reverse $ execState (runReaderT (unToSql tosql) a) []
    +
    +getComponent :: (entity -> a) -> ToSql a () -> ToSql entity ()
    +getComponent getComp (ToSql serializer) =
    +  ToSql (withReaderT getComp serializer)
    +
    +{-|
    + Migration Guide: 'TableDefinition' can now be imported from
    + 'Orville.PostgreSQL'. The order of the type parameters has changed from
    + @TableDefinition readEnity writeEntity key@ to @TableDefinition key
    + writeEntity readEntity@. In the new Orville tables without primary keys are
    + supported, so the @key@ parameter must now be instantiated as either @HasKey
    + keyType@ or @NoKey@.
    +
    + A 'TableDefinition' is the center of the Orville universe. A 'TableDefinition'
    + defines the structure of a table in the database and associates it with a Haskell
    + datatype, usually a Haskell record type. The 'TableDefinition' must specify how
    + the Haskell type is converted to and from the database schema, as as well as
    + provide same basic utility functions required by Orville for interacting with
    + the Haskell datatype.
    +
    +  Usually you will use 'TableParams' to construct a 'TableDefinition' in a more
    +  concise way. This type is provided as an escape hatch for any situations where
    +  'TableParams' is too restrictive for the sql mapping required by a type.
    + -}
    +data TableDefinition readEntity writeEntity key = TableDefinition
    +  { tableName :: String
    +      -- ^ The name of the table in the database.
    +  , tableFields :: [SomeField]
    +      -- ^ A list of field definitions defining the table structure
    +  , tableSafeToDelete :: [String]
    +      -- ^ A list of any columns that may be deleted from the table by Orville.
    +      -- (Orville will never delete a column without being told it is safe)
    +  , tablePrimaryKey :: PrimaryKey key
    +      -- ^ The statically typed field definition that is the primary key. Currently
    +      -- this field must still by listed in `tableFields`
    +  , tableFromSql :: FromSql readEntity
    +      -- ^ A definition of how to convert the haskell type from a sql row
    +  , tableToSql :: ToSql writeEntity ()
    +      -- ^ A function to set the key on the entity
    +  , tableGetKey :: readEntity -> key
    +      -- ^ A function to get the key on the entity
    +  , tableComments :: TableComments ()
    +      -- ^ Any comments that might be interesting for developers to see. These
    +      -- comments will get printed in the log if there is an erro while attempting
    +      -- to migrate the table.
    +  }
    +
    +data PrimaryKey key
    +  = PrimaryKey (PrimaryKeyPart key) [PrimaryKeyPart key]
    +
    +data PrimaryKeyPart key =
    +  forall part. PrimaryKeyPart (key -> part) (FieldDefinition NotNull part)
    +
    +instance QueryKeyable (TableDefinition readEntity writeEntity key) where
    +  queryKey = QKTable . tableName
    +
    +{- |
    +  Migration Guide: @SchemaItem@ retains the same name. The @Index@,
    +  @DropIndex@, @Constraint@ and @DropConstraint@ constructors have been
    +  removed. These items are now added to the @TableDefinition@ via
    +  @addTableConstraints@ and @addTableIndexes@. The remaining constructors have
    +  been prefixed with the word @Schema@ (e.g. @Table@ has been renamed to
    +  @SchemaTable@). There is no explicit replacement for @DropIndex@ and
    +  @DropConstraint@. Orville will automatically drop indexes and constraints
    +  that are no longer mentioned on the @TableDefinition@ for any tables that it
    +  migrates.
    +-}
    +data SchemaItem
    +  = forall readEntity writeEntity key. Table (TableDefinition readEntity writeEntity key)
    +  | DropTable String
    +  | Index IndexDefinition
    +  | DropIndex String
    +  | Constraint ConstraintDefinition
    +  | DropConstraint String
    +                   String
    +  | Sequence SequenceDefinition
    +  | DropSequence String
    +
    +instance Show SchemaItem where
    +  show (Table tableDef) = "Table <" ++ tableName tableDef ++ " definition>"
    +  show (DropTable name) = "DropTable " ++ show name
    +  show (Index indexDef) = "Index (" ++ show indexDef ++ ")"
    +  show (DropIndex name) = "DropIndex " ++ show name
    +  show (Constraint cons) = "Constraint (" ++ show cons ++ ")"
    +  show (DropConstraint name table) =
    +    "DropConstraint " ++ show name ++ " " ++ show table
    +  show (Sequence name) = "Sequence " ++ show name
    +  show (DropSequence name) = "DropSequence " ++ show name
    +
    +{- |
    +  Migration Guide: @SchemaDefinition@ has been removed. Use @[SchemaItem]@
    +  instead.
    +-}
    +type SchemaDefinition = [SchemaItem]
    +
    +data IndexDefinition = IndexDefinition
    +  { indexName :: String
    +  , indexUnique :: Bool
    +  , indexTable :: String
    +  , indexBody :: String
    +  } deriving (Eq, Show)
    +
    +data ConstraintDefinition = ConstraintDefinition
    +  { constraintName :: String
    +  , constraintTable :: String
    +  , constraintBody :: String
    +  } deriving (Eq, Show)
    +
    +data SequenceDefinition = SequenceDefinition
    +  { sequenceName :: String
    +  , sequenceIncrement :: Maybe Int
    +  , sequenceMinValue :: Maybe Int
    +  , sequenceMaxValue :: Maybe Int
    +  , sequenceStart :: Maybe Int
    +  , sequenceCache :: Maybe Int
    +  , sequenceCycle :: Bool
    +  } deriving (Eq, Show)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html new file mode 100644 index 0000000..ceaab84 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Internal.Where.html @@ -0,0 +1,257 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Where
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE ExistentialQuantification #-}
    +
    +module Database.Orville.PostgreSQL.Internal.Where
    +  ( WhereCondition(..)
    +  , (.==)
    +  , (.<>)
    +  , (.>)
    +  , (.>=)
    +  , (.<)
    +  , (.<=)
    +  , (.<-)
    +  , (%==)
    +  , whereConditionValues
    +  , whereAnd
    +  , whereOr
    +  , whereIn
    +  , whereLike
    +  , whereLikeInsensitive
    +  , whereNotIn
    +  , whereQualified
    +  , whereRaw
    +  , isNull
    +  , isNotNull
    +  , whereClause
    +  , whereValues
    +  , whereToSql
    +  ) where
    +
    +import qualified Data.List as List
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Expr
    +import qualified Database.Orville.PostgreSQL.Internal.Expr.WhereExpr as E
    +import Database.Orville.PostgreSQL.Internal.FieldDefinition
    +import Database.Orville.PostgreSQL.Internal.QueryKey
    +import Database.Orville.PostgreSQL.Internal.Types
    +
    +{-
    +  Migration Guide: @WhereCondition@ has been replaced with @BooleanExpr@
    +
    +  It would be nice to match the SqlValues in these with the types from the
    +  corresponding FieldDefinitions. However, this would require adding an
    +  Eq constraint for List.nub on the .<- operation, which I'm not willing
    +  to do at this moment.
    +
    +  Alternately, we could eliminate storing the entire FieldDefinition here,
    +  thereby removing the need for ExistentialQuantification. Currently the
    +  field definition is being used in the QueryKeyable instances for WhereCondition
    +  for calls to qkOp an friends. Replacing FieldDefinition with just the field
    +  name here would be nice. We would probably want a fully-fledged FieldName
    +  type whech could provide the appropriate QueryKeyable instance. That then
    +  raises questions about the ergonomics users creating FieldDefinition values
    +  without requiring OverloadedStrings to be turned on.
    +-}
    +data WhereCondition
    +  = WhereConditionExpr E.WhereExpr
    +  | Or [WhereCondition]
    +  | And [WhereCondition]
    +  | forall a b c. Qualified (TableDefinition a b c)
    +                            WhereCondition
    +
    +instance QueryKeyable WhereCondition where
    +  queryKey (WhereConditionExpr (Expr (Right form))) = queryKey form
    +  queryKey (WhereConditionExpr (Expr (Left raw))) = QKField $ rawExprToSql raw
    +  queryKey (Or conds) = qkOp "OR" conds
    +  queryKey (And conds) = qkOp "And" conds
    +  queryKey (Qualified _ cond) = queryKey cond
    +
    +(.==) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .== a = WhereConditionExpr . expr $ nameForm E..== sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<>) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .<> a = WhereConditionExpr . expr $ nameForm E..<> sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.>) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .> a = WhereConditionExpr . expr $ nameForm E..> sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.>=) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .>= a = WhereConditionExpr . expr $ nameForm E..>= sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .< a = WhereConditionExpr . expr $ nameForm E..< sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<=) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef .<= a = WhereConditionExpr . expr $ nameForm E..<= sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +(.<-) :: FieldDefinition nullability a -> [a] -> WhereCondition
    +fieldDef .<- as = whereIn fieldDef as
    +
    +(%==) :: FieldDefinition nullability a -> a -> WhereCondition
    +fieldDef %== a = WhereConditionExpr . expr $ nameForm E.%== sqlValue
    +  where
    +    nameForm = fieldToNameForm fieldDef
    +    sqlValue = fieldToSqlValue fieldDef a
    +
    +whereConditionSql :: WhereCondition -> String
    +whereConditionSql cond = internalWhereConditionSql Nothing cond
    +
    +internalWhereConditionSql ::
    +     Maybe (TableDefinition a b c) -> WhereCondition -> String
    +internalWhereConditionSql mbTableDef whereCondition =
    +  case whereCondition of
    +    Or [] -> "FALSE"
    +    Or conds ->
    +      let condsSql = map innerCondSql conds
    +       in List.intercalate " OR " condsSql
    +
    +    And [] -> "TRUE"
    +    And conds ->
    +      let condsSql = map innerCondSql conds
    +       in List.intercalate " AND " condsSql
    +
    +    WhereConditionExpr expression ->
    +      case mbTableDef of
    +        Just tableDef ->
    +          rawExprToSql . generateSql $ expression `qualified` (tableName tableDef)
    +        Nothing ->
    +          rawExprToSql . generateSql $ expression
    +
    +    Qualified tableDef cond ->
    +      internalWhereConditionSql (Just tableDef) cond
    +  where
    +    innerCondSql c =
    +      let sql = internalWhereConditionSql mbTableDef c
    +       in "(" ++ sql ++ ")"
    +
    +whereConditionValues :: WhereCondition -> [SqlValue]
    +whereConditionValues (WhereConditionExpr (Expr (Right form))) =
    +  E.whereValues [form]
    +whereConditionValues (WhereConditionExpr (Expr (Left _))) = []
    +whereConditionValues (Or conds) = concatMap whereConditionValues conds
    +whereConditionValues (And conds) = concatMap whereConditionValues conds
    +whereConditionValues (Qualified _ cond) = whereConditionValues cond
    +
    +{- |
    +  Migration Guide: @whereAnd@ has been removed. Use the binary function
    +  @andExpr@ to combine @BooleanExpr@ expressions instead. @andExpr@ is also
    +  available as the operator @(.&&)@
    +-}
    +whereAnd :: [WhereCondition] -> WhereCondition
    +whereAnd = And
    +
    +{- |
    +  Migration Guide: @whereOr@ has been removed. Use the binary function
    +  @orExpr@ to combine @BooleanExpr@ expressions instead. @orExpr@ is also
    +  available as the operator @(.||)@
    +-}
    +whereOr :: [WhereCondition] -> WhereCondition
    +whereOr = Or
    +
    +{- |
    +  Migration Guide: @whereIn@ has been renamed to @fieldIn@. It now takes a
    +  @NonEmpty@ list of values to reflect this is a requirement in SQL.
    +-}
    +whereIn :: FieldDefinition nullability a -> [a] -> WhereCondition
    +whereIn fieldDef values =
    +  WhereConditionExpr . expr $
    +  E.whereIn (fieldToNameForm fieldDef) (map (fieldToSqlValue fieldDef) values)
    +
    +{- |
    +  Migration Guide: @whereLike@ has been renamed to @fieldLike@. It now takes a
    +  @T.Text@ value rather than a @String@.
    +-}
    +whereLike :: FieldDefinition nullability a -> String -> WhereCondition
    +whereLike fieldDef raw =
    +  WhereConditionExpr . expr $
    +  E.whereLike (fieldToNameForm fieldDef) (toSql raw)
    +
    +{- |
    +  Migration Guide: @whereLikeInsensitive@ has been renamed to
    +  @fieldLikeInsensitive@. It now takes a @T.Text@ value rather than a @String@.
    +-}
    +whereLikeInsensitive :: FieldDefinition nullability a -> String -> WhereCondition
    +whereLikeInsensitive fieldDef raw =
    +  WhereConditionExpr . expr $
    +  E.whereLikeInsensitive (fieldToNameForm fieldDef) (toSql raw)
    +
    +{- |
    +  Migration Guide: @whereNotIn@ has been renamed to @fieldNotIn@. It now takes a
    +  @NonEmpty@ list of values to reflect this is a requirement in SQL.
    +-}
    +whereNotIn :: FieldDefinition nullability a -> [a] -> WhereCondition
    +whereNotIn fieldDef values =
    +  WhereConditionExpr . expr $
    +  E.whereNotIn
    +    (fieldToNameForm fieldDef)
    +    (map (fieldToSqlValue fieldDef) values)
    +
    +{- |
    +  Migration Guide: @whereQualified@ has been removed. If you need qualified
    +  column references you can use the SQL building functions found in
    +  @Orville.PostgreSQL.Expr@ to build them. The @qualifyColumn@ function can be
    +  used to qualify column references in that context. @BooleanExpr@ values built
    +  directly this way can be easily used in conjuction with other helpers such as
    +  @fieldEquals@ which also build @BooleanExpr@ values themselves.
    +-}
    +whereQualified :: TableDefinition a b c -> WhereCondition -> WhereCondition
    +whereQualified tableDef cond = Qualified tableDef cond
    +
    +{- |
    +  Migration Guide: @whereRaw@ has been removed. In its place you should use the
    +  more general functions such as @unsafeSqlExpression@ or @unsafeRawSql@ in the
    +  @Orville.PostgreSQL.Raw.RawSql@ module to build a @BooleanExpr@.
    +-}
    +whereRaw :: String -> [SqlValue] -> WhereCondition
    +whereRaw str values = WhereConditionExpr . expr $ E.whereRaw str values
    +
    +{- |
    +  Migration Guide: @isNull@ has been renamed to @fieldIsNull@
    +-}
    +isNull :: FieldDefinition Nullable a -> WhereCondition
    +isNull = WhereConditionExpr . expr . E.whereNull . fieldToNameForm
    +
    +{- |
    +  Migration Guide: @isNotNull@ has been renamed to @fieldIsNotNull@
    +-}
    +isNotNull :: FieldDefinition Nullable a -> WhereCondition
    +isNotNull = WhereConditionExpr . expr . E.whereNotNull . fieldToNameForm
    +
    +whereClause :: [WhereCondition] -> String
    +whereClause [] = ""
    +whereClause conds = "WHERE " ++ whereConditionSql (whereAnd conds)
    +
    +whereValues :: [WhereCondition] -> [SqlValue]
    +whereValues = List.concatMap whereConditionValues
    +
    +{- |
    +  Migration Guide: @whereToSql@ has been removed. It is replaced by the more
    +  general @toBytesAndParams@ function in @Orville.PostgreSQL.Raw.RawSql@.
    +-}
    +whereToSql :: [WhereCondition] -> (String, [SqlValue])
    +whereToSql conds = (whereClause conds, whereValues conds)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html new file mode 100644 index 0000000..68b2452 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadBaseControl.html @@ -0,0 +1,127 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +'Database.Orville.PostgreSQL.MonadBaseControl' provides functions and instances for
    +using 'MonadOrville' and 'OrvilleT' for situations where you need to use
    +'MonadBaseControl'. If you do not know if you need 'MonadBaseControl', then
    +you probably don't need to use this module. If you are thinking about
    +using 'MonadBaseControl' instead of 'MonadUnliftIO', we recommend
    +reading Michael Snoyman's excellent "A Tale of Two Brackets"
    +(https://www.fpcomplete.com/blog/2017/06/tale-of-two-brackets) if you
    +have not already done so.
    +
    +If you're still here after reading above, this module provides
    +the functions you need to implement 'MonadOrvilleControl' for your
    +Monad stack using its 'MonadBaseControl' instance. The most common way
    +to do this is simply to add the following 'MonadOrvilleControl' instance:
    +
    +@
    + instance MonadOrvilleControl MyMonad where
    +   liftWithConnection = liftWithConnectionViaBaseControl
    +   liftFinally = liftFinallyViaBaseControl
    +@
    +
    +This module also provides a 'MonadOrvilleControl' for 'StateT' as well as
    +'MonadBaseControl' and 'MonadTransControl' instances for 'OrvilleT' and
    +'OrvilleTriggerT'.
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE RankNTypes #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +{-# LANGUAGE TypeFamilies #-}
    +
    +module Database.Orville.PostgreSQL.MonadBaseControl
    +  ( liftWithConnectionViaBaseControl
    +  , liftFinallyViaBaseControl
    +  ) where
    +
    +import Control.Monad.Reader (ReaderT)
    +import Control.Monad.State (StateT)
    +import qualified Control.Monad.Trans.Control as MTC
    +
    +import qualified Database.Orville.PostgreSQL as O
    +import qualified Database.Orville.PostgreSQL.Internal.Monad as InternalMonad
    +import qualified Database.Orville.PostgreSQL.Internal.Trigger as InternalTrigger
    +import qualified Database.Orville.PostgreSQL.Trigger as OT
    +
    +{-|
    +   liftWithConnectionViaBaseControl can be use as the implementation of
    +   'liftWithConnection' for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadBaseControl'.
    + -}
    +liftWithConnectionViaBaseControl ::
    +     MTC.MonadBaseControl IO m
    +  => (forall b. (conn -> IO b) -> IO b)
    +  -> (conn -> m a)
    +  -> m a
    +liftWithConnectionViaBaseControl ioWithConn action =
    +  MTC.control $ \runInIO -> ioWithConn (runInIO . action)
    +
    +{-|
    +   liftFinallyViaBaseControl can be use as the implementation of
    +   'liftFinally for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadBaseControl'.
    + -}
    +liftFinallyViaBaseControl ::
    +     MTC.MonadBaseControl IO m
    +  => (forall c d. IO c -> IO d -> IO c)
    +  -> m a
    +  -> m b
    +  -> m a
    +liftFinallyViaBaseControl ioFinally action cleanup =
    +  MTC.control $ \runInIO -> ioFinally (runInIO action) (runInIO cleanup)
    +
    +{-|
    +   Because lifting control operations into 'StateT' is fraught with peril, a
    +   'MonadOrvilleControl' instance for 'StateT' is provided here and implemented
    +   via 'MonadBaseControl' rather than together with the 'MonadOrvilleControl'
    +   definition. We do not recommend using stateful Monad transformer layers in
    +   Monad stacks based on IO. For anyone that must, this is the canonical
    +   instance for 'StateT'
    +  -}
    +instance MTC.MonadBaseControl IO m => O.MonadOrvilleControl (StateT a m) where
    +  liftWithConnection = liftWithConnectionViaBaseControl
    +  liftFinally = liftFinallyViaBaseControl
    +
    +{-|
    +   Because we recommend using 'MonadUnliftIO' rather than 'MonadTransControl',
    +   we do not provide 'MonadTransControl' instance for 'OrvilleT' by default
    +   along with the definition. If you do need to use 'MonadTransControl',
    +   however, this is the canonical instance for 'OrvilleT'.
    +  -}
    +instance MTC.MonadTransControl (O.OrvilleT conn) where
    +  type StT (O.OrvilleT conn) a = MTC.StT (ReaderT (O.OrvilleEnv conn)) a
    +  liftWith =
    +    MTC.defaultLiftWith InternalMonad.OrvilleT InternalMonad.unOrvilleT
    +  restoreT = MTC.defaultRestoreT InternalMonad.OrvilleT
    +
    +{-|
    +   Because we recommend using 'MonadUnliftIO' rather than 'MonadBaseControl',
    +   we do not provide 'MonadBaseControl' instance for 'OrvilleT' by default
    +   along with the definition. If you do need to use 'MonadBaseControl',
    +   however, this is the canonical instance for 'OrvilleT'.
    +  -}
    +instance MTC.MonadBaseControl b m =>
    +         MTC.MonadBaseControl b (O.OrvilleT conn m) where
    +  type StM (O.OrvilleT conn m) a = MTC.ComposeSt (O.OrvilleT conn) m a
    +  liftBaseWith = MTC.defaultLiftBaseWith
    +  restoreM = MTC.defaultRestoreM
    +
    +instance MTC.MonadTransControl (OT.OrvilleTriggerT trigger conn) where
    +  type StT (OT.OrvilleTriggerT trigger conn) a = MTC.StT (ReaderT (InternalTrigger.RecordedTriggersRef trigger)) (MTC.StT (O.OrvilleT conn) a)
    +  liftWith f =
    +    InternalTrigger.OrvilleTriggerT $
    +    MTC.liftWith $ \runReader ->
    +      MTC.liftWith $ \runOrville ->
    +        f (runOrville . runReader . InternalTrigger.unTriggerT)
    +  restoreT = InternalTrigger.OrvilleTriggerT . MTC.restoreT . MTC.restoreT
    +
    +instance MTC.MonadBaseControl b m =>
    +         MTC.MonadBaseControl b (OT.OrvilleTriggerT trigger conn m) where
    +  type StM (OT.OrvilleTriggerT trigger conn m) a = MTC.StM (ReaderT (InternalTrigger.RecordedTriggersRef trigger) m) a
    +  liftBaseWith = MTC.defaultLiftBaseWith
    +  restoreM = MTC.defaultRestoreM
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html new file mode 100644 index 0000000..7db6bbc --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.MonadUnliftIO.html @@ -0,0 +1,88 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +'Database.Orville.PostgreSQL.MonadUnliftIO' provides functions and instances for using
    +'MonadOrville' and 'OrvilleT' for Monad transformer stacks that are using
    +'MonadUnliftIO'.  The most common way to do this is simply to add the
    +following 'MonadOrvilleControl' instance:
    +
    +@
    + instance MonadOrvilleControl MyMonad where
    +   liftWithConnection = liftWithConnectionViaUnliftIO
    +   liftFinally = liftFinallyViaUnliftIO
    +@
    +
    +This module also provides a 'MonadUnliftIO' instance for 'OrvilleT' and 'OrvilleTrigger'.
    +|-}
    +{-# LANGUAGE CPP #-}
    +{-# LANGUAGE RankNTypes #-}
    +
    +module Database.Orville.PostgreSQL.MonadUnliftIO
    +  ( liftWithConnectionViaUnliftIO
    +  , liftFinallyViaUnliftIO
    +  ) where
    +
    +import qualified Control.Monad.IO.Unlift as UL
    +
    +import qualified Database.Orville.PostgreSQL as O
    +import qualified Database.Orville.PostgreSQL.Internal.Monad as InternalMonad
    +import qualified Database.Orville.PostgreSQL.Internal.Trigger as InternalTrigger
    +import qualified Database.Orville.PostgreSQL.Trigger as OT
    +
    +{-|
    +   liftWithConnectionViaUnliftIO can be use as the implementation of
    +   'liftWithConnection' for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadUnliftIO'.
    + |-}
    +liftWithConnectionViaUnliftIO ::
    +     UL.MonadUnliftIO m
    +  => (forall a. (conn -> IO a) -> IO a)
    +  -> (conn -> m b)
    +  -> m b
    +liftWithConnectionViaUnliftIO ioWithConn action =
    +  UL.withRunInIO $ \runInIO -> ioWithConn (runInIO . action)
    +
    +{-|
    +   liftFinallyViaUnliftIO can be use as the implementation of
    +   'liftFinally' for 'MonadOrvilleControl' when the 'Monad'
    +   implements 'MonadUnliftIO'.
    + |-}
    +liftFinallyViaUnliftIO ::
    +     UL.MonadUnliftIO m
    +  => (forall a b. IO a -> IO b -> IO a)
    +  -> m c
    +  -> m d
    +  -> m c
    +liftFinallyViaUnliftIO ioFinally action cleanup = do
    +  unlio <- UL.askUnliftIO
    +  UL.liftIO $ ioFinally (UL.unliftIO unlio action) (UL.unliftIO unlio cleanup)
    +
    +instance UL.MonadUnliftIO m => UL.MonadUnliftIO (O.OrvilleT conn m) where
    +#if MIN_VERSION_unliftio_core(0,2,0)
    +  withRunInIO inner =
    +    InternalMonad.OrvilleT $ do
    +      UL.withRunInIO $ \run ->
    +        inner (run . InternalMonad.unOrvilleT)
    +#else
    +  askUnliftIO =
    +    InternalMonad.OrvilleT $ do
    +      unlio <- UL.askUnliftIO
    +      pure $ UL.UnliftIO (UL.unliftIO unlio . InternalMonad.unOrvilleT)
    +#endif
    +
    +instance UL.MonadUnliftIO m =>
    +         UL.MonadUnliftIO (OT.OrvilleTriggerT trigger conn m) where
    +#if MIN_VERSION_unliftio_core(0,2,0)
    +  withRunInIO inner =
    +    InternalTrigger.OrvilleTriggerT $ do
    +      UL.withRunInIO $ \run ->
    +        inner (run . InternalTrigger.unTriggerT)
    +#else
    +  askUnliftIO =
    +    InternalTrigger.OrvilleTriggerT $ do
    +      unlio <- UL.askUnliftIO
    +      pure $ UL.UnliftIO (UL.unliftIO unlio . InternalTrigger.unTriggerT)
    +#endif
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html new file mode 100644 index 0000000..4f4a1b2 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Pagination.html @@ -0,0 +1,54 @@ +
    module Database.Orville.PostgreSQL.Pagination
    +  ( Pagination(..)
    +  , buildPagination
    +  ) where
    +
    +import Data.Maybe (maybeToList)
    +import Safe (lastMay)
    +
    +import Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +import Database.Orville.PostgreSQL.Internal.Monad (MonadOrville)
    +import Database.Orville.PostgreSQL.Internal.OrderBy (SortDirection(Ascending))
    +import Database.Orville.PostgreSQL.Internal.SelectOptions (limit, order, where_)
    +import Database.Orville.PostgreSQL.Internal.Types (TableDefinition(..), FieldDefinition, NotNull)
    +import Database.Orville.PostgreSQL.Internal.Where ((.>=), WhereCondition, whereAnd)
    +import Database.Orville.PostgreSQL.Select (runSelect, selectQueryTable)
    +
    +data Pagination m entity =
    +  Pagination
    +    { pageRows :: [entity]
    +    , pageNext :: Maybe (m (Pagination m entity))
    +    }
    +
    +buildPagination :: (MonadOrville conn m, Bounded orderField, Enum orderField)
    +                => TableDefinition readEnt write key
    +                -> FieldDefinition NotNull orderField
    +                -> (readEnt -> orderField)
    +                -> Maybe WhereCondition
    +                -> Word
    +                -> m (Pagination m readEnt)
    +buildPagination tableDef orderField getOrderField mbWhereCond pageSize =
    +  let selectOpts bound
    +        = order orderField Ascending
    +       <> limit (fromIntegral pageSize)
    +       <> where_ (whereAnd $ orderField .>= bound
    +                           : maybeToList mbWhereCond
    +                 )
    +
    +      selectAll = runSelect . selectQueryTable tableDef
    +      mkPagination bound = do
    +        rows <- selectAll $ selectOpts bound
    +
    +        let nxt =
    +              case lastMay rows of
    +                Just lst | length rows == fromIntegral pageSize ->
    +                  Just . mkPagination . succ $ getOrderField lst
    +                _ -> Nothing
    +
    +        pure $ Pagination
    +                 { pageRows = rows
    +                 , pageNext = nxt
    +                 }
    +
    +   in mkPagination minBound
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html new file mode 100644 index 0000000..2000b17 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Explanation.html @@ -0,0 +1,36 @@ +
    {-# LANGUAGE CPP #-}
    +module Database.Orville.PostgreSQL.Plan.Explanation
    +  ( Explanation
    +  , noExplanation
    +  , explainStep
    +  , explanationSteps
    +  ) where
    +
    +newtype Explanation =
    +  Explanation ([String] -> [String])
    +
    +#if MIN_VERSION_base(4,11,0)
    +instance Semigroup Explanation where
    +  (<>) = appendExplanation
    +#endif
    +
    +instance Monoid Explanation where
    +  mempty = noExplanation
    +  mappend = appendExplanation
    +
    +appendExplanation :: Explanation -> Explanation -> Explanation
    +appendExplanation (Explanation front) (Explanation back) =
    +  Explanation (front . back)
    +
    +noExplanation :: Explanation
    +noExplanation =
    +  Explanation id
    +
    +explainStep :: String -> Explanation
    +explainStep str =
    +  Explanation (str:)
    +
    +explanationSteps :: Explanation -> [String]
    +explanationSteps (Explanation prependTo) =
    +  prependTo []
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html new file mode 100644 index 0000000..b3f337a --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Many.html @@ -0,0 +1,139 @@ +
    module Database.Orville.PostgreSQL.Plan.Many
    +  ( Many
    +  , NotAKey(NotAKey)
    +  , fromKeys
    +  , lookup
    +  , keys
    +  , elems
    +  , map
    +  , toMap
    +  , apply
    +  , compose
    +  ) where
    +
    +import           Prelude hiding (lookup, map)
    +
    +import qualified Data.Either as Either
    +import qualified Data.Map as Map
    +import qualified Data.Maybe as Maybe
    +
    +{-|
    +  'NotAKey' is returned from various 'Many' related functions when presented
    +  with an input parameter that was not one of the original inputs that the
    +  'Many' was constructed with.
    +-}
    +data NotAKey =
    +  NotAKey
    +
    +{-|
    +  A 'Many k a' represents a group of values keyed by list of parameters and
    +  is used to return the results of executing an Orville Plan with a list of
    +  input parameters. If you need to find the result of the query associated
    +  with a particular input parameter, you can use 'lookup' to find it. If you
    +  don't care about the association with particular inputs, you can simply
    +  use 'elems' to get a list of all the results.
    +-}
    +data Many k a =
    +  Many [k] (k -> Either NotAKey a)
    +
    +instance Functor (Many k) where
    +  fmap = map
    +
    +{-|
    +  'fromKeys' constructs a 'Many' value from a list of keys and a function that
    +  maps them to their values. The order and duplication of keys in the list will
    +  be preserved by the 'Many' type in the relevant functions. The mapping
    +  function provided should be a total function -- i.e. it should not produce a
    +  runtime error. If it is not possible to map every @k@ (even those not in the
    +  input list provided to 'fromKeys'), the values should be wrapped in an
    +  appropriate type such as 'Maybe' so that an empty or default value can be
    +  returned.
    +-}
    +fromKeys :: [k] -> (k -> Either NotAKey a) -> Many k a
    +fromKeys =
    +  Many
    +
    +{-|
    +   'map' calls a function on all the values found in a 'Many' collection.
    +-}
    +map :: (a -> b) -> Many k a -> Many k b
    +map f (Many ks keyToValue) =
    +  Many ks (fmap f . keyToValue)
    +
    +{-|
    +   'apply' allows you to apply many functions to many values. The function
    +   associated with each parameter is applied to the value associated with the
    +   same paremeter.
    +
    +   (If you're looking for 'pure' or an 'Applicative' instance for 'Many', this
    +   is as good as it gets. 'Many' cannot be an 'Applicative' because there is no
    +   correct implementation of 'pure' that we can reasonably provide).
    +-}
    +apply :: (Many param (a -> b))
    +      -> (Many param a)
    +      -> (Many param b)
    +apply manyFs manyAs =
    +  fromKeys (keys manyFs) applyF
    +    where
    +      applyF param =
    +        lookup param manyFs <*> lookup param manyAs
    +
    +{-|
    +  'compose' uses the values of a 'Many' value as keys to a second 'Many' to
    +  create a 'Many' mapping from the original keys to the final values.
    +-}
    +compose :: Many b c -> Many a b -> Many a c
    +compose manyBC manyAB =
    +  fromKeys (keys manyAB) aToC
    +    where
    +      aToC a = do
    +        b <- lookup a manyAB
    +        lookup b manyBC
    +
    +{-|
    +  'keys' fetches the list of keys from a 'Many'. Note that is a list and not
    +  a set. 'Many' preserves the order and duplication of any key values that were
    +  in the key list at the time of construction.
    +-}
    +keys :: Many k a -> [k]
    +keys (Many ks _) =
    +  ks
    +
    +{-|
    +  'elems' returns all the values that correspond the keys of the 'Many'. The
    +  values will be returned in the same order that the keys were present at the
    +  time of creation, though if you truly care about this it's probably better to
    +  use 'lookup' to make that correspondence explicit.
    +-}
    +elems :: Many k a -> [a]
    +elems (Many ks keyToValue) =
    +  Either.rights $ keyToValue <$> ks
    +
    +{-|
    +  'toMap' converts the 'Many' into a 'Map' value. If all you wanted to do was
    +  find the value for a specific key, you should probably use 'lookup' instead.
    +-}
    +toMap :: Ord k => Many k a -> Map.Map k a
    +toMap (Many ks keyToValue) =
    +  Map.fromList (Maybe.mapMaybe mkPair ks)
    +    where
    +      mkPair k =
    +        case keyToValue k of
    +          Left NotAKey ->
    +            Nothing
    +
    +          Right value ->
    +            Just (k, value)
    +
    +{-|
    +  'lookup' returns the value for the given parameter. If the given @k@ is
    +  not one of the original input values that the 'Many' was constructed with,
    +  the mapping function given at the contructor will determine what value to
    +  return. Often this will be whatever a reasonable empty or default value for
    +  the type @a@ is.
    +-}
    +lookup :: k -> Many k a -> Either NotAKey a
    +lookup k (Many _ keyToValue) =
    +  keyToValue k
    +
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html new file mode 100644 index 0000000..acf7291 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Operation.html @@ -0,0 +1,447 @@ +
    {-# LANGUAGE RankNTypes #-}
    +module Database.Orville.PostgreSQL.Plan.Operation
    +  ( Operation(..)
    +  , AssertionFailed
    +  , mkAssertionFailed
    +  , findOne
    +  , findOneWhere
    +  , findAll
    +  , findAllWhere
    +  , findSelect
    +  , askParam
    +  , assertRight
    +
    +  , SelectOperation(..)
    +  , selectOperation
    +  ) where
    +
    +import qualified Control.Monad.Catch as Catch
    +import qualified Data.Foldable as Fold
    +import qualified Data.Maybe as Maybe
    +import qualified Data.Map.Strict as Map
    +import qualified Data.Text as T
    +
    +import           Database.Orville.PostgreSQL.Core ((.==), (.<-))
    +import qualified Database.Orville.PostgreSQL.Core as Core
    +import           Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +import qualified Database.Orville.PostgreSQL.Internal.Select as SelectInternal
    +import qualified Database.Orville.PostgreSQL.Plan.Explanation as Exp
    +import           Database.Orville.PostgreSQL.Plan.Many (Many)
    +import qualified Database.Orville.PostgreSQL.Plan.Many as Many
    +import           Database.Orville.PostgreSQL.Select (Select)
    +import qualified Database.Orville.PostgreSQL.Select as Select
    +
    +{-|
    +  'Operation' provides a stucture for building primitive operations that can be
    +  incorporated into a 'Database.Orville.PostgreSQL.Plan.Plan'. An 'Operation'
    +  provides base case implementations of the various plan execution functions.
    +  You only need to care about this type if you want to create new custom
    +  operations to include in a 'Database.Orville.PostgreSQL.Plan.Plan' beyond
    +  those already provided in the 'Database.Orville.PostgreSQL.Plan.Plan'
    +  api.
    +-}
    +data Operation param result =
    +  Operation
    +    { -- | 'executeOperationOne' will be called when an plan is
    +      -- executed with a single input parameter
    +      executeOperationOne :: forall conn m. (Core.MonadOrville conn m)
    +                          => param
    +                          -> m (Either AssertionFailed result)
    +
    +      -- | 'executeOperationMany' will be called when an plan is
    +      -- executed with multiple input parameters (via 'planMany').
    +    , executeOperationMany :: forall conn m. (Core.MonadOrville conn m)
    +                           => [param]
    +                           -> m (Either AssertionFailed (Many param result))
    +
    +      -- | 'explainOperationOne' will be called when producing an explanation
    +      -- of what the plan will do when given one input parameter. Plans that do
    +      -- not perform any interesting IO interactions should generally return an
    +      -- empty explanation.
    +    , explainOperationOne :: Exp.Explanation
    +
    +      -- | 'explainOperationMany' will be called when producing an explanation
    +      -- of what the plan will do when given multiple input parameters (via
    +      -- 'planMany'). Plans that do not perform any interesting IO interactions
    +      -- should generally return an empty explanation.
    +    , explainOperationMany :: Exp.Explanation
    +    }
    +
    +{-|
    +  'AssertionFailed' may be returned from the execute functions of an
    +  'Operation' to indicate that some expected invariant has failed. For example,
    +  following a foreign key that is enforced by the database only to find that no
    +  record exists. When an 'Operation' returns an 'AssertionFailed' value during
    +  plan execution the error is thrown as an exception using the
    +  'Control.Monad.Catch.MonadThrow' instance for whatever monad the plan is
    +  executing in.
    +-}
    +newtype AssertionFailed =
    +  AssertionFailed String
    +  deriving Show
    +
    +{-|
    +  'mkAssertionFailed' builds an 'AssertionFailed' error from an error message.
    +-}
    +mkAssertionFailed :: String -> AssertionFailed
    +mkAssertionFailed =
    +  AssertionFailed
    +
    +instance Catch.Exception AssertionFailed
    +
    +{-|
    +  'askParam' simply returns the paremeter given from the plan.
    +-}
    +askParam :: Operation param param
    +askParam =
    +  Operation
    +    { executeOperationOne   = pure . Right
    +    , executeOperationMany  = \params -> pure . Right $ Many.fromKeys params Right
    +    , explainOperationOne   = Exp.noExplanation
    +    , explainOperationMany  = Exp.noExplanation
    +    }
    +
    +{-|
    +  'assertRight' returns the value on the 'Right' side of an 'Either'. If
    +  the 'Either' is a 'Left', it raises 'AssertionFailed' with the message
    +  from the left side of the either.
    +-}
    +assertRight :: Operation (Either String a) a
    +assertRight =
    +  Operation
    +    { executeOperationOne = \eitherA ->
    +      pure $
    +        case eitherA of
    +          Left err ->
    +            Left (AssertionFailed $ "Assertion failed: " <> err)
    +
    +          Right b ->
    +            Right b
    +
    +    , executeOperationMany = \eitherAs ->
    +      pure $
    +        case sequence eitherAs of
    +          Left err ->
    +            Left (AssertionFailed $ "Assertion failed: " <> err)
    +
    +          Right _ ->
    +            let
    +              errorOnLeft eitherA =
    +                case eitherA of
    +                  Left _ ->
    +                    -- We proved all the values above didn't have any lefts in
    +                    -- then, so if we get a left here it must not be one of the
    +                    -- keys from the Many.
    +                    Left Many.NotAKey
    +
    +                  Right a ->
    +                    Right a
    +            in
    +              Right $ Many.fromKeys eitherAs errorOnLeft
    +
    +    , explainOperationOne   = Exp.noExplanation
    +    , explainOperationMany  = Exp.noExplanation
    +    }
    +
    +{-|
    +  'findOne' builds a planning primitive that finds (at most) one row from the
    +  given table where the column value for the provided 'Core.FieldDefinition' matches
    +  the plan's input parameter. When executed on multiple parameters it fetches
    +  all rows where the field matches the inputs and arbitrarily picks at most one
    +  of those rows to use as the result for each input.
    +-}
    +findOne :: Ord fieldValue
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Operation fieldValue (Maybe readEntity)
    +findOne tableDef fieldDef =
    +  findOneWithOpts tableDef fieldDef mempty
    +
    +{-|
    +  'findOneWhere' is similar to 'findOne' but allows a 'WhereCondition' to be
    +  specified that is added to the database query to restrict which rows are
    +  returned.
    +-}
    +findOneWhere :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Operation fieldValue (Maybe readEntity)
    +findOneWhere tableDef fieldDef cond =
    +  findOneWithOpts tableDef fieldDef (Core.where_ cond)
    +
    +{-|
    +  'findOneWithOpts' is a internal helper used by 'findOne' and 'findOneWhere'
    +-}
    +findOneWithOpts :: Ord fieldValue
    +                => Core.TableDefinition readEntity writeEntity key
    +                -> Core.FieldDefinition nullability fieldValue
    +                -> Core.SelectOptions
    +                -> Operation fieldValue (Maybe readEntity)
    +findOneWithOpts tableDef fieldDef opts =
    +  selectOperation selectOp
    +    where
    +      selectOp =
    +        SelectOperation
    +          { selectOne = \fieldValue ->
    +              select (opts <> Core.where_ (fieldDef .== fieldValue) <> Core.limit 1)
    +
    +          , selectMany = \fieldValues ->
    +              select (opts <> Core.where_ (fieldDef .<- fieldValues))
    +
    +          , explainSelectOne =
    +              select (opts <> Core.where_ (stringyField .== T.pack "EXAMPLE VALUE"))
    +
    +          , explainSelectMany =
    +              select (opts <> Core.where_ (stringyField .<- map T.pack ["EXAMPLE VALUE 1", "EXAMPLE VALUE 2"]))
    +
    +          , categorizeRow = fst
    +          , produceResult = fmap snd . Maybe.listToMaybe
    +          }
    +
    +      select =
    +         Select.selectQuery
    +           fromSql
    +           (Select.fromClauseTable tableDef)
    +
    +      stringyField =
    +        stringifyField fieldDef
    +
    +      fromSql =
    +        (,)
    +          <$> Core.fieldFromSql fieldDef
    +          <*> Core.tableFromSql tableDef
    +
    +{-|
    +  'findAll' builds a planning primitive that finds all the rows from the
    +  given table where the column value for the provided field matches the
    +  plan's input parameter. Where executed on multiple parameters all rows
    +  are fetch in a single query and then associated with their respective
    +  inputs after being fetched.
    +-}
    +findAll :: Ord fieldValue
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Operation fieldValue [readEntity]
    +findAll tableDef fieldDef =
    +  findAllWithOpts tableDef fieldDef mempty
    +
    +{-|
    +  'findAllWhere' is similar to 'findAll' but allows a 'WhereCondition' to be
    +  specified that is added to the database query to restrict which rows are
    +  returned.
    +-}
    +findAllWhere :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Operation fieldValue [readEntity]
    +findAllWhere tableDef fieldDef cond =
    +  findAllWithOpts tableDef fieldDef (Core.where_ cond)
    +
    +{-|
    +  'findAllWithOpts' is an internal helper used by 'findAll' and 'findAllWhere'
    +-}
    +findAllWithOpts :: Ord fieldValue
    +                => Core.TableDefinition readEntity writeEntity key
    +                -> Core.FieldDefinition nullability fieldValue
    +                -> Core.SelectOptions
    +                -> Operation fieldValue [readEntity]
    +findAllWithOpts tableDef fieldDef opts =
    +  selectOperation selectOp
    +    where
    +      selectOp =
    +        SelectOperation
    +          { selectOne = \fieldValue ->
    +            select (opts <> Core.where_ (fieldDef .== fieldValue))
    +
    +          , selectMany = \fieldValues ->
    +            select (opts <> Core.where_ (fieldDef .<- fieldValues))
    +
    +          , explainSelectOne =
    +            select (opts <> Core.where_ (stringyField .== T.pack "EXAMPLE VALUE"))
    +
    +          , explainSelectMany =
    +            select (opts <> Core.where_ (stringyField .<- map T.pack ["EXAMPLE VALUE 1", "EXAMPLE VALUE 2"]))
    +
    +          , categorizeRow = fst
    +          , produceResult = map snd
    +          }
    +
    +      select =
    +        Select.selectQuery
    +          fromSql
    +          (Select.fromClauseTable tableDef)
    +
    +      stringyField =
    +        stringifyField fieldDef
    +
    +      fromSql =
    +        (,)
    +          <$> Core.fieldFromSql fieldDef
    +          <*> Core.tableFromSql tableDef
    +
    +{-|
    +  'stringifyField' arbitrarily re-labels the 'SqlType' of a field definition
    +  as text. It is an internal helper function that is used for constructing
    +  'WhereCondition' clauses used to generate sql when explaining how a plan
    +  will be executed. Relabeling the type as 'T.Text' allows us to use text
    +  values as example inputs in the queries when for explaining plans.
    +-}
    +stringifyField :: Core.FieldDefinition nullability a
    +               -> Core.FieldDefinition nullability T.Text
    +stringifyField fieldDef =
    +  fieldDef
    +    { Core.fieldType = Core.text 0
    +    }
    +
    +{-|
    +  'SelectOperation' is a helper type for building 'Operation' primitives that
    +  run 'Select' queries. Specifying the fields of 'SelectOperation' and then
    +  using the 'selectOperation' function to build an 'Operation' is more
    +  convenient that building functions to execute the queries thate are required
    +  by the 'Operation' type.
    +-}
    +data SelectOperation param row result =
    +  SelectOperation
    +    { -- | 'selectOne' will be called to build the 'Select' query that should
    +      -- be run when there is a single input parameter while executing a plan.
    +      -- Note that the "One-ness" here refers to the single input parameter
    +      -- rather than result. See 'produceResult' below for more information
    +      -- about returning one values vs. many from a 'SelectOperation'.
    +      selectOne           :: param -> Select row
    +
    +      -- | 'selectMany' will be called to build the 'Select' query that should
    +      -- be run when there are multiple parameters while executing a plan.
    +      -- Note that the "Many-ness" here refers to the multiple input parameters
    +      -- rather than result. See 'produceResult' below for more information
    +      -- about returning one values vs. many from a 'SelectOperation'.
    +    , selectMany          :: [param] -> Select row
    +
    +      -- | 'explainSelectOne' should show a representative query of what will
    +      -- be returned when 'selectOne' is used. No input parameter is available
    +      -- here to build the query, however, because this value is used to
    +      -- explain a plan without actually running it.
    +    , explainSelectOne    :: Select row
    +
    +      -- | 'explainSelectMany' should show a representative query of what will
    +      -- be returned when 'selectMany is used. No input parameters are available
    +      -- here to build the query, however, because this value is used to
    +      -- explain a plan without actually running it.
    +    , explainSelectMany   :: Select row
    +
    +      -- | 'categorizeRow' will be used when a plan is executed with multiple
    +      -- parameters to determine which input parameter the row should be
    +      -- associated with.
    +    , categorizeRow       :: row -> param
    +
    +      -- | 'produceResult' will be used convert the 'row' type returned by the
    +      -- 'Select' queries for the operation input the 'result' type that is
    +      -- present as the output of the operation. The input rows will be all the
    +      -- inputs associated with a single parameter. The 'result' type
    +      -- constructed here need not be a single value. For instance, 'findAll'
    +      -- uses the list type as the 'result' type and 'findOne' uses 'Maybe'.
    +    , produceResult       :: [row] -> result
    +    }
    +
    +{-|
    +  'selectOperation' builds a primitive planning 'Operation' using the functions
    +  given by a 'SelectOperation'. If you are implementing a custom operation that
    +  runs a select statement, it is probably easier to use this function rather
    +  than building the 'Operation' functions directly.
    +-}
    +selectOperation :: Ord param
    +                => SelectOperation param row result
    +                -> Operation param result
    +selectOperation selectOp =
    +  Operation
    +    { executeOperationOne   = runSelectOne selectOp
    +    , executeOperationMany  = runSelectMany selectOp
    +    , explainOperationOne   = Exp.explainStep $ SelectInternal.selectSql (explainSelectOne selectOp)
    +    , explainOperationMany  = Exp.explainStep $ SelectInternal.selectSql (explainSelectMany selectOp)
    +    }
    +
    +
    +{-|
    +  'runSelectOne' is an internal helper function that executes a
    +  'SelectOperation' on a single input parameter.
    +-}
    +runSelectOne :: Core.MonadOrville conn m
    +             => SelectOperation param row result
    +             -> param
    +             -> m (Either AssertionFailed result)
    +runSelectOne selectOp param =
    +  Right . produceResult selectOp <$>
    +    (Select.runSelect . selectOne selectOp $ param)
    +
    +
    +{-|
    +  'runSelectMany' is an internal helper function that executes a
    +  'SelectOperation' on multiple input parameters.
    +-}
    +runSelectMany :: (Ord param, Core.MonadOrville conn m)
    +              => SelectOperation param row result
    +              -> [param]
    +              -> m (Either AssertionFailed (Many param result))
    +runSelectMany selectOp params = do
    +  rows <- Select.runSelect . selectMany selectOp $ params
    +
    +  let
    +    -- Seed add initial map with an empty list for every input parameter
    +    -- to guarantee that each param is a key in the map even if no rows
    +    -- where returned from the select query for that param.
    +    emptyRowsMap =
    +      Map.fromList
    +      . map (\param -> (param, []))
    +      $ params
    +
    +    insertRow results row =
    +      Map.alter
    +        (\mbRows -> Just (row : Maybe.fromMaybe [] mbRows))
    +        (categorizeRow selectOp row)
    +        results
    +
    +    rowMap =
    +      produceResult selectOp <$> Fold.foldl' insertRow emptyRowsMap rows
    +
    +    manyRows =
    +      Many.fromKeys params $ \param ->
    +        case Map.lookup param rowMap of
    +          Nothing ->
    +            -- Because we seeded the map above with all the input parameters we
    +            -- can be sure that if we don't find a value in the map here it is
    +            -- because the function parameter is not one of the original inputs
    +            -- rather than just an input for which no rows were returned by the
    +            -- select query.
    +            Left Many.NotAKey
    +
    +          Just row ->
    +            Right row
    +
    +  pure . Right $ manyRows
    +
    +
    +{-|
    +  'findSelect' builds a plan 'Operation' where the select that is run does not
    +  use the input parameters for the plan in any way. If the
    +  'executeOperationMany' function of the resulting 'Operation' will run the
    +  query once and use the entire result set as the result each of the input
    +  parameters in turn.
    +-}
    +findSelect :: Select.Select row -> Operation param [row]
    +findSelect select =
    +  let
    +    runOne _ =
    +      Right <$> Select.runSelect select
    +
    +    runMany params = do
    +      rows <- Select.runSelect select
    +      pure . Right $ Many.fromKeys params (const (Right rows))
    +  in
    +    Operation
    +      { executeOperationOne   = runOne
    +      , executeOperationMany  = runMany
    +      , explainOperationOne   = Exp.explainStep (SelectInternal.selectSql select)
    +      , explainOperationMany  = Exp.explainStep (SelectInternal.selectSql select)
    +      }
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html new file mode 100644 index 0000000..2187d40 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.Syntax.html @@ -0,0 +1,52 @@ +
    {- |
    +Module    : Orville.PostgreSQL.Connection
    +Copyright : Flipstone Technology Partners 2021
    +License   : MIT
    +
    +This module exports the 'Plan.bind' function as '>>=' so that it can be used in
    +conjuction with the @QualifiedDo@ language extension to write plans using do
    +syntax like so:
    +
    +@
    +{-# LANGUAGE QualifiedDo #-}
    +module MyModule where
    +
    +import qualified Orville.PostgreSQL.Plan.Syntax as PlanSyntax
    +
    +data FooFamily =
    +  FooFamily
    +    { foo :: Foo
    +    , children :: [FooChildren]
    +    , pets :: [FooPets]
    +    }
    +
    +findFooFamily = PlanSyntax.do $
    +  fooHeader <- Plan.findOne fooTable fooIdField
    +  fooChildren <- Plan.findAll fooChildTable fooIdField
    +  fooPets <- Plan.findAll fooPetTable fooIdField
    +
    +  FooFamily
    +    <$> Plan.use fooHeader
    +    <*> Plan.use fooChildren
    +    <*> Plan.use fooPets
    +@
    +
    +-}
    +module Database.Orville.PostgreSQL.Plan.Syntax
    +  ( (>>=),
    +  )
    +where
    +
    +import Prelude ()
    +
    +import qualified Database.Orville.PostgreSQL.Plan as Plan
    +
    +{- |
    +  An operator alias of 'Plan.bind' so that it can be used with @QualifiedDo@.
    +-}
    +(>>=) ::
    +  Plan.Plan scope param a ->
    +  (Plan.Planned scope param a -> Plan.Plan scope param result) ->
    +  Plan.Plan scope param result
    +(>>=) = Plan.bind
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html new file mode 100644 index 0000000..082456c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Plan.html @@ -0,0 +1,689 @@ +
    {-# LANGUAGE GADTs #-}
    +{-# LANGUAGE RankNTypes #-}
    +module Database.Orville.PostgreSQL.Plan
    +  ( Plan
    +  , Planned
    +  , Execute
    +  , Explain
    +  , askParam
    +
    +  -- * Using a Plan after it is constructed
    +  , execute
    +  , explain
    +
    +  -- * Making a Plan to find rows in the database
    +  , findMaybeOne
    +  , findMaybeOneWhere
    +  , findOne
    +  , findOneShowVia
    +  , findOneWhere
    +  , findOneWhereShowVia
    +  , findAll
    +  , findAllWhere
    +
    +  -- * Creating a multi-step Plan from other Plan values
    +  , bind
    +  , use
    +  , using
    +  , chain
    +  , apply
    +  , planMany
    +  , planList
    +  , focusParam
    +  , planEither
    +  , planMaybe
    +
    +  -- * Bridges from other types into Plan
    +  , Op.AssertionFailed
    +  , assert
    +  , planSelect
    +  , planOperation
    +  ) where
    +
    +import           Data.Either (partitionEithers)
    +import qualified Control.Monad.Catch as Catch
    +
    +import qualified Database.Orville.PostgreSQL.Core as Core
    +import           Database.Orville.PostgreSQL.Internal.MappendCompat ((<>))
    +import           Database.Orville.PostgreSQL.Plan.Many (Many)
    +import qualified Database.Orville.PostgreSQL.Plan.Many as Many
    +import qualified Database.Orville.PostgreSQL.Plan.Operation as Op
    +import qualified Database.Orville.PostgreSQL.Plan.Explanation as Exp
    +import           Database.Orville.PostgreSQL.Select (Select)
    +
    +{-|
    +  A 'Plan' is an executable set of queries that can be executed to load data
    +  from the database, using the results of prior queries as input parameters to
    +  following queries in controlled ways. In particular, the "controlled" aspect
    +  of this allows plans that take a single input to be adapted to take multiple
    +  input parameters in a list without the resulting plan executing N+1 queries.
    +  This restriction means that while query results can be used as input
    +  parameters to later queries, they cannot be used to decide to run completely
    +  different queries based on other query results. Allowing this would prevent
    +  the 'Plan' structure from eliminating N+1 query loops.
    +
    +  Note that during execution queries are never combined across tables to form
    +  joins or subqueries. Queries are still executed in the same sequence as
    +  specified in the plan, just on all the inputs at once rather than in a loop.
    +  If you need to do a join with a plan, you can always construction your
    +  own custom 'Op.Operation' and use 'planOperation' to incorporate into a plan.
    +
    +  The @param@ type variable indicates what type of value is expected as input
    +  when the plan is executed.
    +
    +  The @result@ type for a plan indicates what Haskell type is produced
    +  when the plan is executed.
    +
    +  The @scope@ type is used internally by Orville to track the plan is currently
    +  executed against a single input or multiple inputs. This type parameter
    +  should never specified as a concrete type in user code, but must be exposed
    +  as a variable to ensure that execute scope is tracked correctly through
    +  usages of 'bind'.
    +
    +-}
    +data Plan scope param result where
    +  PlanOp :: Op.Operation param result -> Plan scope param result
    +
    +  PlanMany :: (forall manyScope. Plan manyScope param result)
    +           -> Plan scope [param] (Many param result)
    +
    +  PlanEither :: Plan scope leftParam leftResult
    +             -> Plan scope rightParam rightResult
    +             -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult)
    +
    +  Bind :: Plan scope param a
    +       -> (Planned scope param a -> Plan scope param result)
    +       -> Plan scope param result
    +
    +  Use :: Planned scope param a -> Plan scope param a
    +
    +  Pure :: a -> Plan scope param a
    +
    +  Apply :: Plan scope param (a -> b)
    +        -> Plan scope param a
    +        -> Plan scope param b
    +
    +  Chain :: Plan scope a b
    +        -> Plan scope b c
    +        -> Plan scope a c
    +
    +instance Functor (Plan scope param) where
    +  fmap f = Apply (Pure f)
    +
    +instance Applicative (Plan scope param) where
    +  pure = Pure
    +  (<*>) = Apply
    +
    +{-|
    +  'Execute' is a tag type used by as the 'scope' variable for
    +  'Plan' values when executing them via the 'execute' function.
    +-}
    +data Execute
    +
    +{-|
    +  'ExecuteMany' is an internal tag type used by as the 'scope' variable for
    +  'Plan' values when executing them against multiple inputs via the
    +  'executeMany' internal function.
    +-}
    +data ExecuteMany
    +
    +{-|
    +  A 'Planned' value is a wrapper around the results of previous run queries
    +  when using the 'bind' function. At the time that you are writing a plan you
    +  do not know whether the 'Plan' will be run with a single input or multiple
    +  inputs. A 'Planned' value may end up being either an individual item or a
    +  list of items. Due to this, your ability to interact with the value is
    +  limited to the use of 'fmap' to extract (or build) other values from the
    +  results. 'Planned' values can be used together with the 'use' function to
    +  make a 'Plan' that produces the extracted value.
    +
    +  Note that while 'Planned' could provide an 'Applicative' instance as well, it
    +  does not to avoid confusion with 'Applicative' instance for 'Plan' itself.
    +  If you need to build a value from several 'Planned' values using
    +  'Applicative', you should call 'use' on each of the values and use the
    +  'Applicative' instance for 'Plan'.
    +-}
    +data Planned scope param a where
    +  PlannedOne      :: a -> Planned Execute param a
    +  PlannedMany     :: Many k a -> Planned ExecuteMany k a
    +  PlannedExplain  :: Planned Explain param a
    +
    +instance Functor (Planned scope param) where
    +  fmap = mapPlanned
    +
    +{-|
    +  'mapPlanned' applies a function to what value or values have been produced by
    +  the plan. This function can also be called as 'fmap' or '<$>' thorugh the
    +  'Functor' instance for 'Planned'.
    +-}
    +mapPlanned :: (a -> b) -> Planned scope param a -> Planned scope param b
    +mapPlanned f planned =
    +  case planned of
    +    PlannedOne a ->
    +      PlannedOne (f a)
    +
    +    PlannedMany manyAs ->
    +      PlannedMany (fmap f manyAs)
    +
    +    PlannedExplain ->
    +      PlannedExplain
    +
    +{-|
    +  'resolveOne' resolves a 'Planned' value that is known to be in the 'One'
    +  scope to its single wrapped value.
    +-}
    +resolveOne :: Planned Execute param a -> a
    +resolveOne (PlannedOne a) = a
    +
    +{-|
    +  'resolveMany resolves a 'Planned' value that is known to be in the 'Many'
    +  scope to the 'Many' value wrapped inside it.
    +-}
    +resolveMany :: Planned ExecuteMany k a -> Many k a
    +resolveMany (PlannedMany as) = as
    +
    +{-|
    +  'planOperation' allows any primitive 'Op.Operation' to be used as an atomic step
    +  in a plan. When the plan is executed, the appropriate 'Op.Operation' functions
    +  will be used depending on the execution context.
    +-}
    +planOperation :: Op.Operation param result
    +              -> Plan scope param result
    +planOperation =
    +  PlanOp
    +
    +{-|
    +  'planSelect' allows any Orville 'Select' query to be incorporated into a
    +  plan. Note that the 'Select' cannot depend on the plan's input parameters in
    +  this case. If the plan is executed with multiple inputs the same set of all
    +  the results will be used as the results for each of the input parameters.
    +-}
    +planSelect :: Select row -> Plan scope () [row]
    +planSelect select =
    +  planOperation (Op.findSelect select)
    +
    +{-|
    +  'askParam' allows the input parameter for the plan to be retrieved as the
    +  result of the plan. Together with 'bind' you can use this to get access to
    +  the input parameter as a 'Planned' value.
    +-}
    +askParam :: Plan scope param param
    +askParam =
    +  planOperation Op.askParam
    +
    +{-|
    +  'findMaybeOne' constructs a 'Plan' that will find at most one row from
    +  the given table where the plan's input value matches the given database
    +  field.
    +-}
    +findMaybeOne :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Plan scope fieldValue (Maybe readEntity)
    +findMaybeOne tableDef fieldDef =
    +  planOperation (Op.findOne tableDef fieldDef)
    +
    +{-|
    +  'findMaybeOneWhere' is similar to 'findMaybeOne', but allows a
    +  'WhereCondition' to be specified to restrict which rows are matched by the
    +  database query.
    +-}
    +findMaybeOneWhere :: Ord fieldValue
    +                  => Core.TableDefinition readEntity writeEntity key
    +                  -> Core.FieldDefinition nullability fieldValue
    +                  -> Core.WhereCondition
    +                  -> Plan scope fieldValue (Maybe readEntity)
    +findMaybeOneWhere tableDef fieldDef cond =
    +  planOperation (Op.findOneWhere tableDef fieldDef cond)
    +
    +{-|
    +  'findOneShowVia' is similar to 'findMaybeOne, but it expects that there will
    +  always be a row found matching the plan's input value. If no row is found an
    +  'Op.AssertionFailed' exception will be thrown. This is a useful convenience
    +  when looking up foreign-key associations that are expected to be enforced by
    +  the database itself.
    +-}
    +findOneShowVia :: Ord fieldValue
    +               => (fieldValue -> String)
    +               -> Core.TableDefinition readEntity writeEntity key
    +               -> Core.FieldDefinition nullability fieldValue
    +               -> Plan scope fieldValue readEntity
    +findOneShowVia showParam tableDef fieldDef =
    +  assert
    +    (assertFound showParam tableDef fieldDef)
    +    (findMaybeOne tableDef fieldDef)
    +
    +{-|
    +  'findOne' is an alias to 'findOneShowVia' that uses the 'Show' instance of
    +  'fieldValue' when producing a failure message in the result the entity cannot
    +  be found.
    +-}
    +findOne :: (Show fieldValue, Ord fieldValue)
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Plan scope fieldValue readEntity
    +findOne tableDef fieldDef =
    +  assert
    +    (assertFound show tableDef fieldDef)
    +    (findMaybeOne tableDef fieldDef)
    +
    +{-|
    +  'findOneWhereShowVia' is similar to 'findOneShowVia', but allows a 'WhereCondition' to be
    +  specified to restrict which rows are matched by the database query.
    +-}
    +findOneWhereShowVia :: Ord fieldValue
    +                    => (fieldValue -> String)
    +                    -> Core.TableDefinition readEntity writeEntity key
    +                    -> Core.FieldDefinition nullability fieldValue
    +                    -> Core.WhereCondition
    +                    -> Plan scope fieldValue readEntity
    +findOneWhereShowVia showParam tableDef fieldDef cond =
    +  assert
    +    (assertFound showParam tableDef fieldDef)
    +    (findMaybeOneWhere tableDef fieldDef cond)
    +
    +{-|
    +  'findOneWhere' is an alias to 'findOneWhereShowVia' that uses the 'Show' instance of
    +  'fieldValue' when producing a failure message in the result the entity cannot
    +  be found.
    +-}
    +findOneWhere :: (Show fieldValue, Ord fieldValue)
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Plan scope fieldValue readEntity
    +findOneWhere = findOneWhereShowVia show
    +
    +{-|
    +  'assertFound' is an internal helper that checks that row was found where
    +  one was expected.
    +-}
    +assertFound :: (fieldValue -> String)
    +            -> Core.TableDefinition readEntity writeEntity key
    +            -> Core.FieldDefinition nullability fieldValue
    +            -> fieldValue
    +            -> Maybe result
    +            -> Either String result
    +assertFound showParam tableDef fieldDef param maybeRecord =
    +  case maybeRecord of
    +    Just a ->
    +      Right a
    +
    +    Nothing ->
    +      Left $
    +        unwords
    +          [ "Failed to find record in table"
    +          , Core.tableName tableDef
    +          , "where"
    +          , Core.fieldName fieldDef
    +          , " = "
    +          , showParam param
    +          ]
    +
    +{-|
    +  'findAll' constructs a 'Plan' that will find all the rows from the given
    +  table there the plan's input value matches the given database field.
    +-}
    +findAll :: Ord fieldValue
    +        => Core.TableDefinition readEntity writeEntity key
    +        -> Core.FieldDefinition nullability fieldValue
    +        -> Plan scope fieldValue [readEntity]
    +findAll tableDef fieldDef =
    +  planOperation (Op.findAll tableDef fieldDef)
    +
    +{-|
    +  'findAllWhere' is similar to 'findAll', but allows a 'WhereCondition' to be
    +  specified to restrict which rows are matched by the database query.
    +-}
    +findAllWhere :: Ord fieldValue
    +             => Core.TableDefinition readEntity writeEntity key
    +             -> Core.FieldDefinition nullability fieldValue
    +             -> Core.WhereCondition
    +             -> Plan scope fieldValue [readEntity]
    +findAllWhere tableDef fieldDef cond =
    +  planOperation (Op.findAllWhere tableDef fieldDef cond)
    +
    +{-|
    +  'planMany' adapts a plan that takes a single input parameter to work on
    +  multiple input parameters. When the new plan is executed each query will
    +  execute in the same basic order, but with adjusted conditions to find all the
    +  rows for all inputs at once rather than running the planned queries once for
    +  each input.
    +-}
    +planMany :: (forall manyScope. Plan manyScope param result)
    +         -> Plan scope [param] (Many param result)
    +planMany =
    +  PlanMany
    +
    +{-|
    +  'planList' lifts a plan so both its param and result become lists.
    +  This saves you from having to fmap in 'Many.elems' when all you want back
    +  from a 'Many' is the list of results inside it.
    +-}
    +planList :: (forall scope. Plan scope param result)
    +         -> Plan listScope [param] [result]
    +planList plan =
    +  Many.elems <$> planMany plan
    +
    +{-|
    +  'focusParam' builds a plan from a function and an existing plan taking the
    +  result of that function as input. This is especially useful when there is some
    +  structure, and a plan that only needs a part of that structure as input. The
    +  function argument can access part of the structure for the plan argument to use,
    +  so the final returned plan can take the entire structure as input.
    +-}
    +focusParam :: (a -> b)
    +           -> Plan scope b result
    +           -> Plan scope a result
    +focusParam focuser plan =
    +  chain (focuser <$> askParam) plan
    +
    +
    +{-|
    +  'planEither' lets you construct a plan that branches by executing a different
    +  plan for the 'Left' and 'Right' sides of an 'Either' value. When used with a
    +  single input parameter only one of the two plans will be used, based on the
    +  input parameter. When used on multiple input parameters, each of the two
    +  plans will be executed only once with all the 'Left' and 'Right' values
    +  provided as input parameters respectively.
    +-}
    +planEither :: Plan scope leftParam leftResult
    +           -> Plan scope rightParam rightResult
    +           -> Plan scope (Either leftParam rightParam) (Either leftResult rightResult)
    +planEither =
    +  PlanEither
    +
    +{-|
    +  'planMaybe' lifts a plan so both its param and result become 'Maybe's. This is
    +  useful when modifying an existing plan to deal with optionality. Writing just
    +  one plan can then easily produce both the required and optional versions.
    +-}
    +planMaybe :: Plan scope a b -> Plan scope (Maybe a) (Maybe b)
    +planMaybe plan =
    +  focusParam (maybe (Left ()) Right) $
    +    either id id <$> planEither (pure Nothing) (Just <$> plan)
    +
    +{-|
    +  'bind' gives access to the results of a plan to use as input values to future
    +  plans. The plan result is given the input parameter to the provided function,
    +  which must produce the remaining 'Plan' to be executed. The value will be
    +  wrapped in the 'Planned' type, which may represent either a result or
    +  multiple results, depending on whether one plan is currently be executed with
    +  one and multiple input parameters. This ensures that the caller produces only
    +  a single remaining 'Plan' to be used for all inputs when there are multiple
    +  to eliminate the need to possibly run different queries for different inputs
    +  (which would an introduce N+1 query execution).
    +
    +  The 'Planned' value (or values) provided by 'bind' have actually been
    +  retrieved from the database, so the value can be used multiple times when
    +  constructing the remaining 'Plan' without fear of causing the query to run
    +  multiple times.
    +
    +  Also see 'use' for how to lift a 'Planned' value back into a 'Plan'.
    +-}
    +bind :: Plan scope param a
    +     -> (Planned scope param a -> Plan scope param result)
    +     -> Plan scope param result
    +bind =
    +  Bind
    +
    +{-|
    +  'use' constructs a 'Plan' that always produces the 'Planned' value
    +  as its result, regardless of the parameter given as input to the plan.
    +-}
    +use :: Planned scope param a -> Plan scope param a
    +use =
    +  Use
    +
    +{-|
    +  'using' uses a 'Planned' value in the input to another 'Plan'. The
    +  resulting plan will ignore its input and use the 'Planned' value as
    +  the input to produce its result instead.
    +-}
    +using :: Planned scope param a
    +      -> Plan scope a b
    +      -> Plan scope param b
    +using planned plan =
    +  chain (use planned) plan
    +
    +{-|
    +  'apply' applies a function produced by a plan to the value produced
    +  by another plan. This is usually used via the '<*>' operator through
    +  the 'Applicative' instance for 'Plan'.
    +-}
    +apply :: Plan scope param (a -> b)
    +      -> Plan scope param a
    +      -> Plan scope param b
    +apply =
    +  Apply
    +
    +{-|
    +  'chain' connects the output of one plan to the input of another to form a
    +  larger plan that will execute the first followed by the second.
    +-}
    +chain :: Plan scope a b
    +      -> Plan scope b c
    +      -> Plan scope a c
    +chain =
    +  Chain
    +
    +{-|
    +  'assert' allows you to make an assertion about a plans result that will throw
    +  an 'Op.AssertionFailed' failed exception during execution if it proves to be
    +  false. The first parameter is the assertion function, which should return
    +  either an error message to be given in the exception or the value to be used
    +  as the plan's result.
    +-}
    +assert :: (param -> a -> Either String b)
    +       -> Plan scope param a
    +       -> Plan scope param b
    +assert assertion aPlan =
    +  let
    +    eitherPlan =
    +      assertion
    +        <$> askParam
    +        <*> aPlan
    +  in
    +    chain eitherPlan (PlanOp Op.assertRight)
    +
    +{-|
    +  'execute' accepts the input parameter (or parameters) expected by a 'Plan'
    +  and runs the plan to completion, either throwing an 'Op.AssertionFailed'
    +  exception in the monad 'm' or producing the expected result.
    +
    +  If you have a plan that takes one input and want to provide a list of
    +  input, use 'planMany' to adapt it to a multple-input plan before calling
    +  'execute'.
    +-}
    +execute :: Core.MonadOrville conn m
    +        => Plan Execute param result
    +        -> param
    +        -> m result
    +execute plan param =
    +  executeOne plan param
    +
    +{-|
    +  'executeOne' is an internal helper that executes a 'Plan' with a concrete
    +  'scope' type to ensure all 'Planned' values are built with 'PlannedOne'.
    +-}
    +executeOne :: Core.MonadOrville conn m
    +           => Plan Execute param result
    +           -> param
    +           -> m result
    +executeOne plan param =
    +  case plan of
    +    PlanOp operation -> do
    +      opResult <- Op.executeOperationOne operation param
    +
    +      case opResult of
    +        Left err ->
    +          Catch.throwM err
    +
    +        Right result ->
    +          pure result
    +
    +    PlanMany manyPlan ->
    +      executeMany manyPlan param
    +
    +    PlanEither leftPlan rightPlan ->
    +      case param of
    +        Left leftParam ->
    +          Left <$> executeOne leftPlan leftParam
    +
    +        Right rightParam ->
    +          Right <$> executeOne rightPlan rightParam
    +
    +    Bind intermPlan continue -> do
    +      interm <- executeOne intermPlan param
    +      executeOne
    +        (continue (PlannedOne interm))
    +        param
    +
    +    Use planned ->
    +      pure . resolveOne $ planned
    +
    +    Pure a ->
    +      pure a
    +
    +    Apply planF planA ->
    +      executeOne planF param <*> executeOne planA param
    +
    +    Chain planAB planBC -> do
    +      b <- executeOne planAB param
    +      executeOne planBC b
    +
    +{-|
    +  'executeMany' is an internal helper that executes a 'Plan' with a concrete
    +  @scope@ type to ensure all 'Planned' values are built with 'PlannedMany'.
    +-}
    +executeMany :: Core.MonadOrville conn m
    +            => Plan ExecuteMany param result
    +            -> [param]
    +            -> m (Many.Many param result)
    +executeMany plan params =
    +  case plan of
    +    PlanOp operation -> do
    +      opResult <- Op.executeOperationMany operation params
    +
    +      case opResult of
    +        Left err ->
    +          Catch.throwM $ err
    +
    +        Right results ->
    +          pure results
    +
    +    PlanMany manyPlan -> do
    +      let
    +        flatParams = concat params
    +
    +      allResults <- executeMany manyPlan flatParams
    +
    +      let
    +        restrictResults subParams =
    +          Many.fromKeys subParams (\k -> Many.lookup k allResults)
    +
    +      pure $ Many.fromKeys params (Right . restrictResults)
    +
    +    PlanEither leftPlan rightPlan -> do
    +      let
    +        (leftParams, rightParams) = partitionEithers params
    +
    +      leftResults <- executeMany leftPlan leftParams
    +      rightResults <- executeMany rightPlan rightParams
    +
    +      let
    +        eitherResult eitherK =
    +          case eitherK of
    +            Left k ->
    +              Left <$> Many.lookup k leftResults
    +
    +            Right k ->
    +              Right <$> Many.lookup k rightResults
    +
    +      pure $ Many.fromKeys params eitherResult
    +
    +    Bind intermPlan continue -> do
    +      interms <- executeMany intermPlan params
    +      executeMany
    +        (continue (PlannedMany interms))
    +        params
    +
    +    Use planned ->
    +      pure . resolveMany $ planned
    +
    +    Pure a ->
    +      pure $ Many.fromKeys params (const (Right a))
    +
    +    Apply planF planA -> do
    +      manyFs <- executeMany planF params
    +      manyAs <- executeMany planA params
    +
    +      pure (Many.apply manyFs manyAs)
    +
    +    Chain planAB planBC -> do
    +      bs <- executeMany planAB params
    +      cs <- executeMany planBC (Many.elems bs)
    +      pure $ Many.compose cs bs
    +
    +{-|
    +  'Explain' is an tag type used as the 'scope' variable when explaining a
    +  'Plan' via the 'explain' function.
    +-}
    +data Explain
    +  = ExplainOne
    +  | ExplainMany
    +
    +{-|
    +  'explain' produces a textual description of the steps outlined by
    +  a 'Plan' -- in most cases example SQL queries. If you want to see
    +  the explanation of how the plan will run with multiple input parameters,
    +  you can use 'planMany' to adapt it before calling 'explain'.
    +-}
    +explain :: Plan Explain param result -> [String]
    +explain plan =
    +  Exp.explanationSteps $
    +    explainPlan ExplainOne plan
    +
    +{-|
    +  'explainPlan' is an internal helper to executes a plan with the
    +  'scope' type fixed to 'Explain' to ensure that all 'Planned'
    +  values are constructed with the 'PlannedExplain' constructor.
    +-}
    +explainPlan :: Explain
    +            -> Plan Explain param result
    +            -> Exp.Explanation
    +explainPlan mult plan =
    +  case plan of
    +    PlanOp operation -> do
    +      case mult of
    +        ExplainOne ->
    +          Op.explainOperationOne operation
    +
    +        ExplainMany ->
    +          Op.explainOperationMany operation
    +
    +    PlanMany manyPlan -> do
    +      explainPlan ExplainMany manyPlan
    +
    +    PlanEither leftPlan rightPlan ->
    +      explainPlan mult leftPlan <> explainPlan mult rightPlan
    +
    +    Bind intermPlan continue ->
    +      let
    +        nextPlan = continue PlannedExplain
    +      in
    +        explainPlan mult intermPlan <> explainPlan mult nextPlan
    +
    +    Use _ ->
    +      Exp.noExplanation
    +
    +    Pure _ ->
    +      Exp.noExplanation
    +
    +    Apply planF planA -> do
    +      explainPlan mult planF <> explainPlan mult planA
    +
    +    Chain planAB planBC -> do
    +      explainPlan mult planAB <> explainPlan mult planBC
    +
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html new file mode 100644 index 0000000..8e324d2 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Popper.html @@ -0,0 +1,589 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Popper
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +{-# LANGUAGE FlexibleContexts #-}
    +{-# LANGUAGE GADTs #-}
    +{-# LANGUAGE RankNTypes #-}
    +
    +module Database.Orville.PostgreSQL.Popper
    +  ( PopError(..)
    +  , Popper
    +  , Popped(..)
    +  , (>>>)
    +  , (<<<)
    +  , abortPop
    +  , certainly
    +  , certainly'
    +  , fromKern
    +  , hasMany
    +  , hasManyIn
    +  , hasOneIn
    +  , hasManyInWhere
    +  , hasManyWhere
    +  , hasOne
    +  , hasOne'
    +  , hasOneWhere
    +  , kern
    +  , popMissingRecord
    +  , onKern
    +  , pop
    +  , popThrow
    +  , popFirst
    +  , popMany
    +  , onPopMany
    +  , popMaybe
    +  , popQuery
    +  , popRecord
    +  , popRecord'
    +  , popTable
    +  , explain
    +  , explainLines
    +  ) where
    +
    +import Prelude hiding ((.))
    +
    +import Control.Applicative
    +import Control.Arrow
    +import Control.Category
    +import Control.Monad.Catch
    +import Data.Either
    +import Data.List (intercalate)
    +import qualified Data.Map.Strict as Map
    +import Data.Maybe
    +
    +import Database.Orville.PostgreSQL.Core
    +import Database.Orville.PostgreSQL.Internal.QueryCache
    +import Database.Orville.PostgreSQL.Internal.SelectOptions
    +
    +-- Simple helpers and such that make the public API
    +kern :: Popper a a
    +kern = PopId
    +
    +fromKern :: (a -> b) -> Popper a b
    +fromKern f = f <$> kern
    +
    +onKern :: (a -> b -> c) -> Popper b a -> Popper b c
    +onKern mkPuff popper = mkPuff <$> popper <*> kern
    +
    +liftPop :: (a -> Popped b) -> Popper a b
    +liftPop = PopLift
    +
    +abortPop :: PopError -> Popper a b
    +abortPop = PopAbort
    +
    +{-|
    +   popQuery embeds an Orville operation in a popper. It is left up to the
    +   programmer to ensure that the Orville operation does not do any updates
    +   to the database, but only does queries.
    +
    +   The initial string argument is a description of the query to put into
    +   the results of `explain`
    +-}
    +popQuery ::
    +     String
    +  -> (forall conn m. MonadOrville conn m =>
    +                       m b)
    +  -> Popper a b
    +popQuery explanation orville = PopPrim (PrimQuery explanation orville)
    +
    +certainly :: PopError -> Popper (Maybe b) b
    +certainly err = liftPop $ maybe (PoppedError err) PoppedValue
    +
    +certainly' :: Popper a PopError -> Popper a (Maybe b) -> Popper a b
    +certainly' msgPopper bPopper =
    +  (msgPopper &&& bPopper) >>>
    +  liftPop (\(err, maybeB) -> maybe (PoppedError err) PoppedValue maybeB)
    +
    +popRecord ::
    +     TableDefinition readEntity writeEntity key
    +  -> key
    +  -> Popper a (Maybe readEntity)
    +popRecord tableDef key = popQuery explanation (findRecord tableDef key)
    +  where
    +    explanation = "popRecord " ++ tableName tableDef
    +
    +popRecord' ::
    +     TableDefinition readEntity writeEntity key -> key -> Popper a readEntity
    +popRecord' td key = popRecord td key >>> certainly err
    +  where
    +    err = MissingRecord td (tablePrimaryKey td) key
    +
    +popFirst ::
    +     TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> Popper a (Maybe readEntity)
    +popFirst tableDef opts = popQuery explanation (selectFirst tableDef opts)
    +  where
    +    explanation = "popFirst " ++ tableName tableDef
    +
    +popTable ::
    +     TableDefinition readEntity writeEntity key
    +  -> SelectOptions
    +  -> Popper a [readEntity]
    +popTable tableDef opts = popQuery explanation (selectAll tableDef opts)
    +  where
    +    explanation =
    +      "popTable " ++ tableName tableDef ++ " " ++ selectOptClause opts
    +
    +popMaybe :: Popper a b -> Popper (Maybe a) (Maybe b)
    +popMaybe = PopMaybe
    +
    +hasMany ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue [readEntity]
    +hasMany tableDef fieldDef = PopPrim (PrimRecordManyBy tableDef fieldDef mempty)
    +
    +hasOneIn ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper [fieldValue] (Map.Map fieldValue readEntity)
    +hasOneIn tableDef fieldDef = PopPrim (PrimRecordsBy tableDef fieldDef mempty)
    +
    +hasManyIn ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper [fieldValue] (Map.Map fieldValue [readEntity])
    +hasManyIn tableDef fieldDef =
    +  PopPrim (PrimRecordsManyBy tableDef fieldDef mempty)
    +
    +hasManyWhere ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> Popper fieldValue [readEntity]
    +hasManyWhere tableDef fieldDef opts =
    +  PopPrim (PrimRecordManyBy tableDef fieldDef opts)
    +
    +hasManyInWhere ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> Popper [fieldValue] (Map.Map fieldValue [readEntity])
    +hasManyInWhere tableDef fieldDef opts =
    +  PopPrim (PrimRecordsManyBy tableDef fieldDef opts)
    +
    +hasOne ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue (Maybe readEntity)
    +hasOne tableDef fieldDef = hasOneWhere tableDef fieldDef mempty
    +
    +hasOneWhere ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> SelectOptions
    +  -> Popper fieldValue (Maybe readEntity)
    +hasOneWhere tableDef fieldDef opts =
    +  PopPrim (PrimRecordBy tableDef fieldDef opts)
    +
    +hasOne' ::
    +     Ord fieldValue
    +  => TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue readEntity
    +hasOne' tableDef fieldDef =
    +  certainly' (popMissingRecord tableDef fieldDef) (hasOne tableDef fieldDef)
    +
    +popMissingRecord ::
    +     TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> Popper fieldValue PopError
    +popMissingRecord tableDef fieldDef = fromKern (MissingRecordBy tableDef fieldDef)
    +
    +-- popMany is the most involved helper. It recursively
    +-- rewrites the entire Popper expression to avoid
    +-- running the popper's queries individually for each
    +-- item in the list.
    +--
    +-- This is where the magic happens.
    +--
    +popMany :: Popper a b -> Popper [a] [b]
    +popMany (PopOnMany _ manyPopper) = manyPopper
    +popMany (PopPrim (PrimRecordBy tableDef fieldDef selectOptions)) =
    +  zipWith Map.lookup <$> kern <*>
    +  (repeat <$> PopPrim (PrimRecordsBy tableDef fieldDef selectOptions))
    +popMany (PopPrim (PrimRecordManyBy tableDef fieldDef opts)) =
    +  zipWith getRecords <$> kern <*>
    +  (repeat <$> PopPrim (PrimRecordsManyBy tableDef fieldDef opts))
    +  where
    +    getRecords key = fromMaybe [] . Map.lookup key
    +popMany (PopPrim (PrimRecordsManyBy tableDef fieldDef opts)) =
    +  (zipWith restrictMap) <$> kern <*>
    +  (fromKern concat >>>
    +   PopPrim (PrimRecordsManyBy tableDef fieldDef opts) >>> fromKern repeat)
    +  where
    +    restrictMap keys = Map.filterWithKey (isKey keys)
    +    isKey keys key _ = key `elem` keys
    +popMany (PopPrim (PrimRecordsBy tableDef fieldDef opts)) =
    +  (zipWith restrictMap) <$> kern <*>
    +  (fromKern concat >>>
    +   PopPrim (PrimRecordsBy tableDef fieldDef opts) >>> fromKern repeat)
    +  where
    +    restrictMap keys = Map.filterWithKey (isKey keys)
    +    isKey keys key _ = key `elem` keys
    +popMany PopId = PopId
    +popMany (PopAbort err) = (PopAbort err)
    +popMany (PopPure a)
    +  -- Important: Even though lists are ZipLists in the context of popMany, it is
    +  -- important that the popMany version of pure actual examines its input and
    +  -- produces the correct number of outputs. Using `repeat` here can produce
    +  -- a list of infinite results for a finite input list, which can then ultimately
    +  -- create an infinite loop when zipped without non-finite lists. Instead of
    +  -- using `repeat` here we use `map` to product *exactly a many as* as there are
    +  -- input values.
    + = PopLift (PoppedValue . map (const a))
    +popMany (PopLift f) =
    +  PopLift $ \inputs ->
    +    let poppeds = map f inputs
    +        extract (PoppedValue b) (PoppedValue bs) = PoppedValue (b : bs)
    +        extract _ (PoppedError err) = PoppedError err
    +        extract (PoppedError err) _ = PoppedError err
    +     in foldr extract (PoppedValue []) poppeds
    +popMany (PopMap f popper) = PopMap (fmap f) (popMany popper)
    +popMany (PopApply fPopper aPopper) =
    +  getZipList <$>
    +  PopApply
    +    (fmap (<*>) (ZipList <$> popMany fPopper))
    +    (ZipList <$> popMany aPopper)
    +popMany (PopChain bPopper aPopper) =
    +  PopChain (popMany bPopper) (popMany aPopper)
    +popMany (PopArrowFirst popper) =
    +  fromKern unzip >>> first (popMany popper) >>> fromKern (uncurry zip)
    +popMany (PopArrowLeft popper) =
    +  rebuildList <$> kern <*> (fromKern lefts >>> popMany popper)
    +  where
    +    rebuildList [] _ = []
    +    rebuildList (Left _:_) [] = [] -- shouldn't happen?
    +    rebuildList (Right c:eacs) bs = Right c : rebuildList eacs bs
    +    rebuildList (Left _:eacs) (b:bs) = Left b : rebuildList eacs bs
    +popMany (PopMaybe singlePopper) =
    +  rebuildList <$> kern <*> (fromKern catMaybes >>> popMany singlePopper)
    +  where
    +    rebuildList [] _ = []
    +    rebuildList (Just _:_) [] = [] -- shouldn't happen?
    +    rebuildList (Nothing:as) bs = Nothing : rebuildList as bs
    +    rebuildList (Just _:as) (b:bs) = Just b : rebuildList as bs
    +popMany (PopPrim (PrimQuery explanation orm))
    +  -- the orm query here doesn't depend on the Popper input,
    +  -- so we can run it once and then construct an infinite
    +  -- list of the results to be lined up as the outputs for
    +  -- each input in the list
    +  --
    +  -- ('repeat' is 'pure' since lists here are zipped)
    +  --
    + = PopPrim (PrimQuery explanation (repeat <$> orm))
    +
    +-- Manually specifies the many handling of a popper. The original popper
    +-- is lift unchanged. If it becomes involved in a `popMany` operation, the
    +-- provided popper with be substituted for it, rather than apply the normal
    +-- popper re-write rules.
    +--
    +-- This is useful if either of the cases can manually optimized in a way that
    +-- is incompatible with the normal popping mechanisms
    +--
    +onPopMany :: Popper a b -> Popper [a] [b] -> Popper a b
    +onPopMany = PopOnMany
    +
    +-- The Popper guts
    +data PopError
    +  = forall readEntity writeEntity key.
    +    MissingRecord (TableDefinition readEntity writeEntity key)
    +                  (PrimaryKey key)
    +                  key
    +
    +  | forall readEntity writeEntity key fieldValue nullability.
    +    MissingRecordBy (TableDefinition readEntity writeEntity key)
    +                    (FieldDefinition nullability fieldValue)
    +                    fieldValue
    +
    +  | Unpoppable String
    +
    +instance Show PopError where
    +  show (MissingRecord tableDef keyDef keyValue) =
    +    "MissingRecord: " ++ missingRecordMessage tableDef keyDef keyValue
    +
    +  show (MissingRecordBy tableDef fieldDef fieldValue) =
    +    "MissingRecord: " ++ missingRecordByMessage tableDef fieldDef fieldValue
    +
    +  show (Unpoppable msg) = "Unpoppable: " ++ msg
    +
    +missingRecordMessage ::
    +     TableDefinition readEntity writeEntity key
    +  -> PrimaryKey key
    +  -> key
    +  -> String
    +missingRecordMessage tableDef keyDef keyValue =
    +  concat
    +    [ "Unable to find "
    +    , tableName tableDef
    +    , " with "
    +    , primaryKeyDescription keyDef
    +    , " = "
    +    , show (primaryKeyToSql keyDef keyValue)
    +    ]
    +
    +missingRecordByMessage ::
    +     TableDefinition readEntity writeEntity key
    +  -> FieldDefinition nullability fieldValue
    +  -> fieldValue
    +  -> String
    +missingRecordByMessage tableDef fieldDef fieldValue =
    +  concat
    +    [ "Unable to find "
    +    , tableName tableDef
    +    , " with "
    +    , fieldName fieldDef
    +    , " = "
    +    , show (fieldToSqlValue fieldDef fieldValue)
    +    ]
    +
    +instance Exception PopError
    +
    +data Popped a
    +  = PoppedValue a
    +  | PoppedError PopError
    +
    +instance Functor Popped where
    +  fmap f (PoppedValue a) = PoppedValue (f a)
    +  fmap _ (PoppedError err) = PoppedError err
    +
    +instance Applicative Popped where
    +  pure = PoppedValue
    +  (PoppedValue f) <*> (PoppedValue a) = PoppedValue (f a)
    +  (PoppedError err) <*> _ = PoppedError err
    +  _ <*> (PoppedError err) = PoppedError err
    +
    +-- Prim GADT. This defines the core database operations that can be performed
    +-- as part of popping.
    +--
    +data Prim a b
    +  -- The trivial primitive
    +      where
    +  PrimQuery
    +    :: String
    +    -> (forall conn m. MonadOrville conn m =>
    +                         m b)
    +    -> Prim a b
    +  -- The singlar primitives
    +  PrimRecordBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim fieldValue (Maybe readEntity)
    +  PrimRecordManyBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim fieldValue [readEntity]
    +  --  The many primitives (each of these is a fixed point -- its own many)
    +  PrimRecordsBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim [fieldValue] (Map.Map fieldValue readEntity)
    +  PrimRecordsManyBy
    +    :: Ord fieldValue
    +    => TableDefinition readEntity writeEntity key
    +    -> FieldDefinition nullability fieldValue
    +    -> SelectOptions
    +    -> Prim [fieldValue] (Map.Map fieldValue [readEntity])
    +
    +-- Popper GADT. This defines the popper expression dsl
    +-- that is used internally to represent poppers. These
    +-- constructors are not exposed, so they can be changed
    +-- freely as long as the exported API is stable.
    +--
    +data Popper a b where
    +  PopPrim :: Prim a b -> Popper a b
    +  PopId :: Popper a a
    +  PopPure :: b -> Popper a b
    +  PopLift :: (a -> Popped b) -> Popper a b
    +  PopAbort :: PopError -> Popper a b
    +  PopMap :: (b -> c) -> Popper a b -> Popper a c
    +  PopApply :: Popper a (b -> c) -> Popper a b -> Popper a c
    +  PopChain :: Popper b c -> Popper a b -> Popper a c
    +  PopArrowFirst :: Popper a b -> Popper (a, c) (b, c)
    +  PopArrowLeft :: Popper a b -> Popper (Either a c) (Either b c)
    +  PopOnMany :: Popper a b -> Popper [a] [b] -> Popper a b
    +  PopMaybe :: Popper a b -> Popper (Maybe a) (Maybe b)
    +
    +instance Functor (Popper a) where
    +  fmap = PopMap
    +
    +instance Applicative (Popper a) where
    +  pure = PopPure
    +  (<*>) = PopApply
    +
    +instance Category Popper where
    +  id = PopId
    +  (.) = PopChain
    +
    +instance Arrow Popper where
    +  arr = fromKern
    +  first = PopArrowFirst
    +
    +instance ArrowChoice Popper where
    +  left = PopArrowLeft
    +
    +popThrow :: MonadOrville conn m => Popper a b -> a -> m b
    +popThrow popper a = do
    +  popped <- pop popper a
    +  case popped of
    +    PoppedValue b -> return b
    +    PoppedError e -> throwM e
    +
    +-- This is where the action happens. pop converts the
    +-- Popper DSL into Orville calls with the provided input
    +--
    +pop :: MonadOrville conn m => Popper a b -> a -> m (Popped b)
    +pop popper a = runQueryCached $ popCached popper a
    +
    +popPrim ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => Prim a b
    +  -> a
    +  -> QueryCached m (Popped b)
    +popPrim (PrimQuery _ query) _ = PoppedValue <$> unsafeLift query
    +popPrim (PrimRecordBy tableDef fieldDef opts) recordId =
    +  PoppedValue <$>
    +  selectFirstCached tableDef (where_ (fieldDef .== recordId) <> opts)
    +popPrim (PrimRecordManyBy tableDef fieldDef opts) recordId =
    +  PoppedValue <$>
    +  selectCached tableDef (where_ (fieldDef .== recordId) <> opts)
    +popPrim (PrimRecordsBy tableDef fieldDef opts) recordIds =
    +  PoppedValue <$> Map.map head <$>
    +  findRecordsByCached
    +    tableDef
    +    fieldDef
    +    (where_ (fieldDef .<- recordIds) <> opts)
    +popPrim (PrimRecordsManyBy tableDef fieldDef opts) recordIds =
    +  PoppedValue <$>
    +  findRecordsByCached
    +    tableDef
    +    fieldDef
    +    (where_ (fieldDef .<- recordIds) <> opts)
    +
    +popCached ::
    +     (MonadThrow m, MonadOrville conn m)
    +  => Popper a b
    +  -> a
    +  -> QueryCached m (Popped b)
    +popCached (PopOnMany singlePopper _) a = popCached singlePopper a
    +popCached (PopPrim prim) a = popPrim prim a
    +popCached (PopAbort err) _ = pure (PoppedError err)
    +popCached PopId a = pure (PoppedValue a)
    +popCached (PopPure a) _ = pure (PoppedValue a)
    +popCached (PopLift f) a = pure (f a)
    +popCached (PopMap f popper) a = fmap f <$> popCached popper a
    +popCached (PopApply fPopper bPopper) a =
    +  (fmap (<*>) (popCached fPopper a)) <*> popCached bPopper a
    +popCached (PopChain popperB popperA) a = do
    +  value <- popCached popperA a
    +  case value of
    +    PoppedError err -> pure (PoppedError err)
    +    PoppedValue b -> popCached popperB b
    +popCached (PopArrowFirst popper) (a, c) = do
    +  poppedB <- popCached popper a
    +  case poppedB of
    +    PoppedValue b -> return (PoppedValue (b, c))
    +    PoppedError err -> return (PoppedError err)
    +popCached (PopArrowLeft popper) ac = do
    +  case ac of
    +    Left a -> fmap Left <$> popCached popper a
    +    Right c -> pure (PoppedValue (Right c))
    +popCached (PopMaybe popper) a =
    +  case a of
    +    Nothing -> pure (PoppedValue Nothing)
    +    Just val -> fmap Just <$> popCached popper val
    +
    +explain :: Popper a b -> String
    +explain = unlines . explainLines
    +
    +explainLines :: Popper a b -> [String]
    +explainLines subject =
    +  case subject of
    +    PopPrim prim -> explainLinesPrim prim
    +    PopId -> []
    +    PopPure _ -> []
    +    PopLift _ -> []
    +    PopAbort _ -> []
    +    PopMap _ popper -> explainLines popper
    +    -- Note the argument order to PopApply in comparison to PopChain below
    +    PopApply popperA popperB -> explainLines popperA ++ explainLines popperB
    +    -- Note the argument order to PopApply in comparison to PopApply above
    +    PopChain popperB popperA -> explainLines popperA ++ explainLines popperB
    +    PopArrowFirst popper -> explainLines popper
    +    PopArrowLeft popper -> explainLines popper
    +    PopOnMany singlePopper _
    +      -- If a `PopOnMany` is left in the tree at the time of execution, it
    +      -- always represents a single pop. Other `popMany` would have removed
    +      -- it from the tree and replaced it with a direct reference to the many
    +      -- popper that it holds.
    +     -> explainLines singlePopper
    +    PopMaybe popper -> explainLines popper
    +
    +explainLinesPrim :: Prim a b -> [String]
    +explainLinesPrim prim =
    +  case prim of
    +    PrimQuery explanation _ -> [explanation]
    +    PrimRecordBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              ["fetch one", entity, "by one", field, explainSelectOpts opts]
    +          ]
    +    PrimRecordManyBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              ["fetch many", entity, "by one", field, explainSelectOpts opts]
    +          ]
    +    PrimRecordsBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              [ "fetch many"
    +              , entity
    +              , "by many"
    +              , field
    +              , "(1-1)"
    +              , explainSelectOpts opts
    +              ]
    +          ]
    +    PrimRecordsManyBy tableDef fieldDef opts ->
    +      let entity = tableName tableDef
    +          field = fieldName fieldDef
    +       in [ intercalate
    +              " "
    +              [ "fetch many"
    +              , entity
    +              , "by many"
    +              , field
    +              , "(*-1)"
    +              , explainSelectOpts opts
    +              ]
    +          ]
    +
    +explainSelectOpts :: SelectOptions -> String
    +explainSelectOpts opts =
    +  let clause = selectOptClause opts
    +   in if any (/= ' ') clause
    +        then concat ["(", clause, "("]
    +        else ""
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html new file mode 100644 index 0000000..5a1eb1f --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Raw.html @@ -0,0 +1,94 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Raw
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Raw
    +  ( selectSql
    +  , selectSqlRows
    +  , decodeSqlRows
    +  , ResultSet
    +  , updateSql
    +  , withConnection
    +  , withTransaction
    +  , withCachedConnection
    +  ) where
    +
    +import Control.Exception (finally)
    +import Control.Monad
    +import Control.Monad.IO.Class
    +import Data.IORef
    +import Database.HDBC hiding (withTransaction)
    +
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Types
    +import Database.Orville.PostgreSQL.Select
    +
    +selectSqlRows :: MonadOrville conn m => String -> [SqlValue] -> m ResultSet
    +selectSqlRows sql values = runSelect $ selectQueryRawRows sql values
    +
    +selectSql ::
    +     MonadOrville conn m
    +  => String
    +  -> [SqlValue]
    +  -> FromSql result
    +  -> m [result]
    +selectSql sql values builder = runSelect $ selectQueryRaw builder sql values
    +
    +updateSql :: MonadOrville conn m => String -> [SqlValue] -> m Integer
    +updateSql sql values =
    +  withConnection $ \conn -> do
    +    executingSql UpdateQuery sql $ do run conn sql values
    +
    +startTransaction :: ConnectionEnv conn -> ConnectionEnv conn
    +startTransaction c = c {ormTransactionOpen = True}
    +
    +{-|
    +  Migration Guide: @withCachedConnection@ has been renamed to @withConnection_@
    +
    +  Runs an action with a cached connection.
    +  Without using this, or wrapping calls in a transaction using `withTransaction`, successive
    +  calls to functions like `insertRecord` and `updateRecord` are *not* guaranteed to occur on the
    +  same connection.
    +-}
    +withCachedConnection :: MonadOrville conn m => m a -> m a
    +withCachedConnection action =
    +  withConnectionEnv (const action)
    +
    +{-|
    +  Migration Guide: @withTransaction@ retains the same name.
    +-}
    +withTransaction :: MonadOrville conn m => m a -> m a
    +withTransaction action =
    +  withConnectionEnv $ \connected ->
    +    if ormTransactionOpen connected
    +      then action
    +      else localOrvilleEnv
    +             (setConnectionEnv $ startTransaction connected)
    +             doTransaction
    +  where
    +    doTransaction =
    +      withConnection $ \conn -> do
    +        txnCallback <- ormEnvTransactionCallback <$> getOrvilleEnv
    +        committed <- liftIO $ newIORef False
    +        startTran <- startTransactionSQL
    +        let doAction = do
    +              liftIO $ do
    +                (executeRaw =<< prepare conn startTran)
    +                txnCallback TransactionStart
    +              value <- action
    +              liftIO $ do
    +                commit conn
    +                writeIORef committed True
    +                txnCallback TransactionCommit
    +              return value
    +        let rollbackUncommitted =
    +              liftIO $ do
    +                finished <- readIORef committed
    +                when (not finished) $ do
    +                  rollback conn
    +                  txnCallback TransactionRollback
    +        liftFinally finally doAction rollbackUncommitted
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html new file mode 100644 index 0000000..dcff32f --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.ResourceT.html @@ -0,0 +1,71 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Internal.Monad
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +'Database.Orville.PostgreSQL.ResourceT' provides 'ResourceT' instance of the Orville typeclasses for situations
    +where you might need it. In particular, if you are using the conduit library, you
    +may want to wrap 'ResourceT' around your normal monad stack, in which case you'll need
    +the 'MonadOrville' instance provided here to use 'selectConduit'.
    +
    +These instances are not included in the default exports for Orville because the required
    +either a 'MonadUnliftIO' or 'MonadBaseControl' instance of the monad underlying 'ResourceT',
    +depending on the version of 'ResourceT' you are using. For resource-1.1.10 and above you
    +must provide 'MonadUnliftIO' instance. For versions prior to 1.1.10 you must provide a
    +'MonadBaseControl' instance.
    +
    +This is required by 'MonadOrville' requires an instance to 'MonadBaseControl' to be defined.
    +The instance provided here can only use one lifting strategy, one we choose 'MonadUnliftIO'
    +wherever possible (both by our own opinion and because later versions of 'ResourceT' have
    +removed 'MonadBaseControl' support). 'MonadBaseControl' is used for versions of 'ResourceT'
    +before 'ResourceT' supported 'MonadUnliftIO'.
    +-}
    +{-# LANGUAGE CPP #-}
    +{-# LANGUAGE FlexibleInstances #-}
    +{-# LANGUAGE UndecidableInstances #-}
    +
    +module Database.Orville.PostgreSQL.ResourceT
    +  (
    +  ) where
    +
    +import Control.Monad.Trans (lift)
    +import Control.Monad.Trans.Resource (ResourceT, transResourceT)
    +import qualified Database.Orville.PostgreSQL as O
    +--
    +#if MIN_VERSION_resourcet(1,1,10)
    +import Control.Monad.IO.Unlift (MonadUnliftIO)
    +import qualified Database.Orville.PostgreSQL.MonadUnliftIO as OULIO
    +#else
    +import Control.Monad.Trans.Control (MonadBaseControl)
    +import qualified Database.Orville.PostgreSQL.MonadBaseControl as OMBC
    +#endif
    +--
    +instance (Monad m, O.HasOrvilleContext conn m) =>
    +         O.HasOrvilleContext conn (ResourceT m) where
    +  getOrvilleEnv = lift O.getOrvilleEnv
    +  localOrvilleEnv modEnv = transResourceT (O.localOrvilleEnv modEnv)
    +--
    +#if MIN_VERSION_resourcet(1,1,10)
    +--
    +instance (O.MonadOrvilleControl m, MonadUnliftIO m) =>
    +         O.MonadOrvilleControl (ResourceT m) where
    +  liftWithConnection = OULIO.liftWithConnectionViaUnliftIO
    +  liftFinally = OULIO.liftFinallyViaUnliftIO
    +
    +instance (MonadUnliftIO m, O.MonadOrville conn m) =>
    +         O.MonadOrville conn (ResourceT m)
    +--
    +#else
    +--
    +instance (O.MonadOrvilleControl m, MonadBaseControl IO m) =>
    +         O.MonadOrvilleControl (ResourceT m) where
    +  liftWithConnection = OMBC.liftWithConnectionViaBaseControl
    +  liftFinally = OMBC.liftFinallyViaBaseControl
    +
    +instance (MonadBaseControl IO m, O.MonadOrville conn m) =>
    +         O.MonadOrville conn (ResourceT m)
    +--
    +#endif
    +
    +--
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html new file mode 100644 index 0000000..2a2634c --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Select.html @@ -0,0 +1,44 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL.Select
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +-}
    +module Database.Orville.PostgreSQL.Select
    +  ( Select
    +  , selectQuery
    +  , selectQueryTable
    +  , selectQueryRows
    +  , selectQueryRaw
    +  , selectQueryRawRows
    +  , selectQueryColumns
    +  , selectField
    +  , FromClause
    +  , fromClauseRaw
    +  , fromClauseTableName
    +  , fromClauseTable
    +  , runSelect
    +  ) where
    +
    +import Control.Monad (void)
    +import Database.HDBC
    +
    +import Database.Orville.PostgreSQL.Internal.Execute
    +import Database.Orville.PostgreSQL.Internal.FromClause
    +import Database.Orville.PostgreSQL.Internal.FromSql
    +import Database.Orville.PostgreSQL.Internal.Monad
    +import Database.Orville.PostgreSQL.Internal.Select
    +
    +runSelect :: MonadOrville conn m => Select row -> m [row]
    +runSelect select = do
    +  rows <-
    +    withConnection $ \conn -> do
    +      executingSql SelectQuery sql $ do
    +        query <- prepare conn sql
    +        void $ execute query values
    +        fetchAllRowsAL' query
    +  decodeSqlRows builder rows
    +  where
    +    sql = selectSql select
    +    values = selectValues select
    +    builder = selectBuilder select
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html new file mode 100644 index 0000000..934f2a6 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.Trigger.html @@ -0,0 +1,21 @@ +
    module Database.Orville.PostgreSQL.Trigger
    +  ( insertTriggered
    +  , InsertTrigger(insertTriggers)
    +  , updateTriggered
    +  , UpdateTrigger(updateTriggers)
    +  , deleteTriggered
    +  , DeleteTrigger(deleteTriggers)
    +  , MonadTrigger(runTriggers)
    +  , OrvilleTriggerT
    +  , RecordedTriggers
    +  , committedTriggers
    +  , uncommittedTriggers
    +  , runOrvilleTriggerT
    +  , mapOrvilleTriggerT
    +  , liftOrville
    +  , askTriggers
    +  , clearTriggers
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Internal.Trigger
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html new file mode 100644 index 0000000..e6c1729 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Database.Orville.PostgreSQL.html @@ -0,0 +1,17 @@ +
    {-|
    +Module    : Database.Orville.PostgreSQL
    +Copyright : Flipstone Technology Partners 2016-2018
    +License   : MIT
    +
    +See "Database.Orville.PostgreSQL.Core" for information about migrating to the
    +new LibPQ-based Orville.
    +
    +-}
    +module Database.Orville.PostgreSQL
    +  ( module Database.Orville.PostgreSQL.Core
    +  , module Database.Orville.PostgreSQL.Popper
    +  ) where
    +
    +import Database.Orville.PostgreSQL.Core
    +import Database.Orville.PostgreSQL.Popper
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html new file mode 100644 index 0000000..b8fcd68 --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/Paths_orville_postgresql_legacy.html @@ -0,0 +1,51 @@ +
    {-# LANGUAGE CPP #-}
    +{-# LANGUAGE NoRebindableSyntax #-}
    +{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
    +module Paths_orville_postgresql_legacy (
    +    version,
    +    getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
    +    getDataFileName, getSysconfDir
    +  ) where
    +
    +import qualified Control.Exception as Exception
    +import Data.Version (Version(..))
    +import System.Environment (getEnv)
    +import Prelude
    +
    +#if defined(VERSION_base)
    +
    +#if MIN_VERSION_base(4,0,0)
    +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
    +#else
    +catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
    +#endif
    +
    +#else
    +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
    +#endif
    +catchIO = Exception.catch
    +
    +version :: Version
    +version = Version [0,9,0,1] []
    +bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
    +
    +bindir     = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/bin"
    +libdir     = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/lib/x86_64-linux-ghc-8.6.5/orville-postgresql-legacy-0.9.0.1-6h95xZctkqe4xM2K1EuWl8"
    +dynlibdir  = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/lib/x86_64-linux-ghc-8.6.5"
    +datadir    = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/share/x86_64-linux-ghc-8.6.5/orville-postgresql-legacy-0.9.0.1"
    +libexecdir = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/libexec/x86_64-linux-ghc-8.6.5/orville-postgresql-legacy-0.9.0.1"
    +sysconfdir = "/orville-postgresql/.stack-work/install/x86_64-linux-tinfo6/2c49086a55d34e971dcd44e916d96f868d410122501ab3cea438a5dfe5157fe7/8.6.5/etc"
    +
    +getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
    +getBinDir = catchIO (getEnv "orville_postgresql_legacy_bindir") (\_ -> return bindir)
    +getLibDir = catchIO (getEnv "orville_postgresql_legacy_libdir") (\_ -> return libdir)
    +getDynLibDir = catchIO (getEnv "orville_postgresql_legacy_dynlibdir") (\_ -> return dynlibdir)
    +getDataDir = catchIO (getEnv "orville_postgresql_legacy_datadir") (\_ -> return datadir)
    +getLibexecDir = catchIO (getEnv "orville_postgresql_legacy_libexecdir") (\_ -> return libexecdir)
    +getSysconfDir = catchIO (getEnv "orville_postgresql_legacy_sysconfdir") (\_ -> return sysconfdir)
    +
    +getDataFileName :: FilePath -> IO FilePath
    +getDataFileName name = do
    +  dir <- getDataDir
    +  return (dir ++ "/" ++ name)
    +
    \ No newline at end of file diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/highlight.js b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/highlight.js new file mode 100644 index 0000000..1e903bd --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/highlight.js @@ -0,0 +1,27 @@ + +var highlight = function (on) { + return function () { + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + var that = links[i]; + + if (this.href != that.href) { + continue; + } + + if (on) { + that.classList.add("hover-highlight"); + } else { + that.classList.remove("hover-highlight"); + } + } + } +}; + +window.onload = function () { + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + links[i].onmouseover = highlight(true); + links[i].onmouseout = highlight(false); + } +}; diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/style.css b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/style.css new file mode 100644 index 0000000..e83dc5e --- /dev/null +++ b/orville-docsite/site-builder/orville-postgresql-legacy-docs/src/style.css @@ -0,0 +1,55 @@ +body { + background-color: #fdf6e3; +} + +.hs-identifier { + color: #073642; +} + +.hs-identifier.hs-var { +} + +.hs-identifier.hs-type { + color: #5f5faf; +} + +.hs-keyword { + color: #af005f; +} + +.hs-string, .hs-char { + color: #cb4b16; +} + +.hs-number { + color: #268bd2; +} + +.hs-operator { + color: #d33682; +} + +.hs-glyph, .hs-special { + color: #dc322f; +} + +.hs-comment { + color: #8a8a8a; +} + +.hs-pragma { + color: #2aa198; +} + +.hs-cpp { + color: #859900; +} + +a:link, a:visited { + text-decoration: none; + border-bottom: 1px solid #eee8d5; +} + +a:hover, a.hover-highlight { + background-color: #eee8d5; +} diff --git a/orville-docsite/site-builder/orville-postgresql-legacy-docs/synopsis.png b/orville-docsite/site-builder/orville-postgresql-legacy-docs/synopsis.png new file mode 100644 index 0000000000000000000000000000000000000000..85fb86ec84907bcc86531dc82871948ff4d471fa GIT binary patch literal 11327 zcmV-FEWp!=P)4Tx0C)k_S!GyNTeqHT_l8Y(cXyX`gGi?cY`Qxn1VID|MJXwjPC)?)F$h6K zMMOd+6hs7sqbPzXbr*U(-*=zy-hcPcUC*=TdiNM(jyd-lv&OpsU|J&v2m2!^0SE{T z54F(O;E2!K(!rTCW z%wV;vdzf1QjBf#e&~gh74F>?Z4a=WLg$KhJ^$5nap>PLbJadS>e&h8+?D`9%QNL`g zEVKbYGXj7k5Q(8)0Fd#*a?VIMFW3*64geVHKzE-&0BG!BtmfuTbO(T`0Jaeg2nagF z{V*1E{Wm{e|AvV~*MEExiC+KU-~R=!2{)|c6Bg`GjQ;iG|FQ`1kAUCTuZtQk34#8{ z4r4(3g7#|{=Z@d+d#}7f!3C=>=26vx*jwA8>@MS>RG@Tt_zt3hie^T z_?0%9VUd=)Fos7I z^ghPh%Jy%YZ|)vCf6EaFPai$Q-!=$ppK!y&wrJs)bNdAuANB!m3n34Tfj{s75g-&U z1A!Pg3bcXF-=!Gv1VmU93G2duANT;{0JugFTqg*|oPXPC|A$2HS3NJd-hcPV3EW`Y zh=1Dr-5Mv{<{zIvz#Ybay&^Vcn^E_`qRfl{{bzYkp)4~$~NAx_VB;E z{?P)PU)DbV{Qi#~0H0@T9czDj06@6MNq8OrpdAz(9qQxd9nPr<&s+~tPQySqaZyfb zNh!%g_5YjeaLxMN*$sv_p;d%b#U$Wpz0Geb0U>E+EOsEQ;I!&= zNC6q(BFFWohy&t- zL?CHM5mJM6p`(xmWDmJOUQi$u0mVUQpbRJ*DuT+OI;a`C4fR4p&?xj8nuk`Puh35f z55*JWF{C0=8)=GkKzbrWk@3iMWInPS*@Wyu4kE{pbI3L14-^JPgW^Pq!Q<2bWsPz} zg`nb5nW!REEvg;Wj~YYGqt;RTXfiY_S_G|(HbmQ@z0gtU6m&ki8r_B-Ku@3-(OVb{ zh8`n;QNS2r>@mKWSWG773g!l;2Q!LUz-(f%SSG9pRuyZCC1S&|DcC~nb!<2G1$Gg; zjU&Zz;G}VSI0sxHE(w>9tH<5Py}&KucJP#VKD;vC6z`6Y#%JLx@m=^4{33pbgo;Ff zM3uyf#Fr$Iq=2M}WPoIbWP_BHl$%tE)ST3Z^fYM!=}po{r1PXd2-E~&f;PdC5J9*= zs3G(aUK2LR$jJD~G{_vt!pSa>)sa0QdqcKOPD3tEZbLrbsZB|wjHfK7yiNI%a+8XNN{Y&qDu61Js-9|yYMB~K%}=dM z?M|IcT|xbTdVvN>!$YG@<3@9arjllWW|0;{D?n>V>r0zK+erJ2cAbuzPL|Gw?j&6? z-95TFdL%tRy&=6neHMKS{UrTQ1~vvw1`mcbh9-s=4Br`97&RC@7}FVVFitT3Wa4Df zW%6UX#MHqw%Zy?cW;SPzV!p~ez`Vvn%c8>K#*)s`!ZO8*U=?PyV2x$1V13HE$;Qs6 z&lb#9$o7D3jh&udgWZ=sm;FBb3I`2`8ix-@E=M=VM@~9UO-_H#0?vNUbuLye1Fi_J zGOlM_JKO@?*4#+T3Fgmx>$N#hD=6JCPAiC=8LR|tcUDX*;jHjawc-Aa(!}p@(S{y z@=fw93cLy~3MC3J6=@aC6f+ecDWR3LloFKgD*aHFR}NQhQU0tVrsAhkud;kZ;E2bO z$|DP^+^R&?GSxXXPBj;`QnfjCE_I@Mx%xW|9u0SmYKzbdmB(*}d+O)oF zD{G(9?$JT&=D|u+DJZ zNWtioQNJ<4*wVPj_}x+AqoGH;Ob{kUCOIZE$M}u~9_ug#riP|Drn6=OW+7&G%rWL> z=Ede8ETk;rECwxUES)XuEw`++tg@`8tp%+ktov*zY#eRsY`)v-*k;?#*-6-)vU_6B zZ0}>=>40^xaj16KJg$2@@A#sloMVdPRon; zro?jMrmLZAiR-$Xw%cX5Rd)^dT=x|ZRgY|sB~Mk)Y|mvcRj(Yc6>oL#eD5_MZJ#2a zFTMu8*L=VGnflfE9r)Y&-w413xCGn|qz?28>kOxb4~I`91S8Hy%txw47DsMJ*+jLTq&gXR@@ceibXxRMj9yGtEGpJ5wl9t= zE-`NYl;)|jcqraAzAu3%Avt03wEpSZM3O|m#Ni~#r0k?`XKc@OC9@@;PF^^xf3_io zJS8;cWvWW*wR5O*KIfjL$)pvg?Wen^KhBWM$j{i#bjy5vUg~_o`GX6d7oKIwXI;IB zxfpnH@{;j<`HmaI~Pakhkz+;ck(4 z(L}LU@r@GJlC+ZVSKP0>xT6f*a^OxsWU@9UjK2+LN4pu2v z)m1ZBXH@Ui1lG*eTGaN}Db&@~v({%dAQ~bXR<1ijt)TYR@l+GyI++oAU8_Vo_$j=4_z&e7XOxBI$Oy4voD->JFFb+`B) z-My^)B=?i=A9TlbZ}tTDto3^JF7!F~O+T=EFy3$8|7^f`;L$_9hYtod2fH7sKDs-k zJaqf9;^U4d@=w~I$~|oxmK$z+CjYE`L}8@!xzh8l(IcbxU#P$69n%?mIBq!pWa8Mw z=%n@JtCx;1=U%zLT7K>S`pZ=0)Xwzj8T3s0Eahze8`d}FZ-w68n3JEoH?K4Q^qu9q z=>@li)%RiVcNddCkbTHs;#jI%mR`QQqPOz=CgGy+9whdp4g`BLCvp!8U&;uov(!a2t+bEnRv6HXyi9t`-YglcEo`$K zI8GTZXYLH1F5YE+b^&9-c%dfYc~N>X1MygiCdpZ8N*OKLV7W5+5rusvVP$KTgd_E; zV`@J%*flk^Jhjj1)aX9cTQC5ItVZ(2W=FkE;*aH-)|+*kk6SET?pjmWaNEk+>D${o z_#cmV%sNr-bj$gX%QW$m8{|&wA?SI;%go!uC))SCU%7vKz~jI-L0?1Ap^RZ7;i?hG zB3+__P9{WW#uUa@#oavB8Q+`m==5;nXwvwZiR6j1<0+%5!{;8Q^`_s>XwIxTUvlAM z)|rdpmprp=bM$iM@_6#8@((Vr7Q8HcP;{fXs3iGH;8nY8TBRaov}JqcixtC_ZBw07?YBCLI#1vB=rX<|d6)j~ z?!9;SA9XkN4rDD83J6N{$`!z{xG&lW}=KCd6md=WHe zF)la3F!5t@`sLkMS6?Sg5vR3gcxTbGOK%>(y*_twKH{Cjg64anMViI^4{J-a%g0=3|@n*5+(H4=G;Z`Bm z0XDw2UUnY#t`5ZG&WObDFO_)C zCe0{aEki1k_dNXt+=U-mA1_W_8p^(%Qj|@Mb z9sM+h7-yIepVWIvd=>Y)XzKR#)XeT1jH zI8-@&65hs?W6g0$Tn9b?K9MevmJ{6JljSOT6GbGYHWfM5G<6M41g#z&E8Qx6H$yI? z50eHn6Z1ODBi1suSavH8F-{EUJXaTYHjh8AJ|73)7XPq7gt>OirQ5IDz)!g7S$y<#pnvPn` zTCcP(>sag3>W=B<=vx}l7>pa{8`&AN7|$LpGx0noeC)GnyV)so9SefRgyl6WA8Q%w zeVfO&`F8I1(hk7k+3~B6fhW|RD4pIpx4EPekGo2^q1>k2n?25Xx_BviQ+coYJoGK~ zi}SY&kPV~?{2VkK+z^r;>Jw%VE)ao-y@)AN%A4?QY z!X(X~xtpASHaNvFl_z!g+(cSqdP;^mD`$^mG5`i zpn$&+Rk%>pUtCp^dd2Um*){o6wlZ|t=klqF!OHfk>gs};%-W>7nEHr@(CeX%5lwM7 zQg7xp*S7SwzHLLbOLn+*Uc0?`NAB*$d)wWCJsW)~{h|X4gV%@BpPU*_8L1qd8t0!( zdySmVd!st{bK%K{=9Rj&=Ffv)KX1|hFxkC)82{hg(&3(fkq6-NB>?O?0kGBtAd?QJ zm0$~|LIBLj0I*U5i1iA9XzK$|?dCuG2lOlFq=GX}9v}f{nuc(O=>uZH1yBw;!3bD_ zU{(i`gLA_m=mOLPjX+-zbO8W#QsA+O&>1m7Uxak_`<>>nu%o*kx!T2DqomQ{`*59GHMHWa@qZ7S~^!Kl)z@vEz7SZjuAWovinywxMoS2FN7 zEH|1t%4A}H?2754xrD_j%Moi{n>gE7_6iP##}7_;J59Lg5Ifz(-D^B~y{dc!eQ)?H z1`GsQ2d{)Cgfm98MOmHv9&;s5@6?xs(nO0hxa6LcxN|CLdl`M_GqP+i31t7w9nHU9 zkY40hVt!S*RG^%pl2DDR1@+)Ms)_U_Lks^c#r9*J-d)LeEAIFAEIl9{kQ}rbihXiz zxOZfJbZ?wtQtXx5l+ld&8>=~scSi5kK8P(dtn9DO{nh=s_)Emb(M`^+uiKA)7VrA) zEB#tO5ODlSVZM$P@WWh#2Fx+Iz|6u~m`%6|24UXdCqxG`1g0=2kOkd@#-Q&AR(P%P zMdTpvAy(jBM;jT2tUyk{D~~EF3{{U>K(nFk;T(JdLx-`&6l3PF0@xsI7Y>87!d2q7 z@J9GD{0|aKlAELyq`{in5#@A}YP&ZEYQ#XH-V)Gsvv6_^~14ao?j4lj=6k7|w9iW!UZJhhvUlPHq(FxfQ) zq?V>>q`%8dxgeZ1aw#H*HTOZjUjc35y<*QR6jwV-iRB~}tyPXS=-S45n}+?ysv9OZ zzqJ(K(rR1j$hs}xHG4PtzG(M&@2Lj@{VyISJQ5#z^W@U7{hV|l=i6Vte3RLV-yYuK+dKCw{z!laG%#N$3ABJM%p<0O zYA^skKqQbP%m$r-WBwLFh0ujLomRwONMWQ8vL5*f<`CmhgJ?Rm2f718hVj63W7)9r z*mpQXTq~XnpG|@xNg&xFjU_!Gq>|CVvs#J#1w}9=HDxE2J2egUAWZ`85!yYvKKcv> zJ4PYKJ*G+KW|m8=VQlv7TJY|}%00wyKDli~41a=UN19Bb{{JVSQ=?d&3H&&qviwE*<+| zre!9^?4cDF}{Txa*#Kx+jZQvyZXwvVVG@WYFu7)G)>HwaCho zPBE;pGpDX4cqED@Z6)`nTsY^LE}F4-ek7|Lj+#LpTmF}Vfuf?4z^j_2v}GSEI;v7@ ztn0YySFg7=Mcq_r{?^*qM(m*I?Cd&z=li|$-7G!jeOwO;25=992SX5MzsmCeV$vtN*Wk9q%cvGzm6 zlGZYQ`Nc~9M~79`)tR-DzwAEIeH!_EZe4SI`^$~5?i-97Prt=)N^Q<3ePg@o zht*Hi&(|HuI*eO3a z*sFk(4fq>KkN@xQ6^F(cm~$_2K14li9;XkV|9<@!M&f%8Nam8p00009a7bBm000XU z000XU0RWnu7ytkil}SWFRCodHT?u#;Rkr@KbUNvfeG_5`YY-wNfPp{+o{ADgGcxep z5O;8ydCWk3pWowCbe1RjK4lzy;4&jKqk}U-a1=+ud7z@;LLwlFC>S)v1jwFrI_XY2 zop;WyuIf%_F~x?x|CCgE~7q5lBOq0>MKUdH^|7ARquk zTn+*P5DlHMG@8ELxbaVWHf?&T znHpfF&E_pZ&^rD;1;7qozi0Q$(`V)7{8<+kI>wdbHk%E>!9AN2eO+^{$KB)hHtVU6 z4;0@%KYw`%{kM%aj|)L>`1``u*EM%B_Ep|f_7iHT~t6&rZsneaT;XVt##n z3*O&%0=#!k4Gq$@x_XoAC663)d$?Wm=UXTrha?_sgD)BZa!4dhf)W5g$)o+5f!@!6p= z7>#E6lGpa0z~7?)*juclePn!mT$U>W2F?VqT7?}(LqHHhL#3+DoNXk5_#Pb{(lwSP zZ<=X|iSbjYeFoatR`H}3=!RdX3qeSTbc>FTPC&5WKoW3vT<}n4p!jve)Qtntp05&Y$`N~L&mauhNrjZlt#E%Rdnz*4RdA(~WsS0P~4Cker*^h9K3rID79 zAhx!)2_f*-6tD+E@|~5o_HbR*DQEm#fix64W;xPOIEsuwz3>ej`Mg}wlx+M?%^s;7 zt7<_1|D+24j|zb6{d*Duo)R*nQ%A&N`m}UK6}Gim#oV|jr-^I5{&3u6Y!z0&JjK=N zf~iA{0UNr_&1RH*=FkdaRxmwXu@ih1pW6b!KwO1@&&hNBf0 z=VYU~zns|bF>|Ig{pE8Oi&e4q8Sf>;d>$HnJ*g4^2E{@!BWJXj|MK2>t{)#4iCiKM z_X3_Wd3!22SVWGECF_5t9Wx1ebdVe1IRabo*K&Me+mp(08G`jsI~A7O*rz=A?*I(Ym_y4*ZBHj<`2EIL z@XCfeuGtW8G6RGFlFM<@CjE-OtU#5a;0kB%yXw(N%<3n(~sBeG(H{~)Y9EAyo%kT#Rg2j zpdOnacnjrpoDswQL%S&=xD)LJZ^c?^7~tUKxVSW2U-+UJ`I8c2{Q|sd4FLUcTr-0M zaqMa26wFKpz7U~s3AlNV^qhrHMbm9<`9gTLcVV_VCkYcW$bp+1aV?*4j`n;5NQvl5P$NHC1)DVqF ze?14Uta}S5dTDmrRR#Fn;tPAZ>c6M&cw`%zt17X5(`x+mXPZPMYENh$xHA{IIn#Q& z^ zG}YF_5*3HIuofIEDMeLB1jc8M#;C+D(d52>)gx`#@~i9ZqkAV_+e~x*&R~QFvHtHw zX=O8P?QIyJ9Ss9*B|&g;0hMp z3Alm-uHb+xn7Ts16&!E{`__2XkJh+p1UhOAxPk+&;D9SQ;0g}7f`^~4p*Mp`Hum_uHM8Ep9TllPO>m-^Cs zpVwg1bK6i`-w1z*2vDs7WXVaJJHyU=rk@Vk3#W^iKzdl}7D4^3u#E2B8*>%rGlt8u z5=Bg)^vMF>N2OW-kTeo=C=#;#Uwg6hiz=At%UPznGuZL$9uX3jIcgXzEoL+}ne7De zePX!NLIZ__1sfvpaY5fTR( zUH5HKQ7-^w@TCk-ATqS$+;^2Y-9Yg{p~En8>~LcE&~OCN2SO-y!qgT7qsff0kWR!$ z^D81!lBm$TfXL;}=Y9YJK+SF{!{d*=}ZDsk}pA}{0WdF3_)n|T5 zFNK7P(SF;zrP#jx9qieE2>F-K@p;gyHGt(@rI_!hEt)McpP}lbFn3v=a0JCAI=-Ld z^HfmLKw}#PgVO)j-n&3BpR3@}{)WrPilHHGIK3w22T8R6=u<`rMwjnBh~jFy5zt}A zN81hv!KkMXNNPDnh1mq7H@>uwma1@k3;2!wtQCOj+9tn%uigkWBw{AL|5)BofhX2& zA+XZ302%fCsUzg9CimQPVv`f;C6O8|{n>ML#6sZcPqU_9DPe!$!>g7coyleK6R!5=0O9Kit+4(r(6 ziv6QJ8-P(X4Sa3SakRGjFIv?a0G4_jZD3}d!^RD-cH>&cq5?d2jrKkeAp_;!Ur#;& z9W7Y4e9epUX=T6m-g%gom8l&2YDT>Vpn#D2K2TLOYC9;D1)wkDRn>N#8T3J_^Lk0W z2GEDo5^3Wxdgdfd9w7&WOIUcVywJ$#^9sz{H)rNATQUdN%*}+3f?}K#TL)6Cfb&`3 z%&Qjw3IaWJ_$1z;4dDsM&%YQ~=42pUgopbkSWmW!9lu+5e2Bl(Hp~!=)psw#l#5d7 z<59t4!9`Er%bRtn7l4p3WRMY9&31sf7Q0{HC$^-K>G(;07G_Pk5PmWfQbk{$>nD;C z$aX+;iw(co_@<~Qn^p+B=a%_MiWA>XQ&sn1{z<(6(1#*dufHEF>#Fe8m!&8!F2%dw zHlg}-8UFYJZG<8tdn)d^eHPNC3G-m$^7_440RBMV3*u1l6Q_-MckXuK!rmQ$k)#dR$sG z@^U71!@qOSF|2)@pOpG;Qm+AE#NKTmpy<6aRJ-8I$ex7UR10>zRSMI&Dx4*+aC%oe z$>ksZdHCl3@33X-u5M#~!F>8s>bP;(@Z1iZ5DQ57E(pe>^RmdH=2Rkv1Y;;r0f4a|kUQI?AO7tZbEf zJ(*E203jiWBR5FKRnt*$=_L9l06hS)bRb+XpPQ(|6)W>G1u?i-W6WoCJgUlRkTWYJ9y;~2lKhQP~5|72z2_#^8q&npdI^OKWZnM4)jd~lxFIKK%PKOm(9u+`!IG4P>PAtq9@Rh0JE!{0DuH! zkK`y|6ZXDM&ju*fYcM2?dkd?0BQd?AvKl9=rI$l^%Bzo%82pwp_ z3!t@d`N^j}MPee&>2}gr!FRvB)4o^~UCPYDMfxiI>b@c+MsVI_ZG?n%#SdILF9)yD z8iBv~&32h6$j=)^`5;_--)1F7aK==Pycf`JwRRcIa&EjD`NGhX@h9M+TM4YCmA;oJ zrO3=nv3MeD1n(z%`&dZj&7(JU#eehVv~0XE^yJ%^arZ3+;^s6cinJi_LRv*8MlRsh z{Xp^er2%-zvwii|iPQND<~cxwB;)S&_u$&{D%8_7aQMh%>8YP30yAe!z=De>;j*0J zN>6b7(K|VAAJyy)=J$-BZpMp7n5{I{+sN@1<}jm{UYm<6az zC)2KLBDKeY!To$ha&qG2BZqfAotPNM^BbQ^H8u4$*;5z(vZ|_v=c1LgH4&aJ8cR)s zhZ25=_;#ffO9d0sLd30K^&jiDoI6+3R|Htse-FYDw`bL=buUu;*yY6jR@v$9iMtOO z{Jm)a77X@ba%$f%7edh>l!!{woQDqvAyLn?wOiY*$B%zo zv32X~pEWczvH$rLZ56cfy6vr`0a$epDA9d}4E`PkfT>4BU?%e$j!CrfB%e1P1~}M{ zuQ8DZRRHLI>|J6XE5CNbPoY`u^Tv~L_DESt0J@K9biv&;RPgs@1TwMtC4bqg&n_U& z^RqpU@fmCZV8(Krcxd8Db|Y=v9v+%_sqO*ye5%7a4GH|cY5=AL^#T?U?(IAraOf}Z znfd(s?_l?Sx}{(;kM%5!ES&ry9?r8?uz9NYQ(Ynr1^j&q08@d8z|&jaWMSaE-1`Sx z2*lKk?$1KN8*2mJGw(g3`l+riN$dE3Q~;P7LCd=wx?7hW&8J3pu z_e%g|LIn2Oqk!C_wTCQ#s9zKa2tdEcq}@UR0njdQ`-LnZ0R1A9b_)drK)bx{7qWl= z^ovZ|Eff#{?eex?$N~b;FEVMjP(T2*%iDe-`+v|7m{y$1dn*6{002ovPDHLkV1lnB B5rhB$ literal 0 HcmV?d00001 diff --git a/orville-docsite/site-builder/site.hs b/orville-docsite/site-builder/site.hs index ad60a06..b200d07 100644 --- a/orville-docsite/site-builder/site.hs +++ b/orville-docsite/site-builder/site.hs @@ -109,6 +109,10 @@ main = do match "templates/*" $ compile templateBodyCompiler + match "orville-postgresql-legacy-docs/**" $ do + route idRoute + compile copyFileCompiler + create ["check-all-snippets-used"] $ do -- This rule doesn't have a route, which causes no actual file to get -- create for the site, which is what we want. diff --git a/orville-postgresql/scripts/build.sh b/orville-postgresql/scripts/build.sh index 2d4f0d8..b5a170b 100755 --- a/orville-postgresql/scripts/build.sh +++ b/orville-postgresql/scripts/build.sh @@ -53,15 +53,6 @@ else echo_when_verbose "Going to run formatting against the codebase.\n" docker compose run --rm dev sh ./scripts/format-repo.sh - echo_when_verbose "Now verifying documentation.\n" - ( cd ../docs - docker compose run --rm --build docs /orville-root/GETTING-STARTED.md - docker compose run --rm --build docs /orville-root/SQL-MARSHALLER.md - docker compose run --rm --build docs /orville-root/PLAN.md - docker compose run --rm --build docs /orville-root/MIGRATION.md - docker compose run --rm --build docs /orville-root/JSON.md - ) - echo_when_verbose "Now running the tests against the supported stack resolvers.\n" docker compose run --rm dev sh ./scripts/test-all diff --git a/stack-gh-pages-haddock.sh b/stack-gh-pages-haddock.sh deleted file mode 100644 index 7b53417..0000000 --- a/stack-gh-pages-haddock.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -# Based on https://github.com/yamadapc/stack-gh-pages -set -e - -mkdocs() { - package=$1 - stack_yaml=$2 - parent_dir=$(pwd) - - docsdir="$parent_dir/$package-docs" - - cd "$package" - - - docker-compose run --no-deps --rm dev \ - stack --stack-yaml "$stack_yaml" \ - haddock \ - --haddock-hyperlink-source \ - --no-haddock-deps \ - --force-dirty \ - --haddock-arguments --odir=temp-docs - - me=$(whoami) - sudo chown -R "$me"."$me" temp-docs - cd "$parent_dir" - rm -rf "$docsdir" - mv "$package"/temp-docs "$docsdir" -} - -mkindex() { -cat << END > index.html - - - - Orville Documentation - - -

    Documentation for yet-to-be released Orville packages

    - - - -END -} - -push_to_pages_branch() { - git stash - git branch -D gh-pages || echo "No existing pages branch to delete" - git checkout --orphan gh-pages - git add . - git commit -m "Automated Haddock commit" - git checkout master - - echo "Docs have been generated on the gh-pages branch." - echo "You can push make them live with the following command:" - echo "" - echo " git push -f -u origin gh-pages:gh-pages" -} - -mkdocs orville-postgresql stack.yml -mkdocs orville-postgresql-legacy stack-lts-14.0.yml - -mkindex -push_to_pages_branch