Skip to content

Commit

Permalink
Release Candidate 1 (#76)
Browse files Browse the repository at this point in the history
* rc.1

* readme + ci updates

* rm sqlite-kit test
  • Loading branch information
tanner0101 authored Feb 28, 2020
1 parent 323f778 commit 7251abf
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 23 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,31 @@ name: test
on:
- pull_request
jobs:
bionic:
sqlite-kit_bionic:
container:
image: vapor/swift:5.1-bionic
image: vapor/swift:5.2-bionic
runs-on: ubuntu-latest
steps:
- run: apt update -y; apt install -y libsqlite3-dev
- uses: actions/checkout@v1
- run: swift test --enable-test-discovery --sanitize=thread
xenial:
sqlite-kit_xenial:
container:
image: vapor/swift:5.1-xenial
image: vapor/swift:5.2-xenial
runs-on: ubuntu-latest
steps:
- run: apt update -y; apt install -y libsqlite3-dev
- uses: actions/checkout@v1
- run: swift test --enable-test-discovery --sanitize=thread
fluent-sqlite-driver:
container:
image: vapor/swift:5.2
runs-on: ubuntu-latest
steps:
- run: apt update -y; apt install -y libsqlite3-dev
- run: git clone -b master https://github.com/vapor/fluent-sqlite-driver.git
working-directory: ./
- run: swift package edit sqlite-kit --revision ${{ github.sha }}
working-directory: ./fluent-sqlite-driver
- run: swift test --enable-test-discovery --sanitize=thread
working-directory: ./fluent-sqlite-driver
21 changes: 12 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
// swift-tools-version:5.1
// swift-tools-version:5.2
import PackageDescription

let package = Package(
name: "sqlite-kit",
platforms: [
.macOS(.v10_14)
.macOS(.v10_15)
],
products: [
.library(name: "SQLiteKit", targets: ["SQLiteKit"]),
],
dependencies: [
.package(url: "https://github.com/vapor/sqlite-nio.git", from: "1.0.0-beta.2"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0-beta.2"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.0.0-beta.2"),
.package(url: "https://github.com/vapor/sqlite-nio.git", from: "1.0.0-rc."),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0-rc.1"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.0.0-rc.1"),
],
targets: [
.target(name: "SQLiteKit", dependencies: [
"AsyncKit",
"SQLiteNIO",
"SQLKit"
.product(name: "AsyncKit", package: "async-kit"),
.product(name: "SQLiteNIO", package: "sqlite-nio"),
.product(name: "SQLKit", package: "sql-kit"),
]),
.testTarget(name: "SQLiteKitTests", dependencies: [
.product(name: "SQLKitBenchmark", package: "sql-kit"),
.target(name: "SQLiteKit"),
]),
.testTarget(name: "SQLiteKitTests", dependencies: ["SQLKitBenchmark", "SQLiteKit"]),
]
)
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/1342803/58998319-27aa5d80-87ce-11e9-94e6-c142c86ab28d.png" alt="SQLiteKit">
<img
src="https://user-images.githubusercontent.com/1342803/58998319-27aa5d80-87ce-11e9-94e6-c142c86ab28d.png"
height="64"
alt="SQLiteKit"
>
<br>
<br>
<a href="https://api.vapor.codes/sqlite-kit/master/SQLiteKit/index.html">
<img src="http://img.shields.io/badge/api-docs-2196f3.svg" alt="Documentation">
<a href="https://docs.vapor.codes/4.0/">
<img src="http://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation">
</a>
<a href="https://discord.gg/vapor">
<img src="https://img.shields.io/discord/431917998102675485.svg" alt="Team Chat">
</a>
<a href="LICENSE">
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License">
</a>
<a href="https://circleci.com/gh/vapor/sqlite-kit">
<img src="https://circleci.com/gh/vapor/sqlite-kit.svg?style=shield" alt="Continuous Integration">
<a href="https://github.com/vapor/sqlite-kit/actions">
<img src="https://github.com/vapor/sqlite-kit/workflows/test/badge.svg" alt="Continuous Integration">
</a>
<a href="https://swift.org">
<img src="http://img.shields.io/badge/swift-5-brightgreen.svg" alt="Swift 5">
<img src="http://img.shields.io/badge/swift-5.2-brightgreen.svg" alt="Swift 5.2">
</a>
</p>
11 changes: 7 additions & 4 deletions Sources/SQLiteKit/SQLiteDataDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ public struct SQLiteDataDecoder {
public func decode<T>(_ type: T.Type, from data: SQLiteData) throws -> T
where T: Decodable
{
if
let type = type as? SQLiteDataConvertible.Type,
let value = type.init(sqliteData: data)
{
if let type = type as? SQLiteDataConvertible.Type {
guard let value = type.init(sqliteData: data) else {
throw DecodingError.typeMismatch(T.self, .init(
codingPath: [],
debugDescription: "Could not initialize \(T.self) from \(data)."
))
}
return value as! T
} else {
return try T.init(from: _Decoder(data: data))
Expand Down
8 changes: 8 additions & 0 deletions Sources/SQLiteKit/SQLiteDialect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ public struct SQLiteDialect: SQLDialect {
public var supportsAutoIncrement: Bool {
false
}

public var alterTableSyntax: SQLAlterTableSyntax {
.init(
alterColumnDefinitionClause: nil,
alterColumnDefinitionTypeKeyword: nil,
allowsBatch: false
)
}

public init() { }
}

0 comments on commit 7251abf

Please sign in to comment.