Coder Social home page Coder Social logo

Comments (4)

ocharles avatar ocharles commented on August 18, 2024

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.

shane-circuithub avatar shane-circuithub commented on August 18, 2024

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 Statements. 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.

ocharles avatar ocharles commented on August 18, 2024

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.

chris-martin avatar chris-martin commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.