File tree Expand file tree Collapse file tree 8 files changed +109
-5
lines changed
Expand file tree Collapse file tree 8 files changed +109
-5
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - ' *'
10+ workflow_dispatch :
11+
12+ concurrency :
13+ group : ci-${{ github.ref }}
14+ cancel-in-progress : true
15+
16+ jobs :
17+ library :
18+ name : macOS
19+ strategy :
20+ matrix :
21+ xcode : ['16.3']
22+ runs-on : macos-15
23+ steps :
24+ - uses : actions/checkout@v4
25+ - name : Select Xcode ${{ matrix.xcode }}
26+ run : sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
27+ - name : Run tests
28+ run : swift test
29+ - name : Build release
30+ run : swift build -c release
31+
32+ linux :
33+ name : Linux
34+ strategy :
35+ matrix :
36+ swift :
37+ - ' 6.1'
38+ runs-on : ubuntu-latest
39+ container : swift:${{ matrix.swift }}
40+ steps :
41+ - uses : actions/checkout@v4
42+ - name : Install SQLite
43+ run : apt update && apt -y install libsqlite3-dev
44+ - name : Build
45+ run : swift build
Original file line number Diff line number Diff line change 1+ NB : Compatible swift-format requires Xcode 16.3, not yet available on GitHub
2+ name : Format
3+
4+ on :
5+ push :
6+ branches :
7+ - main
8+
9+ concurrency :
10+ group : format-${{ github.ref }}
11+ cancel-in-progress : true
12+
13+ jobs :
14+ swift_format :
15+ name : swift-format
16+ runs-on : macos-15
17+ permissions :
18+ contents : write
19+ steps :
20+ - uses : actions/checkout@v4
21+ - name : Select Xcode 16.3
22+ run : sudo xcode-select -s /Applications/Xcode_16.3.app
23+ - name : Format
24+ run : make format
25+ - uses : stefanzweifel/git-auto-commit-action@v5
26+ with :
27+ commit_message : Run swift-format
28+ branch : ' main'
Original file line number Diff line number Diff line change @@ -114,6 +114,21 @@ for index in package.targets.indices {
114114 package . targets [ index] . swiftSettings = swiftSettings
115115}
116116
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+
117132#if !os(Windows)
118133 // Add the documentation compiler plugin if possible
119134 package . dependencies. append (
Original file line number Diff line number Diff line change 11# StructuredQueries
22
3- <!--
43[ ![ CI] ( https://github.com/pointfreeco/swift-structured-queries/workflows/CI/badge.svg )] ( https://github.com/pointfreeco/swift-structured-queries/actions?query=workflow%3ACI )
5- -->
6-
74[ ![ Slack] ( https://img.shields.io/badge/slack-chat-informational.svg?label=Slack&logo=slack )] ( https://www.pointfree.co/slack-invite )
85[ ![ ] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpointfreeco%2Fswift-structured-queries%2Fbadge%3Ftype%3Dswift-versions )] ( https://swiftpackageindex.com/pointfreeco/swift-structured-queries )
96[ ![ ] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpointfreeco%2Fswift-structured-queries%2Fbadge%3Ftype%3Dplatforms )] ( https://swiftpackageindex.com/pointfreeco/swift-structured-queries )
Original file line number Diff line number Diff line change 11import Foundation
2- import SQLite3
32import StructuredQueries
43
4+ #if canImport(Darwin)
5+ import SQLite3
6+ #else
7+ import StructuredQueriesSQLite3
8+ #endif
9+
510public struct Database {
611 @usableFromInline
712 let storage : Storage
Original file line number Diff line number Diff line change 1- import SQLite3
21import StructuredQueries
32
3+ #if canImport(Darwin)
4+ import SQLite3
5+ #else
6+ import StructuredQueriesSQLite3
7+ #endif
8+
49@usableFromInline
510struct SQLiteQueryDecoder : QueryDecoder {
611 @usableFromInline
Original file line number Diff line number Diff line change 1+ #ifndef StructuredQueriesSQLite3
2+ #define StructuredQueriesSQLite3
3+ #include <sqlite3.h>
4+ #endif
Original file line number Diff line number Diff line change 1+ module StructuredQueriesSQLite3 [system] {
2+ link "sqlite3"
3+ header "StructuredQueriesSQLite3.h"
4+ export *
5+ }
You can’t perform that action at this time.
0 commit comments