Skip to content

Commit

Permalink
enum (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 authored Jan 22, 2020
1 parent 9f3a7fb commit 01e9cd2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Sources/SQLiteKit/SQLiteDialect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ public struct SQLiteDialect: SQLDialect {
public var literalDefault: SQLExpression {
return SQLLiteral.null
}

public var enumSyntax: SQLEnumSyntax {
.unsupported
}

public var supportsAutoIncrement: Bool {
false
}

public init() { }
}
20 changes: 19 additions & 1 deletion Tests/SQLiteKitTests/SQLKitTests.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import Logging
import SQLiteKit
import SQLKitBenchmark
import XCTest

class SQLiteTests: XCTestCase {
func testBenchmark() throws {
func testEnum() throws {
try self.benchmark.testEnum()
}

func testPlanets() throws {
try self.db.drop(table: "planets")
.ifExists()
.run().wait()
Expand Down Expand Up @@ -83,12 +88,16 @@ class SQLiteTests: XCTestCase {
var db: SQLDatabase {
self.connection.sql()
}
var benchmark: SQLBenchmarker {
.init(on: self.db)
}

var eventLoopGroup: EventLoopGroup!
var threadPool: NIOThreadPool!
var connection: SQLiteConnection!

override func setUp() {
XCTAssertTrue(isLoggingConfigured)
self.eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 2)
self.threadPool = NIOThreadPool(numberOfThreads: 2)
self.threadPool.start()
Expand All @@ -108,3 +117,12 @@ class SQLiteTests: XCTestCase {
self.eventLoopGroup = nil
}
}

let isLoggingConfigured: Bool = {
LoggingSystem.bootstrap { label in
var handler = StreamLogHandler.standardOutput(label: label)
handler.logLevel = .trace
return handler
}
return true
}()

0 comments on commit 01e9cd2

Please sign in to comment.