diff --git a/.jazzy.yaml b/.jazzy.yaml
index b1006684..c681bdaf 100644
--- a/.jazzy.yaml
+++ b/.jazzy.yaml
@@ -1,6 +1,6 @@
module: SwiftKuery
-author: IBM
-github_url: https://github.com/IBM-Swift/Swift-Kuery/
+author: IBM & Kitura project authors
+github_url: https://github.com/Kitura/Swift-Kuery/
theme: fullwidth
clean: true
@@ -10,5 +10,3 @@ readme: README.md
skip_undocumented: false
hide_documentation_coverage: false
-
-xcodebuild_arguments: [-project, SwiftKuery.xcodeproj, -target, SwiftKuery, LIBRARY_SEARCH_PATHS=.build/debug]
diff --git a/.travis.yml b/.travis.yml
index 8b444b3c..987a274b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,58 +16,31 @@ matrix:
dist: xenial
sudo: required
services: docker
- env: DOCKER_IMAGE=swift:4.0.3 SWIFT_SNAPSHOT=4.0.3
+ env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu16.04:5.1.5
- os: linux
- dist: xenial
- sudo: required
- services: docker
- env: DOCKER_IMAGE=swift:4.1.3 SWIFT_SNAPSHOT=4.1.3
- - os: linux
- dist: xenial
- sudo: required
- services: docker
- env: DOCKER_IMAGE=swift:4.2.4 SWIFT_SNAPSHOT=4.2.4
- - os: linux
- dist: xenial
- sudo: required
- services: docker
- env: DOCKER_IMAGE=swift:5.0.3-xenial SWIFT_SNAPSHOT=5.0.3
- - os: linux
- dist: xenial
+ dist: bionic
sudo: required
services: docker
- env: DOCKER_IMAGE=swift:5.1
+ env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:5.4
- os: linux
dist: xenial
sudo: required
services: docker
- env: DOCKER_IMAGE=swift:5.1 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
- - os: osx
- osx_image: xcode9.2
- sudo: required
- env: SWIFT_SNAPSHOT=4.0.3
- - os: osx
- osx_image: xcode9.4
- sudo: required
- env: SWIFT_SNAPSHOT=4.1.2
+ env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:latest USE_SWIFT_DEVELOPMENT_SNAPSHOT=1
- os: osx
- osx_image: xcode10.1
+ osx_image: xcode11
sudo: required
- env: SWIFT_SNAPSHOT=4.2.1
+ env: SWIFT_SNAPSHOT=5.1.5 JAZZY_ELIGIBLE=true
- os: osx
- osx_image: xcode10.2
+ osx_image: xcode12.2
sudo: required
- env: SWIFT_SNAPSHOT=5.0.1 JAZZY_ELIGIBLE=true
- os: osx
- osx_image: xcode11
- sudo: required
- - os: osx
- osx_image: xcode11
+ osx_image: xcode12.5
sudo: required
- env: SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
+ env: USE_SWIFT_DEVELOPMENT_SNAPSHOT=1
before_install:
- - git clone https://github.com/IBM-Swift/Package-Builder.git
+ - git clone https://github.com/Kitura/Package-Builder.git
script:
- ./Package-Builder/build-package.sh -projectDir $TRAVIS_BUILD_DIR
diff --git a/Package.swift b/Package.swift
index e7961e63..18014a76 100644
--- a/Package.swift
+++ b/Package.swift
@@ -2,7 +2,7 @@
// The swift-tools-version declares the minimum version of Swift required to build this package.
/**
- * Copyright IBM Corporation 2016-2019
+ * Copyright IBM Corporation and the Kitura project authors 2016-2020
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
- .package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "1.7.0"),
+ .package(url: "https://github.com/Kitura/LoggerAPI.git", from: "1.9.200"),
],
targets: [
// Targets are the basic building blocks of a package. A target defines a module or a test suite.
diff --git a/Package@swift-4.swift b/Package@swift-4.swift
deleted file mode 100644
index 5df947bd..00000000
--- a/Package@swift-4.swift
+++ /dev/null
@@ -1,45 +0,0 @@
-// swift-tools-version:4.0
-// The swift-tools-version declares the minimum version of Swift required to build this package.
-
-/**
- * Copyright IBM Corporation 2016-2019
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-
-import PackageDescription
-
-let package = Package(
- name: "SwiftKuery",
- products: [
- // Products define the executables and libraries produced by a package, and make them visible to other packages.
- .library(
- name: "SwiftKuery",
- targets: ["SwiftKuery"]),
- ],
- dependencies: [
- // Dependencies declare other packages that this package depends on.
- // .package(url: /* package url */, from: "1.0.0"),
- .package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "1.7.0"),
- ],
- targets: [
- // Targets are the basic building blocks of a package. A target defines a module or a test suite.
- // Targets can depend on other targets in this package, and on products in packages which this package depends on.
- .target(
- name: "SwiftKuery",
- dependencies: ["LoggerAPI"]),
- .testTarget(
- name: "SwiftKueryTests",
- dependencies: ["SwiftKuery"]),
- ]
-)
diff --git a/README.md b/README.md
index 4e3f9d9c..1e3b13ca 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,16 @@
-
+
-
+
-
-
+
+
@@ -24,7 +24,7 @@
`Swift-Kuery` is a pluggable SQL database driver/SDK abstraction layer. Its main idea is to unify the APIs to the various relational databases, providing a Swifty yet SQL-like API. This allows easy switching between databases and forms the basis for an Object-Relational Mapping (ORM) framework.
-[Swift-Kuery-ORM](https://github.com/IBM-Swift/Swift-Kuery-ORM) is an ORM, built on top of Swift-Kuery, which allows you to simplify the persistence of model objects with your server.
+[Swift-Kuery-ORM](https://github.com/Kitura/Swift-Kuery-ORM) is an ORM, built on top of Swift-Kuery, which allows you to simplify the persistence of model objects with your server.
`Swift-Kuery` is an easy to learn, consumable framework that comes with a set of [implemented plugins](#list-of-plugins).
@@ -44,7 +44,7 @@
The latest version of Swift-Kuery requires **Swift 4.0** or newer. You can download this version of the Swift binaries by following this [link](https://swift.org/download/). Compatibility with other Swift versions is not guaranteed.
## Usage
-This example demonstrates how to execute an SQL query using `Swift-Kuery` with the [Swift-Kuery-PostgreSQL](https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL) plugin.
+This example demonstrates how to execute an SQL query using `Swift-Kuery` with the [Swift-Kuery-PostgreSQL](https://github.com/Kitura/Swift-Kuery-PostgreSQL) plugin.
The starting point for this example is an existing Swift package. If you don't have one already, create and enter a directory named e.g. `SwiftKueryExample`. Now run the swift package's init command, to create an executable type, by running `swift package init --type executable`.
@@ -72,14 +72,14 @@ The starting point for this example is an existing Swift package. If you don't h
```
### Update your Package.swift file
-Add Swift-Kuery and your Kuery plugin, in this case Swift-Kuery-PostgreSQL, to the dependencies within your application's `Package.swift` file. Substitute `"x.x.x"` with the latest `Swift-Kuery` [release](https://github.com/IBM-Swift/Swift-Kuery/releases) and `"y.y.y"` with the latest plugin [release](https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL/releases).
+Add Swift-Kuery and your Kuery plugin, in this case Swift-Kuery-PostgreSQL, to the dependencies within your application's `Package.swift` file. Substitute `"x.x.x"` with the latest `Swift-Kuery` [release](https://github.com/Kitura/Swift-Kuery/releases) and `"y.y.y"` with the latest plugin [release](https://github.com/Kitura/Swift-Kuery-PostgreSQL/releases).
```swift
dependencies: [
...
// Add this line
- .package(url: "https://github.com/IBM-Swift/Swift-Kuery.git", from: "x.x.x"),
- .package(url: "https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL.git", from: "y.y.y"),
+ .package(url: "https://github.com/Kitura/Swift-Kuery.git", from: "x.x.x"),
+ .package(url: "https://github.com/Kitura/Swift-Kuery-PostgreSQL.git", from: "y.y.y"),
],
targets: [
.target(
@@ -619,18 +619,18 @@ let query = Select(t2.c, from: t2)
## List of plugins
-* [PostgreSQL](https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL)
+* [PostgreSQL](https://github.com/Kitura/Swift-Kuery-PostgreSQL)
-* [SQLite](https://github.com/IBM-Swift/Swift-Kuery-SQLite)
+* [SQLite](https://github.com/Kitura/Swift-Kuery-SQLite)
-* [MySQL](https://github.com/IBM-Swift/SwiftKueryMySQL)
+* [MySQL](https://github.com/Kitura/SwiftKueryMySQL)
## API Documentation
-For more information visit our [API reference](https://ibm-swift.github.io/Swift-Kuery/index.html).
+For more information visit our [API reference](https://kitura.github.io/Swift-Kuery/index.html).
## Community
We love to talk server-side Swift, and Kitura. Join our [Slack](http://swift-at-ibm-slack.mybluemix.net/) to meet the team!
## License
-This library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/IBM-Swift/Swift-Kuery/blob/master/LICENSE.txt).
+This library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/Kitura/Swift-Kuery/blob/master/LICENSE.txt).
diff --git a/Sources/SwiftKuery/Utils.swift b/Sources/SwiftKuery/Utils.swift
index 839a3213..e4fcf492 100644
--- a/Sources/SwiftKuery/Utils.swift
+++ b/Sources/SwiftKuery/Utils.swift
@@ -1,12 +1,12 @@
/**
Copyright IBM Corporation 2016, 2017
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,7 @@
import Foundation
struct Utils {
-
+
static func packType(_ item: Any) -> String {
switch item {
case let val as String:
@@ -28,7 +28,7 @@ struct Utils {
return String(describing: item)
}
}
-
+
static func packType(_ item: Any, queryBuilder: QueryBuilder) throws -> String {
switch item {
case let val as String:
@@ -48,7 +48,7 @@ struct Utils {
return val == "nil" ? "NULL" : val
}
}
-
+
static func packName(_ name: String, queryBuilder: QueryBuilder) -> String {
var result = name
let identifierQuoteCharacter = queryBuilder.substitutions[QueryBuilder.QuerySubstitutionNames.identifierQuoteCharacter.rawValue]
@@ -57,7 +57,7 @@ struct Utils {
}
return result
}
-
+
static func updateParameterNumbers(query: String, queryBuilder: QueryBuilder) -> String {
let marker = queryBuilder.substitutions[QueryBuilder.QuerySubstitutionNames.numberedParameter.rawValue]
if !queryBuilder.addNumbersToParameters {
@@ -68,7 +68,8 @@ struct Utils {
var range = inputQuery.range(of: Parameter.numberedParameterMarker)
var index = 1
while let _range = range {
- resultQuery += inputQuery[..<_range.lowerBound] + marker + "\(index)"
+ resultQuery += inputQuery[..<_range.lowerBound] + marker
+ resultQuery += "\(index)"
inputQuery = String(inputQuery[_range.upperBound...])
index += 1
@@ -78,7 +79,7 @@ struct Utils {
resultQuery += inputQuery
return resultQuery
}
-
+
static func convertNamedParametersToNumbered(query: String, queryBuilder: QueryBuilder) -> (String, [String:[Int]], Int) {
var resultQuery = ""
var nameToNumber = [String:[Int]]()
diff --git a/docs/Classes.html b/docs/Classes.html
index b7d1fbec..9902a4b8 100644
--- a/docs/Classes.html
+++ b/docs/Classes.html
@@ -14,6 +14,7 @@
+
@@ -32,7 +33,7 @@
@@ -405,7 +406,7 @@
-
+
Classes
The following classes are available globally.
@@ -418,9 +419,11 @@
Classes
-
@@ -441,7 +444,7 @@
Usage Example:
In this example, an AuxiliaryTable
class is defined containing two columns.
A ToDoTable
(as defined in Table
), a PersonTable
(as defined in Column
) and a connection instance are initialized.
-An instance of the AuxiliaryTable
is then initialised from Column
instances in todotable
.
+An instance of the AuxiliaryTable
is then initialised from Column
instances in “todotable”.
This AuxiliaryTable
is then used to create an SQL WITH query.
A description of the created query is then printed.
class AuxTable: AuxiliaryTable {
@@ -467,7 +470,7 @@ Usage Example:
Declaration
Swift
-
open class AuxiliaryTable: Table
+
open class AuxiliaryTable : Table
@@ -480,9 +483,11 @@
Declaration
-
@@ -518,7 +523,7 @@
Usage Example:
Declaration
@@ -531,9 +536,11 @@ Declaration
-
@@ -587,9 +594,11 @@
Declaration
-
@@ -625,7 +634,7 @@
Usage Example:
Declaration
Swift
-
public class ConnectionPoolConnection: Connection
+
public class ConnectionPoolConnection : Connection
@@ -666,9 +675,11 @@ Declaration
-
@@ -738,9 +749,11 @@
Declaration
-
@@ -797,9 +810,11 @@
Declaration
-
@@ -836,9 +851,11 @@
Declaration
-
@@ -877,7 +894,7 @@
Usage Example:
Declaration
@@ -892,8 +909,8 @@ Declaration
diff --git a/docs/Classes/AuxiliaryTable.html b/docs/Classes/AuxiliaryTable.html
index 7a33d049..eb6964f2 100644
--- a/docs/Classes/AuxiliaryTable.html
+++ b/docs/Classes/AuxiliaryTable.html
@@ -33,7 +33,7 @@
@@ -406,11 +406,12 @@
-
+
AuxiliaryTable
-
open class AuxiliaryTable: Table
+
+
open class AuxiliaryTable : Table
@@ -419,7 +420,7 @@
Usage Example:
In this example, an AuxiliaryTable
class is defined containing two columns.
A ToDoTable
(as defined in Table
), a PersonTable
(as defined in Column
) and a connection instance are initialized.
-An instance of the AuxiliaryTable
is then initialised from Column
instances in todotable
.
+An instance of the AuxiliaryTable
is then initialised from Column
instances in “todotable”.
This AuxiliaryTable
is then used to create an SQL WITH query.
A description of the created query is then printed.
class AuxTable: AuxiliaryTable {
@@ -448,17 +449,19 @@ Usage Example:
-
@@ -471,7 +474,7 @@
Usage Example:
In this example, an AuxiliaryTable
class is defined containing two columns.
A ToDoTable
(as defined in Table
) instance, and a connection instance are initialized.
-An instance of this AuxiliaryTable
is then initialised from the Column
instances in todotable
.
+An instance of this
AuxiliaryTable
is then initialised from the
Column
instances in “todotable”.
class AuxTable: AuxiliaryTable {
let tableName = "aux_table"
let name = Column("name")
@@ -519,17 +522,19 @@ Parameters
-
@@ -542,7 +547,7 @@
Usage Example:
In this example, an AuxiliaryTable
class is defined containing two columns.
A ToDoTable
(as defined in Table
) instance and queryBuilder instance are initialized.
-An instance of this AuxiliaryTable
is then initialised from the Column
instances in todotable
.
+An instance of this AuxiliaryTable
is then initialised from the Column
instances in “todotable”.
The buildWith
function is then called on this AuxiliaryTable
instance, with the resulting String being printed out.
class AuxTable: AuxiliaryTable {
let tableName = "aux_table"
@@ -607,8 +612,8 @@ Return Value