![image_squidhome@2x.png](http://i.imgur.com/RIvu9.png)

[![NPM version](https://badge.fury.io/js/waterline-leancloud.svg)](http://badge.fury.io/js/waterline-leancloud)
[![Build Status](https://travis-ci.org/Jimmysh/waterline-leancloud.svg?branch=master)](https://travis-ci.org/Jimmysh/waterline-leancloud)
[![Dependency Status](https://gemnasium.com/badges/github.com/Jimmysh/waterline-leancloud.svg)](https://gemnasium.com/github.com/Jimmysh/waterline-leancloud)
[![Test Coverage](https://codeclimate.com/github/Jimmysh/waterline-leancloud/badges/coverage.svg)](https://codeclimate.com/github/Jimmysh/waterline-leancloud/coverage)
[![Downloads](http://img.shields.io/npm/dm/waterline-leancloud.svg)](https://npmjs.org/package/waterline-leancloud)
[![Code Climate](https://codeclimate.com/github/Jimmysh/waterline-leancloud/badges/gpa.svg)](https://codeclimate.com/github/Jimmysh/waterline-leancloud)
[![Issue Count](https://codeclimate.com/github/Jimmysh/waterline-leancloud/badges/issue_count.svg)](https://codeclimate.com/github/Jimmysh/waterline-leancloud)

# waterline-leancloud
Waterline 中间件, 支持 leancloud 数据库，已全部通过 waterline 的测试！

# Waterline
https://github.com/balderdashy/waterline-docs
 1. 支持主流关系数据库和文档数据库
 2. 弱化了数据库之间的差异
 3. 用一种对象的查询方式搞定多种数据库
 4. 项目移植变的更容易
 5. 支持20几种增删查改的方式 内置 schema 验证

# test
在项目根目录建立 leancloudKey.js 内容如下
```javascript
module.exports = {
     appId: "your appId",
     appKey: "your appKey",
     masterKey: "your masterKey"
 };
```
因为leancloud 没有“删除整个数据表”的接口, 有部分数据集会写入数字和字符串两种类型（实际使用不会出现）,所以需要设置 类型为 any
```
1. driver_taxis__taxi_drivers 表 taxi_drivers 类型为 any
2. paymentbelongsTable 表 customer_belongs 类型为 any
```
```bash
$ npm test
```
## Install
```bash
$ npm install waterline-leancloud
```

## Configuration
```javascript
config: {
     appId: "your appId",
     appKey: "your appKey",
     masterKey: "your masterKey"
    }
```

## License
MIT
