Coder Social home page Coder Social logo

Comments (8)

ddellacosta avatar ddellacosta commented on June 3, 2024

So I have to think about this some more, but @jrdoane, why do we need an "engine" parameter vs. simply a namespace that you would include, like honeysql.format-postgresql or the like? Seems like all you need is a set of specific extensions which use built-ins like honeysql.format/fn-handler, honeysql.format/format-clause and the like. But I could be wrong about that--are there any vendor-specific features that require more customization than the built-in extension helpers can provide?

Ditto liking that whatever the solution may be, could provide an answer to the DDL problem.

from honeysql.

ddellacosta avatar ddellacosta commented on June 3, 2024

Ping @jkk and @MichaelBlume --this has been hanging out for a while and seems to impact a bunch of open PRs. Any thoughts as to the various options discussed above? I fundamentally would prefer to have vendor-specific libraries which you can include along with HoneySQL, vs. a vendor specific set of "engines" integrated into the main HoneySQL library. Would like to hear some other ideas.

from honeysql.

ddellacosta avatar ddellacosta commented on June 3, 2024

Related: #86, #96, #81

from honeysql.

MichaelBlume avatar MichaelBlume commented on June 3, 2024

@ddellacosta I'm pretty much in agreement, and I think honeysql already has what it needs to support those libraries.

from honeysql.

jrdoane avatar jrdoane commented on June 3, 2024

While I do agree that third-party "plugin" libraries would be nice, my concern is more of a specific nature. It's really not hard to add vendor specific functionality to HoneySQL but, the question is, could you use multiple vendor specific features at the same time? That is, how do you handle the case where you might need to generate not just PostgreSQL but, TransactSQL or MySQL as well in the same application? I suggested something like an engine because it wouldn't tie the entire library to a single implementation for a particular vendor. For cases like mine where the primary Clojure application I maintain is integration between systems, it wouldn't be outside of the realm of possibility that I would need to interface with more than one kind of database.

So, I'm all for doing stuff the way it is right now but, I do think that if you dig deep enough simply extending a singular multimethod or protocol alone might not offer enough flexibility to support generating SQL for multiple vendors in the same application. I'm sure it's an edge case but, something worth considering.

from honeysql.

rnewman avatar rnewman commented on June 3, 2024

I think I just ran into another aspect. The code has:

         ; Omit AS in FROM, JOIN, etc. - Oracle doesn't allow it
         (if (= :select *clause*)
           " AS "
           " ")

Well, it seems like sqlite requires an AS where it isn't documented to require one: in a subquery :from with an alias. If I'm right (and I've sent an email to the sqlite mailing list to check), then this is a spot where Oracle requires one behavior and sqlite requires another, and there's no compromise.

That implies either hacking in a switch, or coming back to tackle this issue.

from honeysql.

rnewman avatar rnewman commented on June 3, 2024

Update: my bad; sqlite does not require AS unless the subquery alias is ambiguous. No conflict, then, just a preference!

from honeysql.

seancorfield avatar seancorfield commented on June 3, 2024

Given HoneySQL's position of trying to be vendor-neutral and the fact that the three PRs referenced were all rejected due to that position, I'm closing this out.

from honeysql.

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.