Comments (2)
The syntax is just not documented well. All of these variations work fine (formatted for clarity):
user> (hsql/format
(hsql/build :select :*
:from :permission
:join [[:user :u] [:= :permission.user_id :u.id]
[:server :s] [:= :permission.server_id :s.id]]))
["SELECT *
FROM permission
INNER JOIN user u ON permission.user_id = u.id
INNER JOIN server s ON permission.server_id = s.id"]
user> (hsql/format
(hsql/build :select :*
:from :permission
:join [:user [:= :permission.user_id :user.id]
:server [:= :permission.server_id :server.id]]))
["SELECT *
FROM permission
INNER JOIN user ON permission.user_id = user.id
INNER JOIN server ON permission.server_id = server.id"]
user> (hsql/format
(hsql/build :select :*
:from [[:permission :p]]
:join [[:user :u] [:= :p.user_id :u.id]
:server [:= :p.server_id :server.id]]))
["SELECT *
FROM permission p
INNER JOIN user u ON p.user_id = u.id
INNER JOIN server ON p.server_id = server.id"]
user>
...etc.
from honeysql.
ah, thanks!
from honeysql.
Related Issues (20)
- 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
- formatf for positional parameter convenience? HOT 1
- Support `OVERRIDING SYSTEM VALUE` for inserts HOT 7
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.