You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can install the CLI tool via homebrew by executing:
138
147
```
139
148
brew tap wickwirew/wickwirew
140
149
brew install otter
@@ -150,19 +159,22 @@ This will create an `otter.yaml` configuration file. Here is where you can setup
150
159
> [!TIP]
151
160
> Follow the SQL standard and use singular table names. This will stop table structs from being named plural
152
161
153
-
#### Generating the Database
162
+
### Adding a New Migration
163
+
When a new migration is needed, you can simply add a new file with a number 1 higher than the previous. To automatically do this the cli tool can do it for you by running
164
+
```
165
+
otter migrations add
166
+
```
167
+
168
+
#### Generating the Database - Without Plugin
154
169
Once you have your first migration in and the project setup you can now generate the database. In the same directory where `init` was run, you run the `gen` command.
155
170
```
156
-
otter gen --output Queries.swift
171
+
otter generate
157
172
```
158
173
159
174
This will compile and check all migrations and queries, then generate all Swift required to talk to the database.
160
175
161
-
### Adding a New Migration
162
-
When a new migration is needed, you can simply add a new file with a number 1 higher than the previous. To automatically do this the cli tool can do it for you by running
163
-
```
164
-
otter migrations add
165
-
```
176
+
> [!WARNING]
177
+
> Plugin requires a clean build any time a new `sql` file is added so the input file list can be updated.
166
178
167
179
# Opening a Connection
168
180
Once you have your database being generated, you can now open a connection to it. Each database will automatically have a few initializers at hand to choose from. Each are listed below. When the connection is opened, all migrations are run instantly.
0 commit comments