Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PerfectlySoft/Perfect-FileMaker
A stand-alone Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers.
https://github.com/PerfectlySoft/Perfect-FileMaker
database filemaker filemaker-servers perfect server-side-swift swift
Last synced: 3 months ago
JSON representation
A stand-alone Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers.
- Host: GitHub
- URL: https://github.com/PerfectlySoft/Perfect-FileMaker
- Owner: PerfectlySoft
- License: apache-2.0
- Created: 2016-07-21T00:21:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T13:05:17.000Z (almost 6 years ago)
- Last Synced: 2024-08-06T12:53:45.977Z (3 months ago)
- Topics: database, filemaker, filemaker-servers, perfect, server-side-swift, swift
- Language: Swift
- Homepage: https://www.perfect.org
- Size: 38.1 KB
- Stars: 34
- Watchers: 14
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - FileMaker - A Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers. (Database / Getting Started)
- TheList - Perfect Filemaker connector - A stand-alone Swift wrapper around the FileMaker XML Web publishing interface. (Database Connectors / FileMaker)
- awesome-ios-star - FileMaker - A Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers. (Database / Getting Started)
- fucking-awesome-ios - FileMaker - A Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers. (Database / Getting Started)
- fucking-awesome-ios - FileMaker - A Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers. (Database / Getting Started)
README
# Perfect - FileMaker Server Connector
This project provides access to FileMaker Server databases using the XML Web publishing interface.
This package builds with Swift Package Manager and is part of the [Perfect](https://github.com/PerfectlySoft/Perfect) project. It was written to be stand-alone and so does not need to be run as part of a Perfect server application.
Ensure you have installed and activated the latest Swift 4.1.1 tool chain.
## Linux Build Notes
Ensure that you have installed curl and libxml2.
```
sudo apt-get install libcurl4-openssl-dev libxml2-dev
```## Building
Add this project as a dependency in your Package.swift file.
```
.package(url: "https://github.com/PerfectlySoft/Perfect-FileMaker.git", from: "3.0.0")
```## Examples
To utilize this package, ```import PerfectFileMaker```.
### List Available Databases
This snippet connects to the server and has it list all of the hosted databases.
```swift
let fms = FileMakerServer(host: testHost, port: testPort, userName: testUserName, password: testPassword)
fms.databaseNames {
result in
do {
// Get the list of names
let names = try result()
for name in names {
print("Got a database name \(name)")
}
} catch FMPError.serverError(let code, let msg) {
print("Got a server error \(code) \(msg)")
} catch let e {
print("Got an unexpected error \(e)")
}
}
```### List Available Layouts
List all of the layouts in a particular database.
```swift
let fms = FileMakerServer(host: testHost, port: testPort, userName: testUserName, password: testPassword)
fms.layoutNames(database: "FMServer_Sample") {
result in
guard let names = try? result() else {
return // got an error
}
for name in names {
print("Got a layout name \(name)")
}
}
```### List Field On Layout
List all of the field names on a particular layout.
```swift
let fms = FileMakerServer(host: testHost, port: testPort, userName: testUserName, password: testPassword)
fms.layoutInfo(database: "FMServer_Sample", layout: "Task Details") {
result in
guard let layoutInfo = try? result() else {
return // error
}
let fieldsByName = layoutInfo.fieldsByName
for (name, value) in fieldsByName {
print("Field \(name) = \(value)")
}
}
```### Find All Records
Perform a findall and print all field names and values.
```swift
let query = FMPQuery(database: "FMServer_Sample", layout: "Task Details", action: .findAll)
let fms = FileMakerServer(host: testHost, port: testPort, userName: testUserName, password: testPassword)
fms.query(query) {
result in
guard let resultSet = try? result() else {
return // error
}
let fields = resultSet.layoutInfo.fields
let records = resultSet.records
let recordCount = records.count
for i in 0..