Skip to content

Commit

Permalink
Remove jsonErrorPosition unless GRDBCUSTOMSQLITE || GRDBCIPHER
Browse files Browse the repository at this point in the history
For some reason, if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) has stopped being able to skip the test (WTF?)
  • Loading branch information
groue committed Mar 19, 2024
1 parent 4e0ab25 commit 5413dcf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
1 change: 0 additions & 1 deletion GRDB/Documentation.docc/JSON.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,4 @@ The `->` and `->>` SQL operators are available on the ``SQLJSONExpressible`` pro
### Validate JSON values at the SQL level
- ``Database/jsonErrorPosition(_:)``
- ``Database/jsonIsValid(_:)``
15 changes: 0 additions & 15 deletions GRDB/JSON/SQLJSONFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -521,21 +521,6 @@ extension Database {
.function("JSON_ARRAY_LENGTH", [value.sqlExpression, path.sqlExpression])
}

/// The `JSON_ERROR_POSITION` SQL function.
///
/// For example:
///
/// ```swift
/// // JSON_ERROR_POSITION(info)
/// Database.jsonErrorPosition(Column("info"))
/// ```
///
/// Related SQLite documentation: <https://www.sqlite.org/json1.html#jerr>
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
public static func jsonErrorPosition(_ value: some SQLExpressible) -> SQLExpression {
.function("JSON_ERROR_POSITION", [value.sqlExpression])
}

/// The `JSON_EXTRACT` SQL function.
///
/// For example:
Expand Down
8 changes: 3 additions & 5 deletions Tests/GRDBTests/JSONExpressionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,6 @@ final class JSONExpressionsTests: GRDBTestCase {
guard sqlite3_libversion_number() >= 3042000 else {
throw XCTSkip("JSON_ERROR_JSON is not available")
}
#else
guard #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) else {
throw XCTSkip("JSON_ERROR_JSON is not available")
}
#endif

try makeDatabaseQueue().inDatabase { db in
try db.create(table: "player") { t in
Expand All @@ -385,6 +380,9 @@ final class JSONExpressionsTests: GRDBTestCase {
SELECT JSON_ERROR_POSITION("info") FROM "player"
""")
}
#else
throw XCTSkip("JSON_ERROR_JSON is not available")
#endif
}

func test_Database_jsonExtract_atPath() throws {
Expand Down

0 comments on commit 5413dcf

Please sign in to comment.