Skip to content

Commit a54099f

Browse files
authored
Merge branch 'main' into insert-onconflict-doupdate
2 parents 64dead3 + 9045819 commit a54099f

File tree

14 files changed

+534
-14
lines changed

14 files changed

+534
-14
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
env:
1818
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_PROJECT_CHANNEL_WEBHOOK_URL }}
1919
with:
20-
text: swift-structured-queries ${{ github.event.release.tag_name }} has been released.
20+
text: ${{ github.event.repository.name }} ${{ github.event.release.tag_name }} has been released.
2121
blocks: |
2222
[
2323
{
2424
"type": "header",
2525
"text": {
2626
"type": "plain_text",
27-
"text": "[[REPO]] ${{ github.event.release.tag_name}}"
27+
"text": "${{ github.event.repository.name }} ${{ github.event.release.tag_name}}"
2828
}
2929
},
3030
{
@@ -56,14 +56,14 @@ jobs:
5656
env:
5757
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}
5858
with:
59-
text: swift-structured-queries ${{ github.event.release.tag_name }} has been released.
59+
text: ${{ github.event.repository.name }} ${{ github.event.release.tag_name }} has been released.
6060
blocks: |
6161
[
6262
{
6363
"type": "header",
6464
"text": {
6565
"type": "plain_text",
66-
"text": "[[REPO]] ${{ github.event.release.tag_name}}"
66+
"text": "${{ github.event.repository.name }} ${{ github.event.release.tag_name}}"
6767
}
6868
},
6969
{

Package.resolved

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 6.0
1+
// swift-tools-version: 6.1
22

33
import CompilerPluginSupport
44
import PackageDescription
@@ -29,11 +29,19 @@ let package = Package(
2929
targets: ["StructuredQueriesSQLite"]
3030
),
3131
],
32+
traits: [
33+
.trait(
34+
name: "StructuredQueriesTagged",
35+
description: "Introduce StructuredQueries conformances to the swift-tagged package.",
36+
enabledTraits: []
37+
)
38+
],
3239
dependencies: [
3340
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.3"),
3441
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.8.1"),
35-
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.6.0"),
36-
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.1"),
42+
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.6.3"),
43+
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.4"),
44+
.package(url: "https://github.com/pointfreeco/swift-tagged", from: "0.10.0"),
3745
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.5.2"),
3846
.package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"602.0.0"),
3947
],
@@ -43,6 +51,11 @@ let package = Package(
4351
dependencies: [
4452
"StructuredQueriesSupport",
4553
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
54+
.product(
55+
name: "Tagged",
56+
package: "swift-tagged",
57+
condition: .when(traits: ["StructuredQueriesTagged"])
58+
),
4659
]
4760
),
4861
.target(

[email protected]

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
// swift-tools-version: 6.0
2+
3+
import CompilerPluginSupport
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "swift-structured-queries",
8+
platforms: [
9+
.iOS(.v13),
10+
.macOS(.v10_15),
11+
.tvOS(.v13),
12+
.watchOS(.v6),
13+
],
14+
products: [
15+
.library(
16+
name: "StructuredQueries",
17+
targets: ["StructuredQueries"]
18+
),
19+
.library(
20+
name: "StructuredQueriesCore",
21+
targets: ["StructuredQueriesCore"]
22+
),
23+
.library(
24+
name: "StructuredQueriesTestSupport",
25+
targets: ["StructuredQueriesTestSupport"]
26+
),
27+
.library(
28+
name: "_StructuredQueriesSQLite",
29+
targets: ["StructuredQueriesSQLite"]
30+
),
31+
],
32+
dependencies: [
33+
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.3"),
34+
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.8.1"),
35+
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.6.3"),
36+
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.4"),
37+
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.5.2"),
38+
.package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"602.0.0"),
39+
],
40+
targets: [
41+
.target(
42+
name: "StructuredQueriesCore",
43+
dependencies: [
44+
"StructuredQueriesSupport",
45+
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
46+
]
47+
),
48+
.target(
49+
name: "StructuredQueries",
50+
dependencies: [
51+
"StructuredQueriesCore",
52+
"StructuredQueriesMacros",
53+
]
54+
),
55+
.macro(
56+
name: "StructuredQueriesMacros",
57+
dependencies: [
58+
"StructuredQueriesSupport",
59+
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
60+
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
61+
]
62+
),
63+
.target(
64+
name: "StructuredQueriesSQLite",
65+
dependencies: [
66+
"StructuredQueries"
67+
]
68+
),
69+
.target(
70+
name: "StructuredQueriesTestSupport",
71+
dependencies: [
72+
"StructuredQueriesCore",
73+
.product(name: "CustomDump", package: "swift-custom-dump"),
74+
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
75+
]
76+
),
77+
.testTarget(
78+
name: "StructuredQueriesMacrosTests",
79+
dependencies: [
80+
"StructuredQueries",
81+
"StructuredQueriesMacros",
82+
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
83+
.product(name: "MacroTesting", package: "swift-macro-testing"),
84+
]
85+
),
86+
.testTarget(
87+
name: "StructuredQueriesTests",
88+
dependencies: [
89+
"StructuredQueries",
90+
"StructuredQueriesSQLite",
91+
"StructuredQueriesTestSupport",
92+
.product(name: "CustomDump", package: "swift-custom-dump"),
93+
.product(name: "Dependencies", package: "swift-dependencies"),
94+
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
95+
]
96+
),
97+
98+
.target(name: "StructuredQueriesSupport"),
99+
],
100+
swiftLanguageModes: [.v6]
101+
)
102+
103+
let swiftSettings: [SwiftSetting] = [
104+
.enableUpcomingFeature("MemberImportVisibility")
105+
// .unsafeFlags([
106+
// "-Xfrontend",
107+
// "-warn-long-function-bodies=50",
108+
// "-Xfrontend",
109+
// "-warn-long-expression-type-checking=50",
110+
// ])
111+
]
112+
113+
for index in package.targets.indices {
114+
package.targets[index].swiftSettings = swiftSettings
115+
}
116+
117+
#if !os(Darwin)
118+
package.targets.append(
119+
.systemLibrary(
120+
name: "StructuredQueriesSQLite3",
121+
providers: [.apt(["libsqlite3-dev"])]
122+
)
123+
)
124+
125+
for index in package.targets.indices {
126+
if package.targets[index].name == "StructuredQueriesSQLite" {
127+
package.targets[index].dependencies.append("StructuredQueriesSQLite3")
128+
}
129+
}
130+
#endif
131+
132+
#if !os(Windows)
133+
// Add the documentation compiler plugin if possible
134+
package.dependencies.append(
135+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
136+
)
137+
#endif

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,23 @@ And then adding the product to any target that needs access to the library:
230230
.product(name: "StructuredQueries", package: "swift-structured-queries"),
231231
```
232232

233+
If you are on Swift 6.1 or greater, you can enable package traits that extend the library with
234+
support for other libraries. For example, you can introduce type-safe identifiers to your tables
235+
_via_ [Tagged](https://github.com/pointfreeco/swift-tagged) by enabling the
236+
`StructuredQueriesTagged` trait:
237+
238+
```diff
239+
dependencies: [
240+
.package(
241+
url: "https://github.com/pointfreeco/swift-structured-queries",
242+
from: "0.1.0",
243+
+ traits: [
244+
+ "StructuredQueriesTagged",
245+
+ ]
246+
),
247+
]
248+
```
249+
233250
## Community
234251

235252
If you want to discuss this library or have a question about how to use it to solve a particular

0 commit comments

Comments
 (0)