Skip to content

Commit 1af0c64

Browse files
committed
Document traits
1 parent 68edecd commit 1af0c64

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

Documentation/Index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,29 @@ process of downloading, compiling, and linking dependencies.
119119
$ swift build
120120
```
121121

122+
#### Available traits
123+
124+
The Swift package manager now supports [traits][], which can be used to configure
125+
SQLite.swift for different use cases.
126+
127+
```swift
128+
dependencies: [
129+
.package(url: "https://github.com/stephencelis/SQLite.swift.git",
130+
from: "0.15.4",
131+
traits: ["XXX"])
132+
]
133+
```
134+
135+
| Trait | Description |
136+
|--------------------------|---------------------------------------------------|
137+
| `SystemSQLite` (default) | Uses the system SQLite (provided by Apple) |
138+
| `SwiftToolchainCSQLite` | Embeds the SQLite provided by [swift-toolchain][] |
139+
| `StandaloneSQLite` | Only used by CocoaPods |
140+
| `SQLCipher` | Embeds [SQLCipher][] (see below) |
141+
142+
[traits]: https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/packagetraits/
143+
[swift-toolchain]: https://github.com/swiftlang/swift-toolchain-sqlite
144+
122145
#### Using SQLite.swift with SQLCipher
123146

124147
If you want to use [SQLCipher][] with SQLite.swift you can specify the `SQLCipher` trait when consuming SQLite.swift.

Documentation/Linux.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55
* Custom functions/aggregations are currently not supported and crash, caused by a bug in Swift.
66
See [#1071](https://github.com/stephencelis/SQLite.swift/issues/1071).
77

8+
## Installation
9+
10+
On Linux you should enable the `SwiftToolchainCSQLite` trait to automatically
11+
embed SQLite:
12+
13+
```swift
14+
dependencies: [
15+
.package(url: "https://github.com/stephencelis/SQLite.swift.git",
16+
from: "0.15.4",
17+
traits: ["SwiftToolchainCSQLite"])
18+
]
19+
```
20+
21+
See the [main documentation](Index.md#available-traits) for a list of all available traits.
22+
823
## Debugging
924

1025
### Create and launch docker container

0 commit comments

Comments
 (0)