Skip to content

Commit bf5b78c

Browse files
committed
Merge branch 'develop'
2 parents d5731a1 + 26c9bc0 commit bf5b78c

11 files changed

Lines changed: 98 additions & 65 deletions

File tree

.github/workflows/swift.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
image:
16-
- swift:5.3.2-xenial
17-
- swift:5.5.0-focal
18-
- swift:5.6.1-bionic
16+
- swift:5.9.2-focal
17+
- swift:5.10-jammy
18+
- swift:6.0-noble
1919
container: ${{ matrix.image }}
2020
steps:
2121
- name: Install SQLite
2222
run: |
2323
apt-get update
2424
apt-get -y install libsqlite3-dev
2525
- name: Checkout Repository
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2727
- name: Build Swift Debug Package
2828
run: swift build -c debug
2929
- name: Build Swift Release Package
@@ -34,11 +34,11 @@ jobs:
3434
runs-on: macos-latest
3535
steps:
3636
- name: Select latest available Xcode
37-
uses: maxim-lobanov/setup-xcode@v1.2.1
37+
uses: maxim-lobanov/setup-xcode@v1.5.1
3838
with:
39-
xcode-version: 13.2.1
39+
xcode-version: latest
4040
- name: Checkout Repository
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@v4
4242
- name: Build Xcode Project
4343
run: xcodebuild -project ZeeQL3.xcodeproj -scheme ZeeQL
4444
- name: Build Swift Debug Package

