Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ DerivedData
*.hmap
*.xccheckout

#CocoaPods
# CocoaPods
Pods

# Swift Package Manager
.build
17 changes: 17 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swift-tools-version:5.0
import PackageDescription

let package = Package(
name: "SQLClient",
products: [
.library(name: "SQLClient", targets: ["SQLClient"]),
],
targets: [
.target(
name: "SQLClient",
path: "SQLClient/SQLClient/SQLClient",
publicHeadersPath: "spm_include",
linkerSettings: [.linkedLibrary("iconv")]
),
]
)
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ SQLClient

Native Microsoft SQL Server client for iOS. An Objective-C wrapper around the open-source [FreeTDS](https://github.com/FreeTDS/freetds/) library.

----------------

## Swift Package Manager
In order to use this project in SPM, you'll need to copy the file `libsybdb.a` from this repository into your own project, and include a line like

```
.target(name: "App", dependencies: ["SQLClient"],
linkerSettings: [.unsafeFlags(["-Llibs", "-lsybdb"])]
)
```

in your project's `Package.swift` file (assuming you put `libsybdb.a` in a directory called `libs`). This is due to [Apple's limitations on manually specified flags](https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageDescription.md#linkersetting).

----------------

## Sample Usage

<pre>
Expand Down
5 changes: 3 additions & 2 deletions SQLClient/SQLClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
5B0FC8CD180DDF7E00DF4EFE /* ctpublic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctpublic.h; sourceTree = "<group>"; };
5B0FC8CE180DDF7E00DF4EFE /* libsybdb.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsybdb.a; sourceTree = "<group>"; };
5B0FC8CF180DDF7E00DF4EFE /* odbcss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = odbcss.h; sourceTree = "<group>"; };
5B0FC8D0180DDF7E00DF4EFE /* SQLClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLClient.h; sourceTree = "<group>"; };
5B0FC8D1180DDF7E00DF4EFE /* SQLClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQLClient.m; sourceTree = "<group>"; };
5B0FC8D2180DDF7E00DF4EFE /* sqldb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sqldb.h; sourceTree = "<group>"; };
5B0FC8D3180DDF7E00DF4EFE /* sqlfront.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sqlfront.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -177,7 +176,6 @@
isa = PBXGroup;
children = (
5B0FC8CE180DDF7E00DF4EFE /* libsybdb.a */,
5B0FC8D0180DDF7E00DF4EFE /* SQLClient.h */,
5B0FC8D1180DDF7E00DF4EFE /* SQLClient.m */,
5B0FC8CA180DDF7E00DF4EFE /* bkpublic.h */,
5B0FC8CB180DDF7E00DF4EFE /* cspublic.h */,
Expand Down Expand Up @@ -252,6 +250,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -374,6 +373,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/SQLClient/SQLClient/spm_include";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -411,6 +411,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/SQLClient/SQLClient/spm_include";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down