Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1391 commits
Select commit Hold shift + click to select a range
5455fd7
Correct naming
nikita-volkov Apr 25, 2024
14d78fb
Replace mapLeft with first
nikita-volkov Apr 27, 2024
e40be85
Add DerivingVia
nikita-volkov Apr 27, 2024
01a5dd2
Update the changelog
nikita-volkov Apr 27, 2024
c3a83eb
Bundle extensions for libpq14
nikita-volkov Apr 27, 2024
9b15127
Correct changelog
nikita-volkov Apr 27, 2024
7d24e0d
Reduce the amount of changes to the error model for now
nikita-volkov Apr 27, 2024
9150f4f
Add docs
nikita-volkov Apr 28, 2024
ed10244
Extend the docs
nikita-volkov Apr 28, 2024
5b6dd9d
Merge pull request #160 from nikita-volkov/pipelining
nikita-volkov Apr 28, 2024
864767b
Remove rerebase from the internal library deps
nikita-volkov Apr 28, 2024
6c6c719
Update actions
nikita-volkov Apr 28, 2024
4e027af
Merge branch 'master' into clean-up-public-deps
nikita-volkov Apr 28, 2024
dde6c39
Update the actions
nikita-volkov Apr 28, 2024
1b16da3
Merge branch 'clean-up-public-deps'
nikita-volkov Apr 28, 2024
e8e5ee0
Move the generated image
nikita-volkov May 2, 2024
3272c64
Set package version to 1.7
nikita-volkov May 2, 2024
5c59813
Merge major into master
github-actions[bot] May 2, 2024
b2593b0
Update github actions
nikita-volkov May 2, 2024
2fe9d80
Migrate to hasql 1.7
nikita-volkov May 2, 2024
4339d1c
Update the extensions
nikita-volkov May 2, 2024
b5758a1
Format
nikita-volkov May 2, 2024
d408f00
Set package version to 1.2
nikita-volkov May 2, 2024
ba93c4f
Merge major into master
github-actions[bot] May 2, 2024
088cb6f
Report errors when LISTEN or UNLISTEN fail
diogob May 2, 2024
4901795
Extract executeOrPanic
diogob May 2, 2024
f1758f7
Now we have the proper error handling in case the LISTEN or UNLISTEN
diogob May 4, 2024
122a92c
Merge pull request #25 from diogob/do-not-fail-silently
diogob May 5, 2024
34b68be
Remove stack from repo since I am currently working only with cabal
diogob May 5, 2024
d1784b4
Merge pull request #26 from diogob/cabalonly
diogob May 5, 2024
b017d66
Bump minor version number
diogob May 6, 2024
4ef3839
Upgrade hasql-pool to 1.2. Had to drop compatibility with previous ve…
diogob May 5, 2024
48f92a8
Add some missing upper bounds
diogob May 6, 2024
88c794e
Merge pull request #27 from diogob/hasql-pool-1.2
diogob May 6, 2024
5f5a115
Bump minor version number
diogob May 6, 2024
f9746b0
Update README
nikita-volkov May 7, 2024
384f22a
Update synopsis
nikita-volkov May 7, 2024
023a047
Modernize and format
nikita-volkov May 7, 2024
6939fa7
Format
nikita-volkov May 7, 2024
b6b52a9
Update the hasql dep
nikita-volkov May 7, 2024
e39b7de
Add tested-with
nikita-volkov May 7, 2024
46e6c51
Format
nikita-volkov May 7, 2024
66b32f7
Set package version to 1.1.1
nikita-volkov May 7, 2024
2a9a710
Merge minor into master
github-actions[bot] May 7, 2024
98c1890
Update the docs on libpq and etc
nikita-volkov May 8, 2024
db1c49e
Correct haddock
nikita-volkov May 8, 2024
063f03a
Update the actions
nikita-volkov May 8, 2024
cb2ec1d
Clean up
nikita-volkov May 8, 2024
91de395
Set package version to 1.7.0.1
nikita-volkov May 8, 2024
954bb64
Merge patch into master
github-actions[bot] May 8, 2024
8117dcb
Relax the bounds on all deps
nikita-volkov May 8, 2024
0443b41
Format
nikita-volkov May 8, 2024
c9ec3cb
Update cabal
nikita-volkov May 8, 2024
d57b6a7
Clean up in prelude
nikita-volkov May 8, 2024
c6d99f8
Update the actions
nikita-volkov May 8, 2024
4699456
Format
nikita-volkov May 8, 2024
bf2ff48
Add doc generation to CD
nikita-volkov May 8, 2024
b01f9c1
Modernize cabal
nikita-volkov May 8, 2024
ce7d629
Set package version to 0.1.1.3
nikita-volkov May 8, 2024
0b8bcff
Merge patch into master
github-actions[bot] May 8, 2024
38ad8ed
Format
nikita-volkov May 8, 2024
f2c3cd0
Set package version to 1.2.0.1
nikita-volkov May 8, 2024
00a3302
Merge patch into master
github-actions[bot] May 8, 2024
7d7456d
Fix the build and update the deps
nikita-volkov May 8, 2024
a476d7a
Set package version to 0.3.1.6
nikita-volkov May 8, 2024
b9fef25
Merge patch into master
github-actions[bot] May 8, 2024
48121b6
Correct the docs
nikita-volkov May 8, 2024
94aebd4
Set package version to 1.7.0.2
nikita-volkov May 8, 2024
b57e400
Merge patch into master
github-actions[bot] May 8, 2024
6b63987
Remove contravariant-extras from regular dependencies
wolfgangwalther Jun 17, 2024
9725220
Remove contravariant-extras from test dependencies
wolfgangwalther Jun 17, 2024
07e02cd
Merge pull request #21 from wolfgangwalther/remove-contravariant-extras
nikita-volkov Jun 17, 2024
7331c5d
Format
nikita-volkov Jun 17, 2024
373fe02
Fix CI compatibility
nikita-volkov Jun 17, 2024
1409207
Attempt to fix compatibility
nikita-volkov Jun 17, 2024
6d55137
Set package version to 1.1.1.1
nikita-volkov Jun 18, 2024
7910c09
Merge patch into master
github-actions[bot] Jun 18, 2024
377aed7
Move to "iproute" from "network-ip" for the "inet" datatype
nikita-volkov Jun 24, 2024
25dd8b3
Set package version to 1.8
nikita-volkov Jun 24, 2024
a2993a4
Merge major into master
github-actions[bot] Jun 24, 2024
6d3f6b9
Provide support for hasql-1.8
nikita-volkov Jun 25, 2024
2e4c5b5
Provide support for hasql-1.8
nikita-volkov Jun 25, 2024
199dff3
Provide support for hasql-1.8
nikita-volkov Jun 25, 2024
095ff80
Set package version to 1.1.1.2
nikita-volkov Jun 25, 2024
cf1cf4c
Merge patch into master
github-actions[bot] Jun 25, 2024
aa86089
Set package version to 1.2.0.2
nikita-volkov Jun 25, 2024
36120b3
Merge patch into master
github-actions[bot] Jun 25, 2024
eb16719
Provide support for hasql-1.8
nikita-volkov Jun 25, 2024
f5db1a2
Set package version to 0.2
nikita-volkov Jun 25, 2024
2d8edc9
Merge major into master
github-actions[bot] Jun 25, 2024
84571fd
Set package version to 0.3.1.7
nikita-volkov Jun 25, 2024
cbd9146
Merge patch into master
github-actions[bot] Jun 25, 2024
5537c6e
Make row and column number more explicit
JBetz Jul 15, 2024
5a6c797
Merge pull request #164 from JBetz/improve-row-error-message
nikita-volkov Jul 15, 2024
d49834b
Allow newer libpq
nikita-volkov Aug 20, 2024
3ae192c
Set package version to 1.8.0.1
nikita-volkov Aug 20, 2024
862f407
Merge patch into master
github-actions[bot] Aug 20, 2024
f75598e
Make compatible with latest postgresql-libpq
nikita-volkov Aug 31, 2024
c894fb1
Set package version to 1.8.0.2
nikita-volkov Aug 31, 2024
f033b12
Merge patch into master
github-actions[bot] Aug 31, 2024
52cfda4
Add connection reset on exceptions in non-idle transaction status
nikita-volkov Sep 13, 2024
34c540d
Set package version to 1.8.1
nikita-volkov Sep 13, 2024
43138e4
Merge minor into master
github-actions[bot] Sep 13, 2024
3f8240c
Extend the changelog
nikita-volkov Sep 13, 2024
8c3685e
Mask the exception handler
nikita-volkov Sep 13, 2024
6bb52d0
Add the resetting of the registry in case of errors
nikita-volkov Sep 13, 2024
914f8af
Set package version to 1.8.1.1
nikita-volkov Sep 13, 2024
a6215c0
Merge patch into master
github-actions[bot] Sep 13, 2024
a9ed279
Bump hasql, bytestring (#28)
TeofilC Oct 28, 2024
51f123c
Bump patch version
diogob Oct 28, 2024
5b44347
Update the docs
nikita-volkov Dec 1, 2024
e55415b
Format
nikita-volkov Dec 1, 2024
541adf0
Set package version to 1.8.1.2
nikita-volkov Dec 1, 2024
491e49e
Merge patch into master
github-actions[bot] Dec 1, 2024
a45aa3f
Make the release pipeline generate the docs
nikita-volkov Dec 1, 2024
eec974f
Explicitly state that the testing-kit sublib is private
nikita-volkov Dec 1, 2024
9d583dc
Set package version to 1.8.1.3
nikita-volkov Dec 1, 2024
70d4e51
Merge patch into master
github-actions[bot] Dec 1, 2024
0b7c0c2
fix: Configufation -> Configuration
sekunho Dec 8, 2024
97c36cb
Merge pull request #47 from sekunho/fix/configufation-type
nikita-volkov Dec 9, 2024
cb0c6bd
Set package version to 1.2.0.3
nikita-volkov Dec 9, 2024
cb04c4e
Merge patch into master
github-actions[bot] Dec 9, 2024
fef4664
Correct the docs
nikita-volkov Dec 16, 2024
2142b2c
Set package version to 1.8.1.4
nikita-volkov Dec 16, 2024
b1f87c2
Merge patch into master
github-actions[bot] Dec 16, 2024
038daf5
Lint
nikita-volkov Jan 4, 2025
7b6a959
Add usePreparedStatements
nikita-volkov Jan 4, 2025
41cf517
Rename the Settings module to ConnectionString
nikita-volkov Jan 5, 2025
dcc9e03
Rename definitions
nikita-volkov Jan 5, 2025
ded121c
Introduce a setting tree
nikita-volkov Jan 5, 2025
e482bec
Introduce Config as the compilation target
nikita-volkov Jan 5, 2025
1c1131a
Reimplement settings as a tree
nikita-volkov Jan 5, 2025
93d1453
Lint
nikita-volkov Jan 5, 2025
69fe290
Add setters
nikita-volkov Jan 5, 2025
9444102
Add construction from text
nikita-volkov Jan 5, 2025
1da07c1
Update
nikita-volkov Jan 5, 2025
4888be0
Add docs
nikita-volkov Jan 5, 2025
498c13a
Update the changelog
nikita-volkov Jan 5, 2025
ae48158
Ditch the old ConnectionString module
nikita-volkov Jan 5, 2025
82f3cca
Revise settings
nikita-volkov Jan 5, 2025
c6e8790
Update the CHANGELOG
nikita-volkov Jan 5, 2025
7b61169
Polish the docs
nikita-volkov Jan 5, 2025
a86b57c
Update cabal.project
nikita-volkov Jan 5, 2025
9d636e5
Lint
nikita-volkov Jan 5, 2025
46f633a
Integrate with new hasql settings
nikita-volkov Jan 5, 2025
e85caa0
Allow hasql 1.9
nikita-volkov Jan 6, 2025
bc8d278
Allow hasql 1.9
nikita-volkov Jan 6, 2025
ec64bd3
Allow hasql 1.9
nikita-volkov Jan 6, 2025
2713cee
Set package version to 1.9
nikita-volkov Jan 6, 2025
c2902a7
Merge major into master
github-actions[bot] Jan 6, 2025
428e9d1
Update the deps
nikita-volkov Jan 6, 2025
d43e17b
Allow newer ghc-prim for the deps
nikita-volkov Jan 6, 2025
3750870
Allow newer ghc-prim for the deps
nikita-volkov Jan 6, 2025
69d6cee
Allow newer basic deps
nikita-volkov Jan 6, 2025
e9e54c9
Allow newer basic deps
nikita-volkov Jan 6, 2025
f621094
Set package version to 1.3
nikita-volkov Jan 6, 2025
95ffd71
Merge major into master
github-actions[bot] Jan 6, 2025
f747782
Adapt the test suite
nikita-volkov Jan 6, 2025
1d06a12
Set package version to 0.2.0.1
nikita-volkov Jan 6, 2025
81faa49
Set package version to 0.3.1.8
nikita-volkov Jan 6, 2025
a37951c
Set package version to 1.1.1.3
nikita-volkov Jan 6, 2025
b183d4f
Merge patch into master
github-actions[bot] Jan 6, 2025
15058e2
Remove unpreparedTransaction
nikita-volkov Jan 6, 2025
0da21b2
Clean up
nikita-volkov Jan 6, 2025
f00a1a3
Set package version to 1.2
nikita-volkov Jan 6, 2025
910bcd6
Merge major into master
github-actions[bot] Jan 6, 2025
8a567e7
Correct the dep bounds on hasql
nikita-volkov Jan 7, 2025
cfadb84
Set package version to 1.2.0.1
nikita-volkov Jan 7, 2025
557887f
Merge patch into master
github-actions[bot] Jan 7, 2025
01a901e
Integrate with witherable
nikita-volkov Jan 15, 2025
e86187e
Set package version to 1.9.1
nikita-volkov Jan 15, 2025
24bca5b
Merge minor into master
github-actions[bot] Jan 15, 2025
710b8c2
Correct repo location
nikita-volkov Jan 15, 2025
c5acb41
threadWaitRead does not work on windows.
diogob Jan 25, 2025
b25bc04
Merge pull request #29 from diogob/threadWaitRead-does-not-work-windows
diogob Jan 25, 2025
b58a83f
Bump patch version
diogob Jan 25, 2025
179910a
Allow tasty-quickcheck 0.11
wolfgangwalther Feb 2, 2025
6d9039a
Merge pull request #169 from wolfgangwalther/patch-1
nikita-volkov Feb 2, 2025
45d19e7
Set package version to 1.9.1.1
nikita-volkov Feb 2, 2025
f2e96b0
Merge patch into master
github-actions[bot] Feb 2, 2025
1767836
Update CI
nikita-volkov Apr 7, 2025
00bd089
Clean up
nikita-volkov Apr 7, 2025
ed5389c
Relax bounds
nikita-volkov Apr 7, 2025
d35b304
Adapt to the upcoming text-builder release
nikita-volkov Apr 8, 2025
e459da1
Update the deps
nikita-volkov Apr 8, 2025
0be7ed4
Set package version to 1.9.1.2
nikita-volkov Apr 8, 2025
c74c582
Merge patch into master
github-actions[bot] Apr 8, 2025
ce9f201
Set package version to 1.3.0.1
nikita-volkov Apr 9, 2025
4c864d8
Merge patch into master
github-actions[bot] Apr 9, 2025
617193f
Remove the dependencies badge
nikita-volkov May 5, 2025
0631892
Update the changelog
nikita-volkov May 15, 2025
8d77fc0
Set package version to 1.3.0.2
nikita-volkov May 15, 2025
3bad369
Merge patch into master
github-actions[bot] May 15, 2025
0c28da3
Documentation updated to remove connectionString
feature-not-a-bug Jun 21, 2025
81dfa60
Accidentally added dist-newstyle folder. Removed
feature-not-a-bug Jun 22, 2025
e367684
Merge pull request #172 from feature-not-a-bug/doc-update
nikita-volkov Jun 22, 2025
55db61d
Correct the docs
nikita-volkov Jul 9, 2025
f141633
Set package version to 1.3.0.3
nikita-volkov Jul 9, 2025
1097dbd
Add support for non-retryable transactions
laurenceisla Jul 11, 2025
de393d0
Merge pull request #23 from laurenceisla/no-retry-tx
nikita-volkov Jul 18, 2025
93d7a3b
Set package version to 1.2.1
nikita-volkov Jul 18, 2025
ea6080c
Add macaddr encoder and decoder
kaol Jul 27, 2025
011a3e1
Restrict postgresql-binary version to 0.14.1 or higher
nikita-volkov Jul 28, 2025
2c3a334
Merge #173
nikita-volkov Jul 28, 2025
b49b09d
Set package version to 1.9.2
nikita-volkov Jul 28, 2025
3ebd843
Merge minor into master
github-actions[bot] Jul 28, 2025
962ae98
Add support for hasql 1.9
laurenceisla Aug 6, 2025
66aee30
support range and multirange
bflyblue Aug 8, 2025
1addb1b
remove accidentally committed flake.nix
bflyblue Aug 8, 2025
89f1f27
add missing pipe character at beginning of comments
bflyblue Aug 8, 2025
8c2cb1c
Merge pull request #174 from bflyblue/range-types
nikita-volkov Aug 9, 2025
02ba0bc
Add missing exports
nikita-volkov Aug 9, 2025
58acc38
Ditch typeable
nikita-volkov Aug 9, 2025
0d2a135
Set package version to 1.9.3
nikita-volkov Aug 9, 2025
6dffd20
Merge minor into master
github-actions[bot] Aug 9, 2025
5f4c99f
Merge pull request #30 from laurenceisla/hasql-1.9
diogob Aug 14, 2025
aafad91
Update to version v4 since v2 would fail the pipeline
diogob Aug 14, 2025
64e7437
Merge pull request #31 from diogob/update-ci-cache-action
diogob Aug 14, 2025
77206be
Bump minor version number (update hasql dependency)
diogob Aug 14, 2025
070290d
Handle the case when password is an empty string.
pranaysashank Sep 3, 2025
6262cef
Always quote values and escape existing single quotes and backslash.
pranaysashank Sep 8, 2025
34984d8
Reproduce (#176)
nikita-volkov Sep 8, 2025
f8fb948
Format
nikita-volkov Sep 8, 2025
f402ab0
Revert tests
nikita-volkov Sep 8, 2025
06441da
Merge branch 'pr-177' into 176/reproduction
nikita-volkov Sep 8, 2025
bc530af
Update the tests to avoid quotes and slashes
nikita-volkov Sep 8, 2025
b9041c5
Update
nikita-volkov Sep 8, 2025
dbf97ff
Simplify to just passwords
nikita-volkov Sep 8, 2025
e83ae7b
Disable log forwarding
nikita-volkov Sep 8, 2025
3aad81e
Reproduce
nikita-volkov Sep 8, 2025
d0a76ca
Merge branch '176/solution' into 176/reproduction
nikita-volkov Sep 8, 2025
550681e
Merge branch '176/reproduction'
nikita-volkov Sep 8, 2025
d353314
Set package version to 1.9.3.1
nikita-volkov Sep 8, 2025
9211a65
Move hasql to vendor/hasql
wolfgangwalther Jul 7, 2026
3f75837
Move hasql-dynamic-statements to vendor/hasql-dynamic-statements
wolfgangwalther Jul 7, 2026
4d3ce22
Move hasql-transaction to vendor/hasql-transaction
wolfgangwalther Jul 7, 2026
d2c93f4
Move hasql-implicits to vendor/hasql-implicits
wolfgangwalther Jul 7, 2026
47b23d7
Move hasql-notifications to vendor/hasql-hasql-notifications
wolfgangwalther Jul 8, 2026
a937e83
Move hasql-pool to vendor/hasql-pool
wolfgangwalther Jul 12, 2026
2d2e79b
Merge 'hasql/1.9.3.1' into main
wolfgangwalther Jul 7, 2026
dd643b3
Merge 'hasql-dynamic-statements/0.3.1.8' into main
wolfgangwalther Jul 7, 2026
7f75122
Merge 'hasql-pool/1.3.0.3' into main
wolfgangwalther Jul 12, 2026
814a8f1
Merge 'hasql-transaction/1.2.1' into main
wolfgangwalther Jul 7, 2026
4b2690e
Merge 'hasql-implicits/0.2.0.1' into main
wolfgangwalther Jul 7, 2026
a191be4
Merge 'hasql-notifications/0.2.4.0' into main
wolfgangwalther Jul 8, 2026
5628996
chore(hasql*): remove supporting files
wolfgangwalther Jul 7, 2026
15ab636
chore(hasql*): merge vendored LICENSEs into main LICENSE file
wolfgangwalther Jul 7, 2026
35b4712
chore(hasql*): use vendored source code
wolfgangwalther Jul 7, 2026
9110378
chore(hasql*): run postgrest-style on vendored dependencies
wolfgangwalther Jul 8, 2026
450759c
chore(hasql*): run postgrest-lint on vendored dependencies
wolfgangwalther Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Copyright (c) 2014-2026 The PostgREST contributors
Copyright (c) 2014, Nikita Volkov (hasql)
Copyright (c) 2015, Nikita Volkov (hasql-pool, hasql-transaction)
Copyright (c) 2019, Nikita Volkov (hasql-dynamic-statements, hasql-implicits)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -18,3 +21,36 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---

Diogo Biazus (c) 2020 (hasql-notifications)

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Author name here nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let
src =
pkgs.lib.sourceFilesBySuffices
(pkgs.gitignoreSource ./.)
[ ".cabal" ".hs" ".lhs" "LICENSE" ];
[ ".cabal" ".hs" ".hsc" ".lhs" "LICENSE" ];

allOverlays =
import nix/overlays;
Expand Down
141 changes: 132 additions & 9 deletions postgrest.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,135 @@ flag hpc
manual: True
description: Enable HPC (dev only)

library hasql
default-language: Haskell2010
Comment thread
taimoorzaeem marked this conversation as resolved.
default-extensions: ApplicativeDo
BangPatterns
BlockArguments
ConstraintKinds
DataKinds
DefaultSignatures
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DerivingVia
EmptyDataDecls
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
ImportQualifiedPost
LambdaCase
LiberalTypeSynonyms
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
NoImplicitPrelude
NoMonomorphismRestriction
NumericUnderscores
OverloadedStrings
PatternGuards
QuasiQuotes
RankNTypes
RecordWildCards
RoleAnnotations
ScopedTypeVariables
StandaloneDeriving
StrictData
TupleSections
TypeApplications
TypeFamilies
TypeOperators
hs-source-dirs: src/hasql
exposed-modules: Hasql.Connection
Hasql.Connection.Setting
Hasql.Connection.Setting.Connection
Hasql.Connection.Setting.Connection.Param
Hasql.Decoders
Hasql.DynamicStatements.Session
Hasql.DynamicStatements.Snippet
Hasql.DynamicStatements.Statement
Hasql.Encoders
Hasql.Implicits.Encoders
Hasql.Notifications
Hasql.Pipeline
Hasql.Pool
Hasql.Pool.Config
Hasql.Pool.Config.Defaults
Hasql.Pool.Observation
Hasql.Session
Hasql.Statement
Hasql.Transaction
Hasql.Transaction.Sessions
other-modules: Hasql.Commands
Hasql.Connection.Config
Hasql.Connection.Config.ConnectionString
Hasql.Connection.Config.ConnectionString.Params
Hasql.Connection.Core
Hasql.Decoders.All
Hasql.Decoders.Array
Hasql.Decoders.Composite
Hasql.Decoders.Result
Hasql.Decoders.Results
Hasql.Decoders.Row
Hasql.Decoders.Value
Hasql.DynamicStatements.Prelude
Hasql.DynamicStatements.Snippet.Defs
Hasql.Encoders.All
Hasql.Encoders.Array
Hasql.Encoders.Params
Hasql.Encoders.Value
Hasql.Errors
Hasql.IO
Hasql.Implicits.Prelude
Hasql.LibPq14
Hasql.LibPq14.Ffi
Hasql.LibPq14.Mappings
Hasql.Pipeline.Core
Hasql.Pool.Config.Config
Hasql.Pool.Config.Setting
Hasql.Pool.Prelude
Hasql.Pool.SessionErrorDestructors
Hasql.PostgresTypeInfo
Hasql.Prelude
Hasql.PreparedStatementRegistry
Hasql.Session.Core
Hasql.Transaction.Config
Hasql.Transaction.Private.Prelude
Hasql.Transaction.Private.SQL
Hasql.Transaction.Private.Sessions
Hasql.Transaction.Private.Statements
Hasql.Transaction.Private.Transaction
build-depends: aeson >= 2 && < 3
, attoparsec >= 0.10 && < 0.15
, base >= 4.14 && < 5
, bytestring >= 0.10.8.2 && < 0.13
, bytestring-strict-builder >= 0.4.5.1 && < 0.5
, bytestring-tree-builder >= 0.2.7.8 && < 0.3
, containers >= 0.6 && < 0.8
, contravariant >= 1.3 && < 2
, dlist >= 0.8 && < 0.9 || >= 1 && < 2
, hashable >= 1.2 && < 2
, hashtables >= 1.1 && < 2
, iproute >= 1.7 && < 1.8
, mtl >= 2.2 && < 3
, postgresql-binary >= 0.14.2 && < 0.15
, postgresql-libpq >= 0.10.1 && < 0.12
, profunctors >= 5.1 && < 6
, ptr >= 0.16.7.2 && < 0.17
, scientific >= 0.3 && < 0.4
, stm >= 2.5 && < 3
, text >= 2 && < 3
, text-builder >= 1 && < 1.1
, time >= 1.9 && < 2
, transformers >= 0.6 && < 0.7
, uuid >= 1.3 && < 2
, vector >= 0.10 && < 0.14
, witherable >= 0.5 && < 0.6

library
default-language: Haskell2010
default-extensions: OverloadedStrings
Expand Down Expand Up @@ -121,11 +250,7 @@ library
, extra >= 1.7.0 && < 2.0
, fast-logger >= 3.2.0 && < 3.3
, fuzzyset >= 0.2.4 && < 0.3
, hasql >= 1.9 && <= 1.9.3.1
, hasql-dynamic-statements >= 0.3.1 && <= 0.3.1.8
, hasql-notifications >= 0.2.4.0 && < 0.3
, hasql-pool >= 1.1 && <= 1.3.0.4
, hasql-transaction >= 1.0.1 && <= 1.2.1
, postgrest:hasql
, http-client >= 0.7.19 && < 0.8
, http-types >= 0.12.2 && < 0.13
, insert-ordered-containers >= 0.2.2 && < 0.3
Expand Down Expand Up @@ -284,8 +409,7 @@ test-suite spec
, bytestring >= 0.10.8 && < 0.13
, case-insensitive >= 1.2 && < 1.3
, containers >= 0.5.7 && < 0.8
, hasql-pool >= 1.0.1 && <= 1.3.0.4
, hasql-transaction >= 1.0.1 && <= 1.2.1
, postgrest:hasql
, heredoc >= 0.2 && < 0.3
, hspec >= 2.3 && < 2.12
, hspec-expectations >= 0.8.4 && < 0.9
Expand Down Expand Up @@ -330,8 +454,7 @@ test-suite observability
build-depends: base >= 4.9 && < 4.22
, base64-bytestring >= 1 && < 1.3
, bytestring >= 0.10.8 && < 0.13
, hasql-pool >= 1.0.1 && <= 1.3.0.4
, hasql-transaction >= 1.0.1 && <= 1.2.1
, postgrest:hasql
, hspec >= 2.3 && < 2.12
, hspec-expectations >= 0.8.4 && < 0.9
, hspec-wai >= 0.10 && < 0.12
Expand Down
27 changes: 27 additions & 0 deletions src/hasql/Hasql/Commands.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module Hasql.Commands
( Commands,
asBytes,
setEncodersToUTF8,
setMinClientMessagesToWarning,
)
where

import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
import Hasql.Prelude

newtype Commands
= Commands (DList BB.Builder)
deriving (Semigroup, Monoid)

asBytes :: Commands -> ByteString
asBytes (Commands list) =
BL.toStrict $ BB.toLazyByteString $ foldMap (<> BB.char7 ';') list

setEncodersToUTF8 :: Commands
setEncodersToUTF8 =
Commands (pure "SET client_encoding = 'UTF8'")

setMinClientMessagesToWarning :: Commands
setMinClientMessagesToWarning =
Commands (pure "SET client_min_messages TO WARNING")
12 changes: 12 additions & 0 deletions src/hasql/Hasql/Connection.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- |
-- This module provides a low-level effectful API dealing with the connections to the database.
module Hasql.Connection
( Connection,
ConnectionError,
acquire,
release,
withLibPQConnection,
)
where

import Hasql.Connection.Core
29 changes: 29 additions & 0 deletions src/hasql/Hasql/Connection/Config.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module Hasql.Connection.Config where

import Hasql.Prelude

data Config = Config
{ connectionString :: ByteString,
usePreparedStatements :: Bool
}

class Updates a where
update :: a -> Config -> Config

nil :: Config
nil =
Config
{ connectionString = "",
usePreparedStatements = True
}

fromUpdates :: (Updates a) => [a] -> Config
fromUpdates = foldl' (flip update) nil

setConnectionString :: ByteString -> Config -> Config
setConnectionString connectionString config =
config {connectionString}

setUsePreparedStatements :: Bool -> Config -> Config
setUsePreparedStatements usePreparedStatements config =
config {usePreparedStatements}
31 changes: 31 additions & 0 deletions src/hasql/Hasql/Connection/Config/ConnectionString.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module Hasql.Connection.Config.ConnectionString where

import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.Map.Strict as Map
import qualified Data.Text.Encoding
import qualified Hasql.Connection.Config.ConnectionString.Params as Params
import Hasql.Prelude

type ConnectionString = ByteString

class Constructs a where
construct :: a -> ConnectionString

fromText :: Text -> ConnectionString
fromText = Data.Text.Encoding.encodeUtf8

fromParams :: Params.Params -> ConnectionString
fromParams =
B.intercalate " " . fmap renderParam . Map.toList
where
renderParam (k, v) = mconcat [k, "=", "'", escapeSingleQuote v, "'"]

escapeSingleQuote =
BC.concatMap
( \w ->
case w of
'\'' -> BC.pack "\\'"
'\\' -> BC.pack "\\\\"
_ -> BC.singleton w
)
18 changes: 18 additions & 0 deletions src/hasql/Hasql/Connection/Config/ConnectionString/Params.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Hasql.Connection.Config.ConnectionString.Params where

import qualified Data.Map.Strict as Map
import Hasql.Prelude

type Params = Map.Map ByteString ByteString

class Updates a where
update :: a -> Params -> Params

nil :: Params
nil = Map.empty

fromUpdates :: (Updates a) => [a] -> Params
fromUpdates = foldl' (flip update) nil

setKeyValue :: ByteString -> ByteString -> Params -> Params
setKeyValue = Map.insert
Loading
Loading