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
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,14 +128,13 @@ brew install TODO FIX THIS ONCE IT IS ACTUALLY IN BREW
128
128
129
129
Once the project has been added it is time to setup the queries and migrations folders. In the root of the project where you want everything to live, in terminal run the following command
130
130
```
131
-
feather init
131
+
otter init
132
132
```
133
133
134
-
This will create all diretories needed and will create your first migration. Your project should have 2 new folders and a swift file. In the migrations folder you will have a file named `1.sql`. You put your first migration code in there. The `Queries.swift` file is what the generated Swift code will be written too. The `gen` command will automatically recreate this if it gets deleted.
134
+
This will create all diretories needed and will create your first migration. Your project should have 2 new folders and a swift file. In the migrations folder you will have a file named `1.sql`. You put your first migration code in there.
135
135
```
136
136
/Migrations/1.sql
137
137
/Queries
138
-
Queries.swift
139
138
```
140
139
141
140
> [!TIP]
@@ -144,15 +143,15 @@ Queries.swift
144
143
#### Generating the Database
145
144
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.
146
145
```
147
-
feather gen
146
+
otter gen --output Queries.swift
148
147
```
149
148
150
149
This will compile and check all migrations and queries, then generate all Swift required to talk to the database.
151
150
152
151
### Adding a New Migration
153
152
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
154
153
```
155
-
feather migrate add
154
+
otter migrate add
156
155
```
157
156
158
157
# Opening a Connection
@@ -179,7 +178,7 @@ let database = try DB(config: config)
179
178
# Queries
180
179
All queries will be stored in the `/Queries` directory. More than one query can go in each file. To get started, create a new file in the `/Queries` directory. The cli can do this automatically. In the same directory where `init` was run, execute
181
180
```
182
-
feather queries add --name <some-name>
181
+
otter queries add --name <some-name>
183
182
```
184
183
185
184
Open the file that was created in `/Queries`, it should be blank. Individual queries can be defined using the the following format. At the moment a single query can only have one statement.
0 commit comments