Skip to content

Commit

Permalink
update readme for the struct-tag-cases usage
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Dec 21, 2023
1 parent 3422943 commit e1fc318
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,28 @@ down_singular = "teamName"
foreign = "Videos"
```


##### Custom Struct Tag Case

Sometimes you might want to customize the case style for different purpose, for example, use camel case for json format and use snake case for yaml,
You may create a section named `[struct-tag-cases]` to define these custom case for each different format:

```toml
[struct-tag-cases]
toml = "snake"
yaml = "camel"
json = "camel"
boil = "alias"
```

By default, the snake case will be used, so you can just setup only few formats:

```toml
[struct-tag-cases]
json = "camel"
```


##### Foreign Keys

You can add foreign keys not defined in the database to your models using the following configuration:
Expand Down

0 comments on commit e1fc318

Please sign in to comment.