npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sails-filemaker

v0.2.5

Published

Provides easy access to [FileMaker](http://www.filemaker.com) Databases hosted on a FileMaker Server from [Sails.js](http://sailsjs.org/) & [Waterline](https://github.com/balderdashy/waterline). It can also be used with [hapi.js](http://hapijs.com/) throu

Downloads

21

Readme

sails-filemaker

Provides easy access to FileMaker Databases hosted on a FileMaker Server from Sails.js & Waterline. It can also be used with hapi.js through dogwater, the hapi plugin for Waterline

FileMaker is a different sort of database then typically used with Sails.js. This adapter is connects through FileMaker Server's Custom Web Publishing interface. see guide.

NOTE TO FILEMAKER USERS: You really need to have at least some experience installing and running nodejs based projects. If you don't have nodejs and sailsjs installed, start there. You won't be able to get far without being able to get those installed and running.

Video

You can watch this short video on how to get setup and running with sails-filemaker. The example below was creating during the screencast.

Example

Take a look at this repo to see an example that connects to a FileMaker database running on localhost.

Installation

To install this adapter, run:

$ npm install sails-filemaker

Usage

This adapter exposes the following methods:

find()
  • Status
    • implemented
create()
  • Status
    • implemented
update()
  • Status
    • implemented
destroy()
  • Status
    • implemented

Interfaces

This adapter implements the semantic interfaces. For more information, check out this repository's FAQ and the adapter interface reference in the Sails docs.

FileMaker Specific Configurations

In config/connections.js create an entry for your FileMaker Server and Database, like any other adapter

'MyFMDataBase' : {
  adapter: 'sails-filemaker',
  host: '<your server address>',
  database : 'DatabaseName',
  userName: '<userName>',
  password : '<password>'
}

You can create more then one connection to the same server. Perhaps you need to connect to a second Database...

'MyOtherFMDataBase' : {
  adapter: 'sails-filemaker',
  host: '<your server address>',
  database : 'AnotherDatabaseName',
  userName: '<userName>',
  password : '<password>'
}

FileMaker's Custom Web Publishing uses Layouts to access the underlying tables. So Sails models for filemaker connect to Layouts not Tables. Layouts are sort of like views in that they specify a table, and a set of fields. They can even specify a set of related records and fields. But they do not specify queries.

Models

In your model, you will want to set a few attributes.

module.exports = {
  // filemaker handles these
  autoPK : false,
  autoCreatedAt: false,
  autoUpdatedAt: false,
  // layout name
  tableName : 'Contacts',
  // you MUST set up the primaryKey!
  // Setting up other attributes/fields is not required
  // unless you want conversion between JS and FileMaker ( i.e. date fields )
  attributes: {
    id : {
      type : 'string',
      primaryKey : true,
      unique : true
    }
  }
};

This adapter follows the Sails convention of using the file name to derive the layout name. So a User.js model file will connect to a User layout in FileMaker. If you want to use a different name for your layout, you can set the "tableName" property on the model.

For example

tableName : 'webContacts'

Would tell the model to connect to a layout named "webContacts", regardless of it's file name.

This is useful for FileMaker, since it is a common practice to use naming conventions to denote layouts that are only used for web access.

Check out Connections in the Sails docs, or see the config/connections.js file in a new Sails project for information on setting up adapters.

Running the tests

NOTE: you only need to run the tests if you are contributing to this project. You do not need to run the tests if you just want to use this in your sails-project.

You will need to load the ContactsTest.fmp12 file on to your FileMaker Server. There is a copy of this file in test/fixtures/ContactsTest.fmp12

If your Server is not on localhost you will need to change the config in test/integration/runner.js

  // Default adapter config to use.
  config: {
    adapter: 'sails-filemaker',
    host: '<localhost>', // change to your server
    database: 'ContactsTest',
    userName: 'admin',
    password: ''
  }

Then in your adapter's directory, run:

$ npm test

Questions?

See FAQ.md.

More Resources

License

MIT © 2015 toddgeist Todd Geist, geist interactive

Sails is free and open-source under the MIT License.