Module: Perfect-Filemaker
struct FileMakerServer
A connection to a FileMaker Server instance.
enum FMPFieldType
One of the possible FileMaker field types.
case text
A text field.
case number
A numeric field.
case container
A container field.
case date
A date field.
case time
A time field.
case timestamp
A timestamp field.
struct FMPFieldDefinition
A FileMaker field definition. Indicates a field name and type.
var name: String
The field name.
var type: FMPFieldType
The field type.
enum FMPMetaDataItem
Represents either an individual field definition or a related (portal) definition.
case relatedSetDefinition(String, [FMPFieldDefinition])
A related set. Indicates the portal name and its contained fields.
struct FMPLayoutInfo
Represents meta-information about a particular layout.
var fields: [FMPMetaDataItem]
Each field or related set as a list.
var fieldsByName: [String:FMPFieldType]
Each field or related set keyed by name.
enum FMPAction: CustomStringConvertible
A database action.
case find
Perform a search given the current query.
case findAll
Find all records in the database.
case findAny
Find and retrieve a random record.
case new
Create a new record given the current query data.
case edit
Edit (update) the record indicated by the record id with the current query fields/values.
case delete
Delete the record indicated by the current record id.
case duplicate
Duplicate the record indicated by the current record id.
var description: String
Duplicate the record indicated by the current record id.
enum FMPSortOrder: CustomStringConvertible
A record sort order.
case ascending
Sort the records by the indicated field in ascending order.
case descending
Sort the records by the indicated field in descending order.
case custom
Sort the records by the indicated field in a custom order.
var description: String
Sort the records by the indicated field in a custom order.
struct FMPSortField
A sort field indicator.
var name: String
The name of the field on which to sort.
var order: FMPSortOrder
A field sort order.
func init(name: String, order: FMPSortOrder)
Initialize with a field name and sort order.
func init(name: String)
Initialize with a field name using the default FMPSortOrder.ascending sort order.
struct FMPQueryField
An individual query field.
var name: String
The name of the field.
var value: Any
The value for the field.
var op: FMPFieldOp
The search operator.
struct FMPQueryFieldGroup
A group of query fields.
var op: FMPLogicalOp
The logical operator for the field group.
var fields: [FMPQueryField]
The list of fiedls in the group.
func init(fields: [FMPQueryField], op: FMPLogicalOp = .and)
Initialize with an operator and field list.
The default logical operator is FMPLogicalOp.and.
global var fmpNoRecordId = -1
Indicates an invalid record id.
global var fmpAllRecords = -1
Indicates no max records value.
struct FMPQuery: CustomStringConvertible
An individual query & database action.
func init(database: String, layout: String, action: FMPAction)
Initialize with a database name, layout name & database action.
func recordId(_ recordId: Int) -> FMPQuery
Sets the record id and returns the adjusted query.
func queryFields(_ queryFields: [FMPQueryFieldGroup]) -> FMPQuery
Adds the query fields and returns the adjusted query.
func queryFields(_ queryFields: [FMPQueryField]) -> FMPQuery
Adds the query fields and returns the adjusted query.
func sortFields(_ sortFields: [FMPSortField]) -> FMPQuery
Adds the sort fields and returns the adjusted query.
func preSortScripts(_ preSortScripts: [String]) -> FMPQuery
Adds the indicated pre-sort scripts and returns the adjusted query.
func preFindScripts(_ preFindScripts: [String]) -> FMPQuery
Adds the indicated pre-find scripts and returns the adjusted query.
func postFindScripts(_ postFindScripts: [String]) -> FMPQuery
Adds the indicated post-find scripts and returns the adjusted query.
func responseLayout(_ responseLayout: String) -> FMPQuery
Sets the response layout and returns the adjusted query.
func responseFields(_ responseFields: [String]) -> FMPQuery
Adds response fields and returns the adjusted query.
func maxRecords(_ maxRecords: Int) -> FMPQuery
Sets the maximum records to fetch and returns the adjusted query.
func skipRecords(_ skipRecords: Int) -> FMPQuery
Sets the number of records to skip in the found set and returns the adjusted query.
var description: String
Sets the number of records to skip in the found set and returns the adjusted query.
var queryString: String
Returns the formulated query string.
Useful for debugging purposes.
enum FMPFieldValue: CustomStringConvertible
A returned FileMaker field value.
case text(String)
A text field.
case number(Double)
A numeric field.
case container(String)
A container field.
case date(String)
A date field.
case time(String)
A time field.
case timestamp(String)
A timestamp field.
var description: String
Returns the field value converted to String
struct FMPDatabaseInfo
Meta-information for a database.
var dateFormat: String
The date format indicated by the server.
var timeFormat: String
The time format indicated by the server.
var timeStampFormat: String
The timestamp format indicated by the server.
var recordCount: Int
The total number of records in the database.
struct FMPRecord
An individual result set record.
enum RecordItem
A type of record item.
case relatedSet(String, [FMPRecord])
A related set containing a list of related records.
var recordId: Int
The record id.
var elements: [String:RecordItem]
The contained record items keyed by name.
struct FMPResultSet
The result set produced by a query.
var foundCount: Int
The number of records found by the query.
var records: [FMPRecord]
The list of records produced by the query.