Comments (8)
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.
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.
from honeysql.
@ddellacosta I'm pretty much in agreement, and I think honeysql already has what it needs to support those libraries.
from honeysql.
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.
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.
Update: my bad; sqlite does not require AS
unless the subquery alias is ambiguous. No conflict, then, just a preference!
from honeysql.
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)
- Inconsistent requirements for `:order-by` and `:group-by`
- Facilitate adding SQL keywords in between function arguments HOT 10
- Update docs for single keyword (symbol) uses? HOT 1
- Syntax for expanding records in PostgreSQL HOT 6
- :raw expects a single argument now HOT 1
- Improve exceptions/error reports HOT 2
- Postgres: On conflict update row with values where condition is met reports an error HOT 8
- HoneySQL2 makes all functions calls uppercase HOT 3
- Difficulties in converting documentation examples from hashmap form to helper function form HOT 5
- Postgres upsert support docs miss some of the supported cases
- `format` can emit syntactically invalid AS clauses HOT 1
- Nesting JOINs HOT 11
- Support H2's `TRUNCATE TABLE` syntax HOT 1
- Support for `postgres` "with ordinality" HOT 1
- Support for PostgreSQL interval type
- `:quoted` doesn't work together with `if exists` HOT 2
- Improve docs for UPDATE
- Does honeysql support pg's json path? HOT 4
- Use of VALUES with WITH should clarify it must be vector-of-vectors form
- ON CONFLICT should support expressions, not just entities
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 honeysql.