Sources/ZeeQL/Access/Codable/CodableModelEntityDecoder.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ extension CodableModelDecoder {
7777

7878
// MARK: - SingleContainer
7979

80-
private struct SingleContainer<EntityType: Decodable>
80+
private struct SingleContainer<E: Decodable>
8181
: SingleValueDecodingContainer
8282
{
8383
let log : ZeeQLLogger
84-
let decoder : CodableModelEntityDecoder<EntityType>
84+
let decoder : CodableModelEntityDecoder<E>
8585
var codingPath : [ CodingKey ] { return decoder.codingPath }
8686

87-
init(decoder: CodableModelEntityDecoder<EntityType>) {
87+
init(decoder: CodableModelEntityDecoder<E>) {
8888
self.decoder = decoder
8989
self.log = decoder.log
9090
}

Sources/ZeeQL/Access/DatabaseChannel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,9 +1145,9 @@ open class TypedDatabaseChannel<ObjectType: DatabaseObject> : DatabaseChannelBas
11451145
return ObjectType.self
11461146
}
11471147

1148-
func fetchObject<ObjectType>() -> ObjectType? {
1148+
func fetchObject<O>() -> O? {
11491149
guard let o = super.fetchObject() else { return nil }
1150-
guard let to = o as? ObjectType else {
1150+
guard let to = o as? O else {
11511151
// throw something
11521152
log.warn("fetchObject returned an unexpected type:", o, type(of: o))
11531153
return nil

Sources/ZeeQL/Access/SchemaGeneration.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public protocol SchemaGeneration: AnyObject {
3535
* FOREIGN KEY ( target_id ) REFERENCES target( target_id );
3636
* ALTER TABLE table DROP CONSTRAINT table2target;
3737
* - Note: constraint name must be known!
38+
*
39+
* SQLite doesn't support this (2023-09-06).
3840
*/
3941
var supportsDirectForeignKeyModification : Bool { get }
4042
}

Sources/ZeeQL/SQLite3Adaptor/SQLite3ModelFetch.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// ZeeQL3
44
//
55
// Created by Helge Hess on 14/04/17.
6-
// Copyright © 2017-2019 ZeeZide GmbH. All rights reserved.
6+
// Copyright © 2017-2021 ZeeZide GmbH. All rights reserved.
77
//
88

99
/**
@@ -49,7 +49,7 @@ open class SQLite3ModelFetch: AdaptorModelFetch {
4949
public func describeDatabaseNames(like: String?) throws -> [String] {
5050
// TBD: what about the _like? Which syntax is expected?
5151
var dbNames = [ String ]()
52-
try channel.querySQL("pragma database_list") { record in
52+
try channel.querySQL("PRAGMA database_list") { record in
5353
if let name = record["name"] as? String, name != "temp" {
5454
dbNames.append(name)
5555
}
@@ -89,14 +89,14 @@ open class SQLite3ModelFetch: AdaptorModelFetch {
8989
func _fetchColumnsOfTable(_ table: String) throws -> [ AdaptorRecord ] {
9090
// keys: cid, name, type, notnull, dflt_value, pk
9191
let records : [ AdaptorRecord ] =
92-
try channel.querySQL("pragma table_info(\(table))")
92+
try channel.querySQL("PRAGMA table_info(\(table))")
9393
return records
9494
}
9595

9696
func _fetchForeignKeysOfTable(_ table: String) throws -> [ AdaptorRecord ] {
9797
// keys: id, seq, table, from, to, on_update, on_delete, match
9898
let records : [ AdaptorRecord ] =
99-
try channel.querySQL("pragma foreign_key_list(\(table))")
99+
try channel.querySQL("PRAGMA foreign_key_list(\(table))")
100100
return records
101101
}
102102

Tests/ZeeQLTests/SQLite3CodableTests.swift

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,16 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
232232

233233
/* Containers */
234234

235-
internal final class KeyedContainer<T: Decodable, Key: CodingKey>
235+
internal final class KeyedContainer<D: Decodable, Key: CodingKey>
236236
: KeyedDecodingContainerProtocol
237237
{
238-
let decoder : AdaptorRecordDecoder<T>
238+
let decoder : AdaptorRecordDecoder<D>
239239
let log : ZeeQLLogger
240240

241241
let codingPath : [ CodingKey ]
242242
let allKeys : [ Key ]
243243

244-
init(decoder: AdaptorRecordDecoder<T>) {
244+
init(decoder: AdaptorRecordDecoder<D>) {
245245
self.decoder = decoder
246246
self.log = decoder.log
247247
self.codingPath = decoder.codingPath
@@ -275,8 +275,8 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
275275
* - base types column arrays, like `[Int]`,
276276
* - arrays of CodableObjectType`s aka relationships
277277
*/
278-
func decode<T>(_ type: T.Type, forKey key: Key) throws -> T
279-
where T : Decodable
278+
func decode<X>(_ type: X.Type, forKey key: Key) throws -> X
279+
where X : Decodable
280280
{
281281
switch type {
282282
case is RelationshipHolderType.Type:
@@ -331,9 +331,9 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
331331
}
332332

333333
private
334-
func decodeImplicitRelationshipHolder<T>(_ type: T.Type, forKey key: Key)
335-
throws -> T
336-
where T : Decodable
334+
func decodeImplicitRelationshipHolder<X>(_ type: X.Type, forKey key: Key)
335+
throws -> X
336+
where X : Decodable
337337
{
338338
// Right now this is an Array, eg `var addresses : [ Address ]`.
339339
// We just want to return an empty array here.
@@ -346,8 +346,8 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
346346
return v
347347
}
348348

349-
func decodeOtherType<T>(_ type: T.Type, forKey key: Key) throws -> T
350-
where T : Decodable
349+
func decodeOtherType<X>(_ type: X.Type, forKey key: Key) throws -> X
350+
where X : Decodable
351351
{
352352
log.trace("out of band type:", type, "for key:", key)
353353

@@ -358,10 +358,10 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
358358
/**
359359
* Decode base type column arrays, like `[ Int ]`
360360
*/
361-
func decodeBaseTypeArray<T, E>(_ type: T.Type,
361+
func decodeBaseTypeArray<X, E>(_ type: X.Type,
362362
_ elementType: E.Type,
363-
forKey key: Key) throws -> T
364-
where T : Decodable
363+
forKey key: Key) throws -> X
364+
where X : Decodable
365365
{
366366
log.error("TODO: Array<Int>")
367367
throw Error.unsupportedValueType(type)
@@ -376,9 +376,9 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
376376
* while the other was reflected on.
377377
*/
378378
private
379-
func decodeRelationshipHolder<T>(erasedHolderType : T.Type,
380-
forKey key : Key) throws -> T
381-
where T : Decodable
379+
func decodeRelationshipHolder<X>(erasedHolderType : X.Type,
380+
forKey key : Key) throws -> X
381+
where X : Decodable
382382
{
383383
guard let reflectedHolderType =
384384
erasedHolderType as? RelationshipHolderType.Type
@@ -402,9 +402,9 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
402402
*
403403
* This is not actually supported in the AdaptorDecoder.
404404
*/
405-
private func decodeDecodableObject<T>(_ type: T.Type,
406-
forKey key: Key) throws -> T
407-
where T : Decodable
405+
private func decodeDecodableObject<X>(_ type: X.Type,
406+
forKey key: Key) throws -> X
407+
where X : Decodable
408408
{
409409
log.trace(":decode:", key.stringValue, type)
410410
throw Error.unsupportedValueType(type) // FIXME: proper error
@@ -445,14 +445,14 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
445445
log.trace("decoded-value for key:", key, anyValue)
446446
return anyValue
447447
}
448-
func decodeBaseType<T>(forKey key: Key) throws -> T {
448+
func decodeBaseType<X>(forKey key: Key) throws -> X {
449449
let anyValue = try valueForKey(key)
450-
guard let v = anyValue as? T else {
450+
guard let v = anyValue as? X else {
451451
log.error("unexpected base value:", key,
452452
"\n value:", anyValue,
453453
"\n types:",
454-
type(of: anyValue), "vs", T.self, "\n")
455-
throw Error.unsupportedValueType(T.self)
454+
type(of: anyValue), "vs", X.self, "\n")
455+
throw Error.unsupportedValueType(X.self)
456456
}
457457
log.trace("decoded-key:", key, v)
458458
return v
@@ -542,11 +542,11 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
542542
* var addresses : [ Address ]
543543
*
544544
*/
545-
internal struct UnkeyedContainer<T: Decodable> : UnkeyedDecodingContainer {
545+
internal struct UnkeyedContainer<D: Decodable> : UnkeyedDecodingContainer {
546546
// TBD: is this also for `[ Int ]` and such? (I think we want to capture
547547
// those earlier as `[Int]`, `[Float]` etc).
548548
let log : ZeeQLLogger
549-
let decoder : AdaptorRecordDecoder<T>
549+
let decoder : AdaptorRecordDecoder<D>
550550

551551
let sourceKey : CodingKey
552552

@@ -556,7 +556,7 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
556556

557557
var count : Int? { return 0 } // no need to decode anything!
558558

559-
init(decoder : AdaptorRecordDecoder<T>, key : CodingKey) {
559+
init(decoder : AdaptorRecordDecoder<D>, key : CodingKey) {
560560
self.decoder = decoder
561561
self.log = decoder.log
562562
self.sourceKey = key
@@ -571,7 +571,7 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
571571
*
572572
* We create our ToMany relationship in here.
573573
*/
574-
mutating func decode<T>(_ type: T.Type) throws -> T where T : Decodable {
574+
mutating func decode<X>(_ type: X.Type) throws -> X where X : Decodable {
575575
log.trace("decode index:", currentIndex, type, "source-key:", sourceKey)
576576
throw Error.adaptorCannotDecodeRelationships
577577
}

ZeeQL3.xcodeproj/project.pbxproj

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -1084,8 +1084,9 @@
10841084
E8D2794B1E5504FA00453BBE /* Project object */ = {
10851085
isa = PBXProject;
10861086
attributes = {
1087+
BuildIndependentTargetsInParallel = YES;
10871088
LastSwiftUpdateCheck = 1100;
1088-
LastUpgradeCheck = 1330;
1089+
LastUpgradeCheck = 1600;
10891090
ORGANIZATIONNAME = "ZeeZide GmbH";
10901091
TargetAttributes = {
10911092
E8263C541E93B1E100508276 = {
@@ -1630,7 +1631,11 @@
16301631
GCC_WARN_UNUSED_FUNCTION = YES;
16311632
GCC_WARN_UNUSED_VARIABLE = YES;
16321633
INFOPLIST_FILE = Tests/ZeeQLTests/Info.plist;
1633-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
1634+
LD_RUNPATH_SEARCH_PATHS = (
1635+
"$(inherited)",
1636+
"@executable_path/../Frameworks",
1637+
"@loader_path/../Frameworks",
1638+
);
16341639
PRODUCT_BUNDLE_IDENTIFIER = de.zeezide.ZeeQL.SQLite3Tests;
16351640
PRODUCT_NAME = "$(TARGET_NAME)";
16361641
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
@@ -1666,7 +1671,11 @@
16661671
GCC_WARN_UNUSED_FUNCTION = YES;
16671672
GCC_WARN_UNUSED_VARIABLE = YES;
16681673
INFOPLIST_FILE = Tests/ZeeQLTests/Info.plist;
1669-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
1674+
LD_RUNPATH_SEARCH_PATHS = (
1675+
"$(inherited)",
1676+
"@executable_path/../Frameworks",
1677+
"@loader_path/../Frameworks",
1678+
);
16701679
PRODUCT_BUNDLE_IDENTIFIER = de.zeezide.ZeeQL.SQLite3Tests;
16711680
PRODUCT_NAME = "$(TARGET_NAME)";
16721681
};
@@ -1684,7 +1693,12 @@
16841693
DYLIB_INSTALL_NAME_BASE = "@rpath";
16851694
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
16861695
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
1687-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1696+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
1697+
LD_RUNPATH_SEARCH_PATHS = (
1698+
"$(inherited)",
1699+
"@executable_path/Frameworks",
1700+
"@loader_path/Frameworks",
1701+
);
16881702
SDKROOT = iphoneos;
16891703
SKIP_INSTALL = YES;
16901704
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
@@ -1706,7 +1720,12 @@
17061720
DYLIB_INSTALL_NAME_BASE = "@rpath";
17071721
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
17081722
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
1709-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1723+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
1724+
LD_RUNPATH_SEARCH_PATHS = (
1725+
"$(inherited)",
1726+
"@executable_path/Frameworks",
1727+
"@loader_path/Frameworks",
1728+
);
17101729
SDKROOT = iphoneos;
17111730
SKIP_INSTALL = YES;
17121731
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1719,7 +1738,6 @@
17191738
E8263C811E93C7DF00508276 /* Debug */ = {
17201739
isa = XCBuildConfiguration;
17211740
buildSettings = {
1722-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
17231741
ALWAYS_SEARCH_USER_PATHS = NO;
17241742
CLANG_ANALYZER_NONNULL = YES;
17251743
CLANG_ENABLE_MODULES = YES;
@@ -1748,7 +1766,12 @@
17481766
GCC_WARN_UNUSED_VARIABLE = YES;
17491767
INFOPLIST_FILE = Tests/ZeeQLTests/Info.plist;
17501768
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
1751-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1769+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
1770+
LD_RUNPATH_SEARCH_PATHS = (
1771+
"$(inherited)",
1772+
"@executable_path/Frameworks",
1773+
"@loader_path/Frameworks",
1774+
);
17521775
OTHER_SWIFT_FLAGS = "-DZEE_BUNDLE_RESOURCES";
17531776
PRODUCT_BUNDLE_IDENTIFIER = de.zeezide.ZeeQL.MobileZeeQLTests;
17541777
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1761,7 +1784,6 @@
17611784
E8263C821E93C7DF00508276 /* Release */ = {
17621785
isa = XCBuildConfiguration;
17631786
buildSettings = {
1764-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
17651787
ALWAYS_SEARCH_USER_PATHS = NO;
17661788
CLANG_ANALYZER_NONNULL = YES;
17671789
CLANG_ENABLE_MODULES = YES;
@@ -1790,7 +1812,11 @@
17901812
GCC_WARN_UNUSED_VARIABLE = YES;
17911813
INFOPLIST_FILE = Tests/ZeeQLTests/Info.plist;
17921814
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
1793-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1815+
LD_RUNPATH_SEARCH_PATHS = (
1816+
"$(inherited)",
1817+
"@executable_path/Frameworks",
1818+
"@loader_path/Frameworks",
1819+
);
17941820
OTHER_SWIFT_FLAGS = "-DZEE_BUNDLE_RESOURCES";
17951821
PRODUCT_BUNDLE_IDENTIFIER = de.zeezide.ZeeQL.MobileZeeQLTests;
17961822
PRODUCT_NAME = "$(TARGET_NAME)";

ZeeQL3.xcodeproj/xcshareddata/xcschemes/MobileZeeQL.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1330"
3+
LastUpgradeVersion = "1600"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

ZeeQL3.xcodeproj/xcshareddata/xcschemes/WatchZeeQL.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1330"
3+
LastUpgradeVersion = "1600"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

ZeeQL3.xcodeproj/xcshareddata/xcschemes/ZeeQL.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1330"
3+
LastUpgradeVersion = "1600"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)