Skip to content

Commit

Permalink
Update FAQ.md
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
dmarcelino committed Mar 26, 2015
1 parent ce28c94 commit 04665eb
Showing 1 changed file with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions FAQ.md
Expand Up @@ -18,20 +18,15 @@ npm install sails-orientdb --save
+ Docs for the latest stable npm release of Waterline are on [balderdashy/waterline-docs](https://github.com/balderdashy/waterline-docs). Sails documentation itself is on [sailsjs.org](http://sailsjs.org/#!documentation).


### What happened to waterline-orientdb?
Srinath, Gaurav and Dário combined their efforts and now both are focused on developing a single Waterline/Sails OrientDB adapter, as such waterline-orientdb has been renamed **sails-orientdb**. More about this on the [README.md](./README.md#history).


### What is an adapter?

Adapters expose **interfaces**, which imply a contract to implement certain functionality. This allows us to guarantee conventional usage patterns across multiple models, developers, apps, and even companies, making app code more maintainable, efficient, and reliable. Adapters are useful for integrating with databases, open APIs, internal/proprietary web services, or even hardware.


### What kind of things can I do in an adapter?

Adapters are mainly focused on providing model-contextualized CRUD methods. CRUD stands for create, read, update, and delete. In Sails/Waterline, we call these methods `create()`, `find()`, `update()`, and `destroy()`.

For example, a `MySQLAdapter` implements a `create()` method which, internally, calls out to a MySQL database using the specified table name and connection informtion and runs an `INSERT ...` SQL query.

In practice, your adapter can really do anything it likes-- any method you write will be exposed on the raw connection objects and any models which use them.


### How do I get involved?

Expand All @@ -54,19 +49,6 @@ I know, I know... Not everything fits perfectly into a RESTful/CRUD mold! Somet



## Why should I build a custom adapter?

To recap, writing your API integrations as adapters is **easier**, takes **less time**, and **absorbs a considerable amount of risk**, since you get the advantage of a **standardized set of conventions**, a **documented API**, and a **built-in community** of other developers who have gone through the same process. Best of all, you (and your team) can **reuse the adapter** in other projects, **speeding up development** and **saving time and money**.

Finally, if you choose to release your adapter as open-source, you provide a tremendous boon to our little framework and our budding Sails.js ecosystem. Even if it's not via Sails, I encourage you to give back to the OSS community, even if you've never forked a repo before-- don't be intimidated, it's not that bad!

The more high-quality adapters we collectively release as open-source, the less repetitive work we all have to do when we integrate with various databases and services. My vision is to make building server-side apps more fun and less repetitive for everyone, and that happens one community adapter at a time.

I tip my hat to you in advance :)




## What is an Adapter Interface?

The functionality of adapters is as varied as the services they connect. That said, there is a standard library of methods, and a support matrix you should be aware of. Adapters may implement some, all, or none of the interfaces below, but rest assured that **if an adapter implements one method in an interface, it should implement *all* of them**. This is not always the case due to limitations and/or incomplete implementations, but at the very least, a descriptive error message should be used to keep developers informed of what's supported and what's not.
Expand All @@ -75,20 +57,6 @@ The functionality of adapters is as varied as the services they connect. That s




## Are there examples I can look at?


**[MySQL](https://github.com/balderdashy/sails-mysql)**, **[PostgreSQL](https://github.com/balderdashy/sails-postgresql)**, **[MongoDB](https://github.com/balderdashy/sails-mongo)**, **[Redis](https://github.com/balderdashy/sails-redis)**, local [disk](https://github.com/balderdashy/sails-disk), and local [memory](https://github.com/balderdashy/sails-memory). [Community adapters](https://github.com/balderdashy/sails-docs/blob/master/intro-to-custom-adapters.md#notable-community-adapters) exist for Riak, CouchDB, and ElasticSearch; for various 3rd-party REST APIs like Yelp and Twitter; plus some [eclectic projects](https://www.youtube.com/watch?v=OmcQZD_LIAE).



> If you have an unanswered question that isn't covered here, and that you feel would add value for the community, please feel free to send a PR to the [official generator]() for waterline/sails adapters adding it to this section.



### Where do I get help?

+ [Ask a question on StackOverflow](http://stackoverflow.com/questions/tagged/sailsjs?sort=newest&days=30)
Expand Down

0 comments on commit 04665eb

Please sign in to comment.