Skip to content

Commit

Permalink
Merge origin/3 into 3
Browse files Browse the repository at this point in the history
  • Loading branch information
calebkleveter committed May 1, 2019
2 parents 2dc9267 + 3d0381b commit 03f9797
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Tests/MySQLTests/MySQLTests.swift
Expand Up @@ -196,10 +196,22 @@ class MySQLTests: XCTestCase {
let client = try MySQLConnection.makeTest()
defer { client.close(done: nil) }

if
let version: MySQLData = try client.simpleQuery("SELECT @@version").wait()[0]["@@version"],
let numbers: [String] = version.string()?.split(separator: ".").map(String.init),
let major: Int = Int(numbers[0]),
let minor: Int = Int(numbers[1]),
major <= 5, minor <= 6
{
print("Exiting .testSaveJSON test case. JSON is not supported in the current version of MySQL")
return
}


try client.drop(table: Nested.self).ifExists().run().wait()
try client.create(table: Nested.self)
.column(for: \Nested.id, .notNull, .primaryKey, .unique())
.column(for: \Nested.data, .notNull)
.column(for: \Nested.id, type: .bigint, .notNull, .primaryKey, .unique())
.column(for: \Nested.data, type: .json, .notNull)
.run().wait()

try client.insert(into: Nested.self).value(Nested(id: 1, data: ["description": "JSON data"])).run().wait()
Expand Down

0 comments on commit 03f9797

Please sign in to comment.