File tree Expand file tree Collapse file tree 8 files changed +117
-20
lines changed Expand file tree Collapse file tree 8 files changed +117
-20
lines changed Original file line number Diff line number Diff line change 1212 - run : mysql -u root -e "create database IF NOT EXISTS test;"
1313 - run : swift build
1414 - run : swift test
15+ mac-swift5.0 :
16+ macos :
17+ xcode : " 10.2.0"
18+ steps :
19+ - checkout
20+ - run : brew update
21+ - run : brew install https://gist.github.com/novi/dd21d48d260379e8919d9490bf5cfaec/raw/6ea4daa02d93f4ab0110ad30d87ea2b497a71cd0/cmysqlmariadb.rb # cmysql
22+ - run : mkdir -p /usr/local/etc/my.cnf.d # workaround
23+ - run : mysql.server start
24+ - run : mysql -u root -e "create database IF NOT EXISTS test;"
25+ - run : swift build
26+ - run : swift test
27+ mac-swift5.0-mysql :
28+ macos :
29+ xcode : " 10.2.0"
30+ steps :
31+ - checkout
32+ - run : brew update
33+ - run : brew install https://gist.githubusercontent.com/novi/c6d4afa6e9f9cc9c426e3ccd140c3c74/raw/7130ad1d5062cdb2f7492d42e8d5574b864f3e18/cmysql.rb
34+ - run : mysql.server start
35+ - run : mysql -u root -e "create database IF NOT EXISTS test;"
36+ - run : swift build
37+ - run : swift test
1538 linux-swift4.1 :
1639 docker :
1740 - image : yusukeito/swift-basic:swift4.1
@@ -42,11 +65,29 @@ jobs:
4265 - run : sleep 5 # wait for mysql
4366 - run : swift build
4467 - run : swift test
68+ linux-swift5.0 :
69+ docker :
70+ - image : yusukeito/swift-basic:swift5.0
71+ - image : mariadb:10.3
72+ environment :
73+ MYSQL_USER : root
74+ MYSQL_DATABASE : " test"
75+ MYSQL_ALLOW_EMPTY_PASSWORD : yes
76+ MYSQL_ROOT_HOST : " %"
77+ DATABASE_HOST : " %"
78+ steps :
79+ - checkout
80+ - run : sleep 5 # wait for mysql
81+ - run : swift build
82+ - run : swift test
4583
4684workflows :
4785 version : 2
4886 build_and_test :
4987 jobs :
5088 - mac-swift4.2
89+ - mac-swift5.0
90+ - mac-swift5.0-mysql
5191 - linux-swift4.1
52- - linux-swift4.2
92+ - linux-swift4.2
93+ - linux-swift5.0
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // swift-tools-version:5.0
2+ import PackageDescription
3+
4+ let package = Package (
5+ name: " MySQL " ,
6+ products: [
7+ . library( name: " MySQL " , targets: [ " MySQL " ] )
8+ ] ,
9+ targets: [
10+ . systemLibrary(
11+ name: " CMySQL " ,
12+ path: " Sources/cmysql " ,
13+ pkgConfig: " cmysql " ,
14+ providers: [
15+ . brew( [ " cmysql " ] ) ,
16+ . apt( [ " libmysqlclient-dev " ] )
17+ ]
18+ ) ,
19+ . target(
20+ name: " SQLFormatter "
21+ ) ,
22+ . target(
23+ name: " MySQL " ,
24+ dependencies: [
25+ " CMySQL " ,
26+ " SQLFormatter " ,
27+ ]
28+ ) ,
29+ . testTarget(
30+ name: " MySQLTests " ,
31+ dependencies: [
32+ " MySQL "
33+ ]
34+ ) ,
35+ . testTarget(
36+ name: " SQLFormatterTests " ,
37+ dependencies: [
38+ " MySQL "
39+ ]
40+ )
41+ ]
42+ )
Original file line number Diff line number Diff line change 11mysql-swift
22===========
33
4- [ ![ Swift 4.1] ( https://img.shields.io/badge/Swift-4.1-orange.svg )] ( https://swift.org )
54![ Platform Linux, macOS] ( https://img.shields.io/badge/Platforms-Linux%2C%20macOS-lightgray.svg )
65[ ![ CircleCI] ( https://circleci.com/gh/novi/mysql-swift.svg?style=svg )] ( https://circleci.com/gh/novi/mysql-swift )
76
@@ -71,9 +70,9 @@ Install pkg-config `.pc` file in [cmysql](https://github.com/vapor-community/cmy
7170
7271``` sh
7372# cmysql
74- $ brew tap vapor/homebrew-tap && brew install cmysql
73+ $ brew install https://gist.githubusercontent.com/novi/c6d4afa6e9f9cc9c426e3ccd140c3c74/raw/7130ad1d5062cdb2f7492d42e8d5574b864f3e18/ cmysql.rb
7574# cmysql-mariadb
76- $ brew install https://gist.github .com/novi/dd21d48d260379e8919d9490bf5cfaec/raw/6ea4daa02d93f4ab0110ad30d87ea2b497a71cd0/cmysqlmariadb.rb
75+ $ brew install https://gist.githubusercontent .com/novi/dd21d48d260379e8919d9490bf5cfaec/raw/6ea4daa02d93f4ab0110ad30d87ea2b497a71cd0/cmysqlmariadb.rb
7776```
7877
7978## Ubuntu
Original file line number Diff line number Diff line change @@ -19,9 +19,15 @@ public extension IDType {
1919 func queryParameter( option: QueryParameterOption ) throws -> QueryParameterType {
2020 return try id. queryParameter ( option: option)
2121 }
22+ #if swift(>=4.2)
23+ func hash( into hasher: inout Hasher ) {
24+ hasher. combine ( id)
25+ }
26+ #else
2227 var hashValue : Int {
2328 return id. hashValue
2429 }
30+ #endif
2531}
2632
2733extension IDType where Self: SQLRawStringDecodable , Self. T: SQLRawStringDecodable {
Original file line number Diff line number Diff line change 1+ prefix=/usr/local/opt/mysql
2+ exec_prefix=${prefix}
3+ libdir=${exec_prefix}/lib
4+ includedir=${prefix}/include
5+ Name: MySQL
6+ Description: MySQL client library
7+ Version: 2.0
8+ Cflags: -I${includedir}
9+ Libs: -L${libdir} -lmysqlclient
Original file line number Diff line number Diff line change 1+ module CMySQL [system] {
2+ header "shim.h"
3+ link "mysqlclient"
4+ export *
5+ }
Original file line number Diff line number Diff line change 1+ #ifndef __CMYSQL_SHIM_H__
2+ #define __CMYSQL_SHIM_H__
3+
4+ #include <mysql/mysql.h>
5+
6+ #if LIBMYSQL_VERSION_ID >= 80000
7+ typedef int my_bool ;
8+ #endif
9+
10+ #endif
11+
You can’t perform that action at this time.
0 commit comments