Comments (4)
That's a method but not a good idea. I think treat Builder
as a subquery is a better idea for performance.
from builder.
I found a solution, anyway, support the Builder
as the value directly will be nice..
subsql, subargs, err := builder.Select("id").From("table_b").Where(builder.And(builder.Eq{"b": "a"})).ToSQL()
b := builder.Select("a, b").From("table_a").Where(
builder.And(builder.Eq{
"id": 23,
"b_id": builder.Expr(subsql, subargs...),
}),
)
sql, args, err := b.ToSQL()
fmt.Println(sql)
fmt.Println(args)
fmt.Println(err)
from builder.
The issue doesn't actually exists, my bad..
from builder.
Yes, this feature has been implemented. See the test a4a881a
from builder.
Related Issues (15)
- Insert: sort column names HOT 1
- Proposal: quote column names HOT 5
- how to build sql with limit and order by HOT 3
- Postgres complaining about parameters HOT 2
- Struct to sql query for create table
- Why `Builder.limitWriteTo` erase limit condition? HOT 3
- INSERT column sorting is broken HOT 5
- Create SQL by builder and populate struct slice HOT 1
- Insert argument wrong order HOT 3
- Add `GroupBy` HOT 1
- How to use Mysql's "regexp" or postgresql's "~*" ? HOT 1
- ToBoundSQL函数 不能过滤参数防止SQL注入吗? HOT 6
- Cond interface needs iterator
- how to use builder with xorm 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 builder.