Skip to content

Commit

Permalink
vapor 2 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed May 17, 2017
1 parent bc48d94 commit 799999c
Showing 1 changed file with 17 additions and 48 deletions.
65 changes: 17 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,17 @@
# CMySQL

C module for MySQL

## Building

**To build on macOS:**

```sh
swift build -Xswiftc -I/usr/local/include/mysql -Xlinker -L/usr/local/lib
```

- `-I` tells the compiler where to find the MySQL header file `mysql.h`.
- `-L` tells the linker where to find MySQL library `libmysqlclient`.

**To build on Linux:**

`swift build` should work normally.

## MariaDB

To use MariaDB instead of MySQL, you just need to change a couple of the compiler flags.

**macOS:**

```sh
swift build -Xlinker -L/usr/local/lib -Xswiftc -DMARIADB -Xswiftc -DNOJSON
```

- `-DMARIADB` tells the compiler to link the MariaDB library instead of the MySQL library.
- `-DNOJSON` tells the package to ignore the `JSON` type (not supported as of MariaDB 10.1.16).

**Linux:**

```sh
swift build -Xswiftc -I/usr/include/mariadb -Xlinker -L/usr/lib/x86_64-linux-gnu -Xswiftc -DMARIADB -Xswiftc -DNOJSON
```

- This simply changes the library/header paths and sets the same compatibility options shown above.
- Note that on macOS the library is called `libmysqlclient`, while on Linux the library is called `libmariadb`.

## 💧 Community

Join the welcoming community of fellow Vapor developers in [slack](http://vapor.team).

## 🔧 Compatibility

This package has been tested on macOS and Ubuntu.
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/1342803/24704008/10d9e7de-1a06-11e7-855b-af4a079ba6b5.png" width="320" alt="MySQL">
<br>
<br>
<a href="https://docs.vapor.codes/mysql/package/">
<img src="http://img.shields.io/badge/read_the-docs-92A8D1.svg" alt="Documentation">
</a>
<a href="http://vapor.team">
<img src="http://vapor.team/badge.svg" alt="Slack Team">
</a>
<a href="LICENSE">
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License">
</a>
<a href="https://swift.org">
<img src="http://img.shields.io/badge/swift-3.1-brightgreen.svg" alt="Swift 3.1">
</a>
</p>

0 comments on commit 799999c

Please sign in to comment.