mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +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:
@@ -227,7 +227,9 @@ func (c *CardClient) DeleteOneID(id int) *CardDeleteOne {
|
||||
|
||||
// Query returns a query builder for Card.
|
||||
func (c *CardClient) Query() *CardQuery {
|
||||
return &CardQuery{config: c.config}
|
||||
return &CardQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a Card entity by its id.
|
||||
@@ -331,7 +333,9 @@ func (c *InfoClient) DeleteOneID(id int) *InfoDeleteOne {
|
||||
|
||||
// Query returns a query builder for Info.
|
||||
func (c *InfoClient) Query() *InfoQuery {
|
||||
return &InfoQuery{config: c.config}
|
||||
return &InfoQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a Info entity by its id.
|
||||
@@ -435,7 +439,9 @@ func (c *MetadataClient) DeleteOneID(id int) *MetadataDeleteOne {
|
||||
|
||||
// Query returns a query builder for Metadata.
|
||||
func (c *MetadataClient) Query() *MetadataQuery {
|
||||
return &MetadataQuery{config: c.config}
|
||||
return &MetadataQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a Metadata entity by its id.
|
||||
@@ -539,7 +545,9 @@ func (c *PetClient) DeleteOneID(id int) *PetDeleteOne {
|
||||
|
||||
// Query returns a query builder for Pet.
|
||||
func (c *PetClient) Query() *PetQuery {
|
||||
return &PetQuery{config: c.config}
|
||||
return &PetQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a Pet entity by its id.
|
||||
@@ -643,7 +651,9 @@ func (c *PostClient) DeleteOneID(id int) *PostDeleteOne {
|
||||
|
||||
// Query returns a query builder for Post.
|
||||
func (c *PostClient) Query() *PostQuery {
|
||||
return &PostQuery{config: c.config}
|
||||
return &PostQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a Post entity by its id.
|
||||
@@ -747,7 +757,9 @@ func (c *UserClient) DeleteOneID(id int) *UserDeleteOne {
|
||||
|
||||
// Query returns a query builder for User.
|
||||
func (c *UserClient) Query() *UserQuery {
|
||||
return &UserQuery{config: c.config}
|
||||
return &UserQuery{
|
||||
config: c.config,
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a User entity by its id.
|
||||
|
||||
Reference in New Issue
Block a user