Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7242e00

Browse files
docs
1 parent efb0e5b commit 7242e00

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

‎docs/howto/rename.md

Lines changed: 24 additions & 2 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /