Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example of including columns in model generation #567

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions templates/en/docs/db/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ Writing the files by hand is not the most efficient way to work. Soda (and Buffa

<%= partial("en/docs/db/model.md") %>

You can specify each column of the model to soda in order for it to generate the code for you, like this:

```bash
$ soda generate model [name] [column1]:[type] [column2]:[type]
```

This is how you would generate a person-model with columns for the persons name, age and bio:

```bash
$ soda generate model person name:string age:int bio:text
```

You can remove generated model by running:

```bash
Expand Down