Skip to content

Commit 6a1b8f3

Browse files
committed
Add a release checklist
1 parent 9b3781c commit 6a1b8f3

File tree

5 files changed

+41
-31
lines changed

5 files changed

+41
-31
lines changed

.cocoadocs.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

Documentation/Release.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SQLite.swift Release checklist
2+
3+
* [ ] Make sure current master branch has a green build
4+
* [ ] Make sure `CHANGELOG.md` is up-to-date
5+
* [ ] Run `pod lib lint` locally
6+
* [ ] Update the version numbers mentioned in `README.md`, `Documentation/Index.md`
7+
* [ ] Update `MARKETING_VERSION` in `SQLite.xcodeproj/project.pbxproj`
8+
* [ ] Create a tag with the version number (`x.y.z`)
9+
* [ ] Publish to CocoaPods: `pod trunk push`
10+
* [ ] Update the release information on GitHub

SQLite.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
19A17BA55DABB480F9020C8A /* DateAndTimeFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateAndTimeFunctions.swift; sourceTree = "<group>"; };
233233
19A17E2695737FAB5D6086E3 /* fixtures */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = folder; path = fixtures; sourceTree = "<group>"; };
234234
3717F907221F5D7C00B9BD3D /* CustomAggregationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAggregationTests.swift; sourceTree = "<group>"; };
235+
19A17EA3A313F129011B3FA0 /* Release.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = Release.md; sourceTree = "<group>"; };
235236
3D67B3E51DB2469200A4F4C6 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/usr/lib/libsqlite3.tbd; sourceTree = DEVELOPER_DIR; };
236237
3DDC112E26CDBA0200CE369F /* SQLiteObjc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SQLiteObjc.h; path = ../SQLiteObjc/include/SQLiteObjc.h; sourceTree = "<group>"; };
237238
49EB68C31F7B3CB400D89D40 /* Coding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coding.swift; sourceTree = "<group>"; };
@@ -496,6 +497,7 @@
496497
children = (
497498
EE247B8F1C3F822500AE3E12 /* Index.md */,
498499
EE247B901C3F822500AE3E12 /* Resources */,
500+
19A17EA3A313F129011B3FA0 /* Release.md */,
499501
);
500502
path = Documentation;
501503
sourceTree = "<group>";

Sources/SQLite/Typed/CustomFunctions.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,67 +160,67 @@ public extension Connection {
160160
}
161161

