Skip to content

Commit

Permalink
alpha (#59)
Browse files Browse the repository at this point in the history
* update circle + add swiftpm ignore

* remove collate + rename to execute(sql:)

* update readme

* bump
  • Loading branch information
tanner0101 authored Jun 4, 2019
1 parent 003d250 commit c33b5f0
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/*.xcodeproj
Package.resolved
DerivedData
.swiftpm

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Qutheory, LLC
Copyright (c) 2019 Qutheory, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/1342803/39145428-9f6e8328-4701-11e8-9955-663bbbe3e9b4.png" height="64" alt="SQL">
<img src="https://user-images.githubusercontent.com/1342803/58835528-3523e400-8624-11e9-8128-4925c7c9cf08.png" alt="SQLKit">
<br>
<br>
<a href="http://docs.vapor.codes/3.0/sql/getting-started/">
<img src="http://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation">
<a href="https://api.vapor.codes/sql/master/SQLKit/index.html">
<img src="http://img.shields.io/badge/api-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/sql">
<img src="https://circleci.com/gh/vapor/sql.svg?style=shield" alt="Continuous Integration">
<a href="https://circleci.com/gh/vapor/sql-kit">
<img src="https://circleci.com/gh/vapor/sql-kit.svg?style=shield" alt="Continuous Integration">
</a>
<a href="https://swift.org">
<img src="http://img.shields.io/badge/swift-5-brightgreen.svg" alt="Swift 5">
Expand Down
7 changes: 0 additions & 7 deletions Sources/SQLKit/Builders/SQLAlterTableBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/// Builds `ALTER TABLE` queries.
///
/// conn.alter(table: Planet.self)
/// .column(for: \.name)
/// .run()
///
/// See `SQLColumnBuilder` for more information.
public final class SQLAlterTableBuilder: SQLQueryBuilder, SQLColumnBuilder {
/// `SQLAlterTable` query being built.
public var alterTable: SQLAlterTable
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLKit/Builders/SQLQueryBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ extension SQLQueryBuilder {
///
/// - returns: A future signaling completion.
public func run() -> EventLoopFuture<Void> {
return self.database.sqlQuery(self.query) { _ in }
return self.database.execute(sql: self.query) { _ in }
}
}
2 changes: 1 addition & 1 deletion Sources/SQLKit/Builders/SQLQueryFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension SQLQueryFetcher {
///
/// The returned future will signal completion of the query.
public func run(_ handler: @escaping (SQLRow) throws -> ()) -> EventLoopFuture<Void> {
return self.database.sqlQuery(self.query) { row in
return self.database.execute(sql: self.query) { row in
try handler(row)
}
}
Expand Down
2 changes: 0 additions & 2 deletions Sources/SQLKit/Query/SQLCollation.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Sources/SQLKit/Query/SQLConstraintAlgorithm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public enum SQLConstraintAlgorithm: SQLExpression {
/// `COLLATE` constraint.
case check(SQLExpression)

case collate(SQLCollation)
case collate(SQLExpression)

/// `DEFAULT` constraint.
case `default`(SQLExpression)

/// `FOREIGN KEY` constraint.
case foreignKey(SQLForeignKey)
case foreignKey(SQLExpression)

public func serialize(to serializer: inout SQLSerializer) {
switch self {
Expand Down
4 changes: 2 additions & 2 deletions Sources/SQLKit/SQLDatabase.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public protocol SQLDatabase {
func sqlQuery(
_ query: SQLExpression,
func execute(
sql query: SQLExpression,
_ onRow: @escaping (SQLRow) throws -> ()
) -> EventLoopFuture<Void>
}
2 changes: 1 addition & 1 deletion Tests/SQLKitTests/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class TestDatabase: SQLDatabase {
self.results = []
}

func sqlQuery(_ query: SQLExpression, _ onRow: @escaping (SQLRow) throws -> ()) -> EventLoopFuture<Void> {
func execute(sql query: SQLExpression, _ onRow: @escaping (SQLRow) throws -> ()) -> EventLoopFuture<Void> {
var serializer = SQLSerializer(dialect: GenericDialect())
query.serialize(to: &serializer)
results.append(serializer.sql)
Expand Down
43 changes: 37 additions & 6 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,53 @@
version: 2

jobs:
linux:
macos:
macos:
xcode: "10.2.0"
steps:
- checkout
- run: swift build
- run: swift test
macos-release:
macos:
xcode: "10.2.0"
steps:
- checkout
- run: swift build -c release
bionic:
docker:
- image: vapor/swift:5.0
- image: swift:5.0-bionic
steps:
- checkout
- run: swift build
- run: swift test
linux-release:
bionic-release:
docker:
- image: vapor/swift:5.0
- image: swift:5.0-bionic
steps:
- checkout
- run: swift build -c release
xenial:
docker:
- image: swift:5.0-xenial
steps:
- checkout
- run: swift build
- run: swift test
xenial-release:
docker:
- image: swift:5.0-xenial
steps:
- checkout
- run: swift build -c release

workflows:
version: 2
tests:
jobs:
- linux
- linux-release
- macos
- macos-release
- bionic
- bionic-release
- xenial
- xenial-release

0 comments on commit c33b5f0

Please sign in to comment.