Skip to content

Commit f97b61c

Browse files
committed
Updated README
1 parent 6380293 commit f97b61c

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,15 @@ Each queries file will get it's own `Queries` types generated. To allow the quer
237237
passed around and injected together. For example, if we have a `Library.sql` the following types will be generated:
238238
```swift
239239
// Protocol that defines all queries in the file
240-
let queries: any LibraryQueriesType = database.libraryQueries
240+
let queries: LibraryQueries = database.libraryQueries
241241

242-
// Concrete implementaion
243-
let concreteType: LibraryQueriesImpl
244-
245-
// NO-OP version, can be injected into unit tests/previews
246-
let noopType: LibraryQueriesNoop
242+
// Queries that do not talk to a database and just return `nil` or `[]` via `Queries.Just`
243+
let noopQueries: LibraryQueries = .noop()
247244
```
248245

249-
For the `Noop` queries, we can override any query optionally. Each query be default will return `nil` or an empty `[]`. To override a query you can set it in the initializer.
246+
For the `noop` queries, we can override any query optionally. Each query be default will return `nil` or an empty `[]`. To override a query you can set it in the initializer.
250247
```swift
251-
LibraryQueriesNoop(getLibrary: Queries.Just([...]))
248+
LibraryQueries.noop(getLibrary: Queries.Just([...]))
252249
```
253250

254251
### Input and Output Types
@@ -303,7 +300,7 @@ struct UserPostsInput {
303300
let posts = try await database.userQueries.userPosts.execute(userId: id, dateLower: lower, dateUpper: upper)
304301

305302
// Or using the input type directly
306-
let posts = try await database.userQueries.userPosts.execute(with: UserPostInput(...))
303+
let posts = try await database.userQueries.userPosts.execute(UserPostInput(...))
307304
```
308305

309306
### Naming

0 commit comments

Comments
 (0)