Swiftpack.co - Andrew-Lees11/CunixODBC as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Andrew-Lees11.
Andrew-Lees11/CunixODBC 0.0.1
Wrapper for unixODBC
⭐️ 1
🕓 5 years ago
.package(url: "https://github.com/Andrew-Lees11/CunixODBC.git", from: "0.0.1")

CunixODBC

Intended for demonstation purposes only.

Swift module maps for unixODBC, which allow you to use the unixODBC C library in your Swift project.

Note - from Swift 4.2 you can pull the unixODBC library directly into your Swift project and will not need to use this repository (you can see an example of this in Swift-Kuery-PostgreSQL).

Usage

Add dependencies

Add the CunixODBC package to the dependencies within your application’s Package.swift file. Substitute "x.x.x" with the latest CunixODBC release.

.package(url: "https://github.com/Andrew-Lees11/CunixODBC.git", from: "x.x.x")

Add CunixODBC to your target's dependencies:

.target(name: "example", dependencies: ["CunixODBC"]),

Import package

import CunixODBC

Build and test linking

You must have unixODBC installed on your machine:

  • MacOS:
brew install unixodbc
  • Linux:
apt-get install unixodbc-dev

Since brew doesn't install the files to the expected place you must provide a linker to swift for any project that depends on this:

swift build -Xcc -I/usr/local/Cellar/unixodbc/2.3.7/include
swift run -Xcc -I/usr/local/Cellar/unixodbc/2.3.7/include
swift test -Xcc -I/usr/local/Cellar/unixodbc/2.3.7/include

Using with Xcode:

You must add the xcconfig file from this repo to your project. Then generate the project using:

swift package generate-xcodeproj --xcconfig-overrides unixodbc.xcconfig

Community

We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!

GitHub

link
Stars: 1
Last commit: 5 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.0.1
5 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics