<commit_before># fms

[![Build Status](https://travis-ci.org/f/f.png?branch=master)](https://travis-ci.org/f/f)

> test

## About
This is a FileMaker Adapter for feathers.js. It makes it trivial to create a feathers service for any FileMaker Layout.  For non FileMaker people, a layout is a Table with a defined set of fields, and related records

This currently passes all but two tests in the feathers-service-test suite. There is not an easy way to do a a true POST, which would require nulling fields. we just do a PATCH instead. We also do not support the $in and $nin query filters.  We may in the future.

Support for $or is limited. Only single fields will work.

## License

Copyright <NAME>(c) 2016

Licensed under the [MIT license](LICENSE)<commit_msg>fix readme<commit_after># fms

[![Build Status](https://travis-ci.org/f/f.png?branch=master)](https://travis-ci.org/f/f)

> A FileMaker Adapter For Feathers.js.

## About
This is a FileMaker Adapter for feathers.js. It makes it trivial to create a feathers service for any FileMaker Layout.  For non FileMaker people, a layout is a Table with a defined set of fields, and related records.

This currently passes all but two tests in the feathers-service-test suite. There is not an easy way to do a a true POST, which would require nulling fields. When you POST, you basically just get a Patch. We also do not support the $in and $nin query filters.  We may in the future.  Support for $or is limited. Only single fields will work.

## Install

```bash
npm install feathers-filemaker --save
```
## Documentation

This adapter works like others Feathers Adapters. Please refer to the [Feathers database adapter documentation](http://docs.feathersjs.com/databases/readme.html) for more details or directly at:

- [Extending](http://docs.feathersjs.com/databases/extending.html) - How to extend a database adapter
- [Pagination and Sorting](http://docs.feathersjs.com/databases/pagination.html) - How to use pagination and sorting for the database adapter
- [Querying](http://docs.feathersjs.com/databases/querying.html) - The common adapter querying mechanism

### FileMaker Specific Configuration

This adapter takes two additional keys in it's configuration object: `connection`   and `model`

#### Connection

```js
  connection :{
    host : 'localhost',  // server address
    db : 'Contacts'
    user : 'admin'
    pass : '<PASSWORD>'
  }
  ```

#### Model
 
  ```js
  model :{
    layout : 'Contacts' // the layout for the service
    idField : 'id'  // primary key field name, defaults to 'id'
 ```

Connection specifies the host, database, user, and password to connect to the database. model specifies the layout and idField to use for the feathers service.  See the complete example below for more information.


## Complete Example

```javascript
var feathers = require('feathers');
var bodyParser = require('body-parser');
var rest = require('feathers-rest');
var socketio = require('feathers-socketio');
var mms = require('feathers-memory');

// Create a feathers instance.
const app = feathers()
  // Enable REST services
  .configure(rest())
  // Enable Socket.io services
  .configure(socketio())
  // Turn on JSON parser for REST services
  .use(bodyParser.json())
  // Turn on URL-encoded parser for REST services
  .use(bodyParser.urlencoded({ extended: true }));

// create a FileMaker Service based on the Contacts Layout in the Contacts db
// paginate options can also be set here
app.use('/contacts', fms({
  connection :{
    host : 'localhost',
    db : 'Contacts'
    user : 'admin'
    pass : '<PASSWORD>'
  },
  model :{
    layout : 'Contacts'
    idField : 'id'
  },
  paginate: {
    default: 2,
    max: 4
  }
}));


// Start the server.
var port = 3030;

app.listen(port, function() {
  console.log(`Feathers server listening on port ${port}`);
});
```

## License

Copyright <NAME>(c) 2016

Licensed under the [MIT license](LICENSE)
{'fraction_non_alphanumeric': 0.10768839103869654, 'fraction_numerical': 0.003564154786150713, 'mean_word_length': 3.8208588957055216, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6658415', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1148, 'n_words': 474}