Skip to content

Commit 20148be

Browse files
committed
wip
1 parent 324ab9c commit 20148be

File tree

6 files changed

+27
-47
lines changed

6 files changed

+27
-47
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,19 @@ As well as more comprehensive example usage:
174174
## Demos
175175

176176
There are a number of sample applications that demonstrate how to use StructuredQueries in the
177-
[SharingGRDB](https://github.com/pointfreeco/sharing-grdb) repo. Check out
178-
[this](https://github.com/pointfreeco/sharing-grdb/tree/main/Examples) directory to see them all,
177+
[SQLiteData](https://github.com/pointfreeco/sqlite-data) repo. Check out
178+
[this](https://github.com/pointfreeco/sqlite-data/tree/main/Examples) directory to see them all,
179179
including:
180180

181-
* [Case Studies](https://github.com/pointfreeco/sharing-grdb/tree/main/Examples/CaseStudies):
181+
* [Case Studies](https://github.com/pointfreeco/sqlite-data/tree/main/Examples/CaseStudies):
182182
A number of case studies demonstrating the built-in features of the library.
183183

184-
* [Reminders](https://github.com/pointfreeco/sharing-grdb/tree/main/Examples/Reminders): A rebuild
184+
* [Reminders](https://github.com/pointfreeco/sqlite-data/tree/main/Examples/Reminders): A rebuild
185185
of Apple's [Reminders][reminders-app-store] app that uses a SQLite database to model the
186186
reminders, lists and tags. It features many advanced queries, such as searching, and stats
187187
aggregation.
188188

189-
* [SyncUps](https://github.com/pointfreeco/sharing-grdb/tree/main/Examples/SyncUps): We also
189+
* [SyncUps](https://github.com/pointfreeco/sqlite-data/tree/main/Examples/SyncUps): We also
190190
rebuilt Apple's [Scrumdinger][scrumdinger] demo application using modern, best practices for
191191
SwiftUI development, including using this library to query and persist state using SQLite.
192192

@@ -198,8 +198,8 @@ including:
198198
StructuredQueries is built with the goal of supporting any SQL database (SQLite, MySQL, Postgres,
199199
_etc._), but is currently tuned to work with SQLite. It currently has one official driver:
200200

201-
* [SharingGRDB](https://github.com/pointfreeco/sharing-grdb): A lightweight replacement for
202-
SwiftData and the `@Query` macro. SharingGRDB includes `StructuredQueriesGRDB`, a library that
201+
* [SQLiteData](https://github.com/pointfreeco/sqlite-data): A lightweight replacement for
202+
SwiftData and the `@Query` macro. SQLiteData includes `StructuredQueriesGRDB`, a library that
203203
integrates this one with the popular [GRDB](https://github.com/groue/GRDB.swift) SQLite library.
204204

205205
If you are interested in building a StructuredQueries integration for another database library,

Sources/StructuredQueriesCore/Documentation.docc/Articles/Integration.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Since this library focuses only on the building of type-safe queries, it does no
99
actually execute the query in a particular database. The library is built with the goal of being
1010
able to support any database (SQLite, MySQL, Postgres, _etc._), but currently is primarily tuned to
1111
work with SQLite. And further, it only comes with one official driver for SQLite, which is the
12-
[SharingGRDB][sharing-grdb-gh] library that uses the popular [GRDB][grdb-gh] library under the hood
13-
for interacting with SQLite.
12+
[SQLiteData] library that uses the popular [GRDB] library under the hood for interacting with
13+
SQLite.
1414

1515
If you are interested in building an integration of StructuredQueries with another database
1616
library, please [start a discussion][sq-discussions] and let us know of any challenges you
1717
encounter.
1818

19-
[sharing-grdb-gh]: http://github.com/pointfreeco/sharing-grdb
20-
[grdb-gh]: http://github.com/groue/GRDB.swift
19+
[SQLiteData]: http://github.com/pointfreeco/sqlite-data
20+
[GRDB]: http://github.com/groue/GRDB.swift
2121
[sq-discussions]: http://github.com/pointfreeco/swift-structured-queries/discussions/new/choose
2222

2323
### Case Study: SQLite
@@ -37,14 +37,14 @@ even integrate StructuredQueries into a 3rd party SQLite library.
3737
### Case Study: GRDB
3838

3939
We provide one first-party library that integrates StructuredQueries into SQLite, and that is in
40-
our [SharingGRDB][sharing-grdb-gh] library, which is a lightweight replacement for SwiftData and
40+
our [SQLiteData] library, which is a lightweight replacement for SwiftData and
4141
the `@Query` macro. It brings a suite of tools allow you to fetch and observe data from a database
4242
in your feature code, and views automatically update when data in the database changes.
4343

44-
The integration of StructuredQueries into SharingGRDB works in the manner outlined above, in
45-
<doc:Integration#Case-Study-SQLite>. The code can be found [here][sq-sharing-grdb], where you will
44+
The integration of StructuredQueries into SQLiteData works in the manner outlined above, in
45+
<doc:Integration#Case-Study-SQLite>. The code can be found [here][sq-sqlite-data], where you will
4646
find a ``QueryDecoder`` conformance, as well as some helper methods for fetching data using
4747
StructuredQueries and GRDB.
4848

49-
[sharing-grdb-gh]: http://github.com/pointfreeco/sharing-grdb
50-
[sq-sharing-grdb]: https://github.com/pointfreeco/sharing-grdb/tree/main/Sources/StructuredQueriesGRDBCore
49+
[SQLiteData: http://github.com/pointfreeco/sqlite-data
50+
[sq-sqlite-data]: https://github.com/pointfreeco/sqlite-data/tree/main/Sources/StructuredQueriesGRDBCore

Sources/StructuredQueriesCore/Documentation.docc/Articles/MigrationGuides/MigratingTo0.16.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Reminder.select { $exclaim($0.title) }
2626
```
2727

2828
For the query to successfully execute, you must also add the function to your SQLite database
29-
connection. This can be done in [SharingGRDB] (0.7.0+) using the `Database.add(function:)` method,
30-
_e.g._ when you first configure things:
29+
connection. This can be done in [SQLiteData] using the `Database.add(function:)` method, _e.g._ when
30+
you first configure things:
3131

32-
[SharingGRDB]: https://github.com/pointfreeco/sharing-grdb
32+
[SQLiteData]: https://github.com/pointfreeco/sqlite-data
3333

3434
```swift
3535
var configuration = Configuration()
@@ -61,23 +61,3 @@ func jsonArrayExclaim(_ strings: [String]) -> [String] {
6161
strings.map { $0.localizedUppercase + "!" }
6262
}
6363
```
64-
65-
### Breaking change: user-defined representations
66-
67-
To power things, a new initializer, ``QueryBindable/init(queryBinding:)``, was added to the
68-
``QueryBindable`` protocol. While most code should continue to compile, if you define your own
69-
query representations that conform to ``QueryRepresentable``, you will need to define this
70-
initializer upon upgrading.
71-
72-
For example, `JSONRepresentation` added the following initializer:
73-
74-
```swift
75-
public init?(queryBinding: QueryBinding) {
76-
guard case .text(let json) = queryBinding else { return nil }
77-
guard let queryOutput = try? jsonDecoder.decode(
78-
QueryOutput.self, from: Data(json.utf8)
79-
)
80-
else { return nil }
81-
self.init(queryOutput: queryOutput)
82-
}
83-
```

Sources/StructuredQueriesCore/Documentation.docc/Articles/MigrationGuides/MigratingTo0.18.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ StructuredQueries recently introduced a new module, StructuredQueriesSQLite, to
88
SQLite-specific helpers, and in 0.18 it has migrated many of its existing SQLite helpers into this
99
module.
1010

11-
If you are using SharingGRDB this migration should be mostly transparent, but if you are using
11+
If you are using SQLiteData this migration should be mostly transparent, but if you are using
1212
StructuredQueries directly and need access to these helpers, you must now explicitly import this
1313
helper module:
1414

Sources/StructuredQueriesCore/Seeds.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public struct Seeds: Sequence {
4242
/// ```
4343
///
4444
/// And then you can iterate over each insert statement and execute it given a database
45-
/// connection. For example, using the [SharingGRDB][] driver:
45+
/// connection. For example, using the [SQLiteData] driver:
4646
///
4747
/// ```swift
4848
/// try database.write { db in
@@ -55,16 +55,16 @@ public struct Seeds: Sequence {
5555
/// }
5656
/// ```
5757
///
58-
/// > Tip: [SharingGRDB][] extends GRDB's `Database` connection with a `seed` method that can
59-
/// > build and insert records in a single step:
58+
/// > Tip: [SQLiteData] extends GRDB's `Database` connection with a `seed` method that can build
59+
/// > and insert records in a single step:
6060
/// >
6161
/// > ```swift
6262
/// > try db.seed {
6363
/// > // ...
6464
/// > }
6565
/// > ```
6666
///
67-
/// [SharingGRDB]: https://github.com/pointfreeco/sharing-grdb
67+
/// [SQLiteData]: https://github.com/pointfreeco/sqlite-data
6868
///
6969
/// - Parameter build: A result builder closure that prepares statements to insert every built row.
7070
public init(@SeedsBuilder _ build: () -> [any Table]) {

Sources/StructuredQueriesSQLiteCore/Documentation.docc/Articles/CustomFunctions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Reminder.select { $exclaim($0.title) }
2626
```
2727

2828
For the query to successfully execute, you must also add the function to your SQLite database
29-
connection. This can be done in [SharingGRDB] (0.7.0+) using the `Database.add(function:)` method,
30-
_e.g._ when you first configure things:
29+
connection. This can be done in [SQLiteData] using the `Database.add(function:)` method, _e.g._ when
30+
you first configure things:
3131

32-
[SharingGRDB]: https://github.com/pointfreeco/sharing-grdb
32+
[SQLiteData]: https://github.com/pointfreeco/sqlite-data
3333

3434
```swift
3535
var configuration = Configuration()

0 commit comments

Comments
 (0)