Skip to content

Commit 5e40e51

Browse files
authored
Fix formatting issues in README.md
1 parent 831dcac commit 5e40e51

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ let database = try DB(path: "...")
5252
let todos = try await database.todoQueries.selectTodos.execute()
5353

5454
for todo in todos {
55-
print(todo.id, todo.name, todo.completedOn)
55+
print(todo.id, todo.name, todo.completedOn)
5656
}
5757

5858
// Easily observe any query as the database changes.
5959
for try await todos in database.todoQueries.selectTodos.observe() {
60-
print("Got todos", todos)
60+
print("Got todos", todos)
6161
}
6262
```
6363

@@ -66,7 +66,7 @@ No need to wrap your database in repositories. Just pass in the `any <Name>Query
6666
you can pass in `Queries.Just`, `Queries.Fail` or even `Queries.Test` for call counts.
6767
```swift
6868
class ViewModel {
69-
let selectTodos: any SelectTodosQuery
69+
let selectTodos: any SelectTodosQuery
7070
}
7171

7272
let live = ViewModel(selectTodos: db.todoQueries.selectTodos)
@@ -101,7 +101,7 @@ func main() async throws {
101101
let todos = try await database.selectTodos.execute()
102102

103103
for todo in todos {
104-
print(todo.id, todo.name, todo.completedOn)
104+
print(todo.id, todo.name, todo.completedOn)
105105
}
106106
}
107107
```
@@ -193,6 +193,13 @@ puresql init
193193
194194
### Adding Your First Migration
195195
The build tool will error if it is unable to find the `/Migrations` folder defined in the `puresql.yaml` file. Make sure the folder exists and add your first migration `0.sql`.
196+
197+
For clarity your migrations at this point should have the structure:
198+
```
199+
Migrations/
200+
0.sql
201+
```
202+
196203
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
197204
```
198205
puresql migrations add
@@ -231,7 +238,17 @@ let database = try DB(config: config)
231238
```
232239

233240
# Queries
234-
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
241+
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.
242+
243+
For example:
244+
```
245+
Migrations/
246+
0.sql
247+
Queries/
248+
Todo.sql
249+
```
250+
251+
The cli can do this automatically. In the same directory where `init` was run, execute
235252
```
236253
puresql queries add <some-name>
237254
```

0 commit comments

Comments
 (0)