Skip to content

Commit dbd26c3

Browse files
committed
docs
1 parent 6743bd1 commit dbd26c3

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

‎docs/howto/rename.md‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sql:
2121
queries: "postgresql/query.sql"
2222
engine: "postgresql"
2323
gen:
24-
go:
24+
go:
2525
package: "authors"
2626
out: "postgresql"
2727
rename:
@@ -116,6 +116,28 @@ type Publisher struct {
116116
}
117117
```
118118

119+
## Parameter Structure Names
120+
121+
It is possible to rename the arguments a generated function would use.
122+
For example, if you had a generated function called `FindWriter`
123+
which used a generated name of `FindWriterParams`, you can choose to rename
124+
this:
125+
126+
```yaml
127+
version: "2"
128+
sql:
129+
- engine: postgresql
130+
queries: query.sql
131+
schema: query.sql
132+
overrides:
133+
go:
134+
rename:
135+
FindWriterParams: SomeOtherNameParams
136+
```
137+
138+
The target name must be unique, and even if multiple structures would
139+
have the same fields, there will be a conflict.
140+
119141
## Limitations
120142

121143
Rename mappings apply to an entire package. Therefore, a column named `foo` and

0 commit comments

Comments
 (0)