Comments (4)
Do I need to drop down to the level of the hasql package and write Statements for "begin transaction", "commit", etc?
Currently, yes. Rel8 intentionally currently only exports Connection -> IO ()
type functions to be as un-opinionated as possible. However, many people have suggested this is a pretty painful, and in practice we have wrapped this internally at CircuitHub with our own effect system to deal with this. It's unclear to me what the right API is, though. If you have any thoughts, I'm all ears!
from rel8.
I don't see any real downside to exporting the select
, insert
, etc. functions in Hasql's Statement
monad rather than Connection -> IO ()
. People will have to depend on and import hasql
to construct a Connection
anyway, so they can easily use run
to recover a Connection -> IO a
function if that's what they'd rather work with. But it's much more convenient to use things like hasql-pool
and hasql-transaction
if we export Statement
s. I don't think this is even "opinionated" — it doesn't preclude somebody using a different solution — like I said, they can easily recover the current API with run
if they wanted to use something different.
from rel8.
Yea, I was also thinking of doing that - we already require people depend on hasql
anyway to acquire
a Connection
. My point about being opinionated was more about offering something like MonadRel8
(something beyond plain functions).
from rel8.
It does seem like rel8 is currently straddling an awkward middle ground between being a full-fledged complete way to interact with your database, and being merely one part of the hasql ecosystem. I wonder if perhaps it would benefit from a clear decision one way or the other?
from rel8.
Related Issues (20)
- Allow hedgehog 1.2 in test suite HOT 4
- rel8 1.4.0.0 does not build with opaleye 0.9.7.0 HOT 2
- Use `ilike` with newtype around `Text`
- How to filter `ListTable`? HOT 1
- instance for `Rel8able (Generically1 t)`
- compile times are extremely high HOT 2
- [Feature Request] Generate tests that can check against an actual postgres schema HOT 5
- [Question] What does the `NonEmpty String` list contain in `namesFromLabelsWith`? HOT 1
- Release a version compatible with `opaleye-0.10.2.0` HOT 1
- Rel8 Performance x100 Slower than SQL HOT 8
- Provide access to rel8 internals
- New Hackage release? HOT 3
- Using `DBEnum` with a newtype wrapper HOT 1
- Rel8able records make app slow to start up HOT 1
- Allow `exists` to be used within expressions
- Replace `CalendarDiffTime` with a more useful type, like `NominalDiffTime`
- Boolean comparison operators have confusing/incorrect documentation
- Improve documentation showing how different TableSchemas relates to an actual sql schema
- Gradual shift from Opaleye? HOT 1
- Bad escaping of lambdas in Haddocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rel8.