Skip to content

Commit 567d8bd

Browse files
committed
docs
1 parent 7ba1d66 commit 567d8bd

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

Diff for: docs/howto/rename.md

+24-2
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:
@@ -93,7 +93,29 @@ type Writer struct {
9393
}
9494
```
9595

96+
## Parameter Structure Names
97+
98+
It is possible to rename the arguments a generated function would use.
99+
For example, if you had a generated function called `FindWriter`
100+
which used a generated name of `FindWriterParams`, you can choose to rename
101+
this:
102+
103+
```yaml
104+
version: "2"
105+
sql:
106+
- engine: postgresql
107+
queries: query.sql
108+
schema: query.sql
109+
overrides:
110+
go:
111+
rename:
112+
FindWriterParams: SomeOtherNameParams
113+
```
114+
115+
The target name must be unique, and even if multiple structures would
116+
have the same fields, there will be a conflict.
117+
96118
## Limitations
97119

98120
Rename mappings apply to an entire package. Therefore, a column named `foo` and
99-
a table name `foo` can't map to different rename values.
121+
a table name `foo` can't map to different rename values.

0 commit comments

Comments
 (0)