mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entc/gen: allow users to alter Query initialization using templates (#1453)
* Templating: Allow user to alter Query struct init * Update entc/gen/template/dialect/sql/query.tmpl Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com> * pr feedback * renamed template * changed sql to * * to tabs * removed old template * update bin-data * Update entc/integration/template/ent/template/query.tmpl Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com> * restore newline * update bindata Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
This commit is contained in:
@@ -199,7 +199,9 @@ func (c *CityClient) DeleteOneID(id int) *CityDeleteOne {
|
||||
|
||||
// Query returns a query builder for City.
|
||||
func (c *CityClient) Query() *CityQuery {
|
||||
return &CityQuery{config: c.config}
|
||||
return &CityQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a City entity by its id.
|
||||
@@ -303,7 +305,9 @@ func (c *StreetClient) DeleteOneID(id int) *StreetDeleteOne {
|
||||
|
||||
// Query returns a query builder for Street.
|
||||
func (c *StreetClient) Query() *StreetQuery {
|
||||
return &StreetQuery{config: c.config}
|
||||
return &StreetQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a Street entity by its id.
|
||||
|
||||
Reference in New Issue
Block a user