mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
Merge pull request #1850 from swift-everywhere/platform-fixes
Android and Windows platform import/conditional accommodation
This commit is contained in:
6 files changed
+8
-11
No files matched your search
@@ -14,6 +14,8 @@ import GRDBSQLite
|
||||
import string_h
|
||||
#elseif os(Linux)
|
||||
import Glibc
|
||||
#elseif os(Android)
|
||||
import Android
|
||||
#elseif os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
|
||||
import Darwin
|
||||
#elseif os(Windows)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#if !os(Windows)
|
||||
import Foundation
|
||||
|
||||
private let integerRoundingBehavior = NSDecimalNumberHandler(
|
||||
@@ -104,4 +103,3 @@ extension NSNumber: DatabaseValueConvertible {
|
||||
}
|
||||
|
||||
private let posixLocale = Locale(identifier: "en_US_POSIX")
|
||||
#endif
|
||||
@@ -1,6 +1,5 @@
|
||||
import Foundation
|
||||
|
||||
#if !os(Windows)
|
||||
/// NSURL stores its absoluteString in the database.
|
||||
extension NSURL: DatabaseValueConvertible {
|
||||
|
||||
@@ -20,7 +19,6 @@ extension NSURL: DatabaseValueConvertible {
|
||||
return cast(URL(string: string))
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// URL stores its absoluteString in the database.
|
||||
extension URL: DatabaseValueConvertible { }
|
||||
@@ -12,7 +12,6 @@ import GRDBSQLite
|
||||
|
||||
import Foundation
|
||||
|
||||
#if !os(Windows)
|
||||
/// NSUUID adopts DatabaseValueConvertible
|
||||
extension NSUUID: DatabaseValueConvertible {
|
||||
/// Returns a BLOB database value containing the uuid bytes.
|
||||
@@ -52,7 +51,6 @@ extension NSUUID: DatabaseValueConvertible {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// UUID adopts DatabaseValueConvertible
|
||||
extension UUID: DatabaseValueConvertible {
|
||||
|
||||
@@ -148,7 +148,7 @@ class AssociationTableAliasTestsSQLTests : GRDBTestCase {
|
||||
"""
|
||||
|
||||
do {
|
||||
let request = A
|
||||
let request: QueryInterfaceRequest<A> = A
|
||||
.aliased(alias)
|
||||
.select(\.name)
|
||||
.filter(key: 1)
|
||||
@@ -159,7 +159,7 @@ class AssociationTableAliasTestsSQLTests : GRDBTestCase {
|
||||
try assertEqualSQL(db, request, expectedSQL)
|
||||
}
|
||||
do {
|
||||
let request = A
|
||||
let request: QueryInterfaceRequest<A> = A
|
||||
.select(\.name)
|
||||
.filter(key: 1)
|
||||
.filter { $0.name != nil && alias.name == "foo" }
|
||||
@@ -183,7 +183,7 @@ class AssociationTableAliasTestsSQLTests : GRDBTestCase {
|
||||
"""
|
||||
|
||||
do {
|
||||
let request = A
|
||||
let request: QueryInterfaceRequest<A> = A
|
||||
.aliased(alias)
|
||||
.select(\.name)
|
||||
.filter(key: 1)
|
||||
@@ -194,7 +194,7 @@ class AssociationTableAliasTestsSQLTests : GRDBTestCase {
|
||||
try assertEqualSQL(db, request, expectedSQL)
|
||||
}
|
||||
do {
|
||||
let request = A
|
||||
let request: QueryInterfaceRequest<A> = A
|
||||
.select(\.name)
|
||||
.filter(key: 1)
|
||||
.filter { $0.name != nil && alias.name == "foo" }
|
||||
|
||||
@@ -758,7 +758,8 @@ let testBundle = Bundle(for: GRDBTestCase.self)
|
||||
}
|
||||
let dbQueue = try makeDatabaseQueue(configuration: config)
|
||||
try dbQueue.inDatabase { db in
|
||||
XCTAssertEqual("commoncrypto", try db.cipherProvider)
|
||||
let provider = try db.cipherProvider
|
||||
XCTAssertTrue(["commoncrypto", "libtomcrypt"].contains(provider), "unrecognized cipherProvider: \(provider ?? "")")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user