Skip to content

Commit d3d88e8

Browse files
authored
Update README.md
1 parent 043f7e7 commit d3d88e8

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
</p>
1414

1515
# Overview
16-
Otter is a pure Swift SQL compiler that allow developers to write plain compile time safe SQL.
16+
Otter is a pure Swift SQL compiler that allow developers to simply write plain SQL with compile time safety.
17+
If your database schema changes, you will get compile time errors for the places that need to be fixed.
18+
It just doesn't generate the code to talk to SQLite, but rather your entire data layer in a testable
19+
flexible manner. No more writing mocks or wrappers. Just pass in the query.
1720

1821
- [Installation](#installation)
1922
- [Macros](#or-use-the-swift-macro)
@@ -59,6 +62,19 @@ for try await todos in database.todoQueries.selectTodos.observe() {
5962
}
6063
```
6164

65+
Otter is built with testing in mind. Dependency injection is possible right out of the box.
66+
No need to wrap your database in repositories. Just pass in the `any <Name>Query` and
67+
you can pass in `Queries.Just`, `Queries.Fail` or even `Queries.Test` for call counts.
68+
```swift
69+
class ViewModel {
70+
let selectTodos: any SelectTodosQuery
71+
}
72+
73+
let live = ViewModel(selectTodos: db.todoQueries.selectTodos)
74+
75+
let test = ViewModel(selectTodos: Queries.Just([...]))
76+
```
77+
6278
### Or Use the Swift Macro
6379
Otter can even run within a Swift macro by adding the `@Database` macro to a `struct`.
6480

@@ -377,6 +393,7 @@ ORDER BY rank;
377393
## Upcoming Features
378394
Otter is a young project and there are a lot of new features and functionality I want to add.
379395
Below are some idea that I would love input on!
396+
- LSP and vscode plugin
380397
- Support for multiple statements in a single query
381398
- Kotlin library/generation
382399
- Generating Kotlin would allow SQLite based apps to basically share their model/data layer
@@ -385,7 +402,7 @@ Below are some idea that I would love input on!
385402
- Queries with multiple statements
386403
- Would allow for easier loading of more complex models that have many joins
387404
- Want to allow other queries to be called from within the body to help centrize logic.
388-
- Postgres support for server side swift ❤️
405+
- Postgres support for server side swift
389406

390407
## Contributions
391408
Contributions are welcome and encouraged! Feel free to make a PR or open an issue. If the change is large please open an issue first to make sure the change is desired.

0 commit comments

Comments
 (0)