162162
// MARK: -
163-
164-
public func createAggregation<T: AnyObject>(
163+
164+
func createAggregation<T: AnyObject>(
165165
_ aggregate: String,
166166
argumentCount: UInt? = nil,
167167
deterministic: Bool = false,
168168
initialValue: T,
169169
reduce: @escaping (T, [Binding?]) -> T,
170170
result: @escaping (T) -> Binding?
171171
) {
172-
172+
173173
let step: ([Binding?], UnsafeMutablePointer<UnsafeMutableRawPointer>) -> () = { (bindings, ptr) in
174174
let p = ptr.pointee.assumingMemoryBound(to: T.self)
175175
let current = Unmanaged<T>.fromOpaque(p).takeRetainedValue()
176176
let next = reduce(current, bindings)
177177
ptr.pointee = Unmanaged.passRetained(next).toOpaque()
178178
}
179-
179+
180180
let final: (UnsafeMutablePointer<UnsafeMutableRawPointer>) -> Binding? = { (ptr) in
181181
let p = ptr.pointee.assumingMemoryBound(to: T.self)
182182
let obj = Unmanaged<T>.fromOpaque(p).takeRetainedValue()
183183
let value = result(obj)
184184
ptr.deallocate()
185185
return value
186186
}
187-
187+
188188
let state: () -> UnsafeMutablePointer<UnsafeMutableRawPointer> = {
189189
let p = UnsafeMutablePointer<UnsafeMutableRawPointer>.allocate(capacity: 1)
190190
p.pointee = Unmanaged.passRetained(initialValue).toOpaque()
191191
return p
192192
}
193-
193+
194194
createAggregation(aggregate, step: step, final: final, state: state)
195195
}
196-
197-
public func createAggregation<T>(
196+
197+
func createAggregation<T>(
198198
_ aggregate: String,
199199
argumentCount: UInt? = nil,
200200
deterministic: Bool = false,
201201
initialValue: T,
202202
reduce: @escaping (T, [Binding?]) -> T,
203203
result: @escaping (T) -> Binding?
204204
) {
205-
205+
206206
let step: ([Binding?], UnsafeMutablePointer<T>) -> () = { (bindings, p) in
207207
let current = p.pointee
208208
let next = reduce(current, bindings)
209209
p.pointee = next
210210
}
211-
211+
212212
let final: (UnsafeMutablePointer<T>) -> Binding? = { (p) in
213213
let v = result(p.pointee)
214214
p.deallocate()
215215
return v
216216
}
217-
217+
218218
let state: () -> UnsafeMutablePointer<T> = {
219219
let p = UnsafeMutablePointer<T>.allocate(capacity: 1)
220220
p.pointee = initialValue
221221
return p
222222
}
223-
223+
224224
createAggregation(aggregate, step: step, final: final, state: state)
225225
}
226226

Tests/SQLiteTests/CustomAggregationTests.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ import SQLite3
1616
class CustomAggregationTests : SQLiteTestCase {
1717
override func setUp() {
1818
super.setUp()
19-
CreateUsersTable()
20-
try! InsertUser("Alice", age: 30, admin: true)
21-
try! InsertUser("Bob", age: 25, admin: true)
22-
try! InsertUser("Eve", age: 28, admin: false)
19+
createUsersTable()
20+
try! insertUser("Alice", age: 30, admin: true)
21+
try! insertUser("Bob", age: 25, admin: true)
22+
try! insertUser("Eve", age: 28, admin: false)
2323
}
24-
24+
2525
func testUnsafeCustomSum() {
2626
let step = { (bindings: [Binding?], state: UnsafeMutablePointer<Int64>) in
2727
if let v = bindings[0] as? Int64 {
2828
state.pointee += v
2929
}
3030
}
31-
31+
3232
let final = { (state: UnsafeMutablePointer<Int64>) -> Binding? in
3333
let v = state.pointee
3434
let p = UnsafeMutableBufferPointer(start: state, count: 1)
@@ -41,13 +41,13 @@ class CustomAggregationTests : SQLiteTestCase {
4141
return v.baseAddress!
4242
}
4343
let result = try! db.prepare("SELECT mySUM1(age) AS s FROM users")
44-
let i = result.columnNames.index(of: "s")!
44+
let i = result.columnNames.firstIndex(of: "s")!
4545
for row in result {
4646
let value = row[i] as? Int64
4747
XCTAssertEqual(83, value)
4848
}
4949
}
50-
50+
5151
func testUnsafeCustomSumGrouping() {
5252
let step = { (bindings: [Binding?], state: UnsafeMutablePointer<Int64>) in
5353
if let v = bindings[0] as? Int64 {
@@ -66,19 +66,19 @@ class CustomAggregationTests : SQLiteTestCase {
6666
return v.baseAddress!
6767
}
6868
let result = try! db.prepare("SELECT mySUM2(age) AS s FROM users GROUP BY admin ORDER BY s")
69-
let i = result.columnNames.index(of: "s")!
69+
let i = result.columnNames.firstIndex(of: "s")!
7070
let values = result.compactMap { $0[i] as? Int64 }
7171
XCTAssertTrue(values.elementsEqual([28, 55]))
7272
}
73-
73+
7474
func testCustomSum() {
7575
let reduce : (Int64, [Binding?]) -> Int64 = { (last, bindings) in
7676
let v = (bindings[0] as? Int64) ?? 0
7777
return last + v
7878
}
7979
let _ = db.createAggregation("myReduceSUM1", initialValue: Int64(2000), reduce: reduce, result: { $0 })
8080
let result = try! db.prepare("SELECT myReduceSUM1(age) AS s FROM users")
81-
let i = result.columnNames.index(of: "s")!
81+
let i = result.columnNames.firstIndex(of: "s")!
8282
for row in result {
8383
let value = row[i] as? Int64
8484
XCTAssertEqual(2083, value)
@@ -92,11 +92,11 @@ class CustomAggregationTests : SQLiteTestCase {
9292
}
9393
let _ = db.createAggregation("myReduceSUM2", initialValue: Int64(3000), reduce: reduce, result: { $0 })
9494
let result = try! db.prepare("SELECT myReduceSUM2(age) AS s FROM users GROUP BY admin ORDER BY s")
95-
let i = result.columnNames.index(of: "s")!
95+
let i = result.columnNames.firstIndex(of: "s")!
9696
let values = result.compactMap { $0[i] as? Int64 }
9797
XCTAssertTrue(values.elementsEqual([3028, 3055]))
9898
}
99-
99+
100100
func testCustomStringAgg() {
101101
let initial = String(repeating: " ", count: 64)
102102
let reduce : (String, [Binding?]) -> String = { (last, bindings) in
@@ -105,13 +105,13 @@ class CustomAggregationTests : SQLiteTestCase {
105105
}
106106
let _ = db.createAggregation("myReduceSUM3", initialValue: initial, reduce: reduce, result: { $0 })
107107
let result = try! db.prepare("SELECT myReduceSUM3(email) AS s FROM users")
108-
let i = result.columnNames.index(of: "s")!
108+
let i = result.columnNames.firstIndex(of: "s")!
109109
for row in result {
110110
let value = row[i] as? String
111111
XCTAssertEqual("\(initial)Alice@example.comBob@example.comEve@example.com", value)
112112
}
113113
}
114-
114+
115115
func testCustomObjectSum() {
116116
{
117117
let initial = TestObject(value: 1000)
@@ -126,7 +126,7 @@ class CustomAggregationTests : SQLiteTestCase {
126126
{
127127
XCTAssertEqual(TestObject.inits, 1)
128128
let result = try! db.prepare("SELECT myReduceSUMX(age) AS s FROM users")
129-
let i = result.columnNames.index(of: "s")!
129+
let i = result.columnNames.firstIndex(of: "s")!
130130
for row in result {
131131
let value = row[i] as? Int64
132132
XCTAssertEqual(1083, value)
@@ -143,7 +143,7 @@ class CustomAggregationTests : SQLiteTestCase {
143143
class TestObject {
144144
static var inits = 0
145145
static var deinits = 0
146-
146+
147147
var value: Int64
148148
init(value: Int64) {
149149
self.value = value

0 commit comments

Comments
 (0)