Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/webpack like support #78

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .travis.yml
100644 → 100755
Empty file.
12 changes: 12 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Copyright (c) 2012-2015, Parallels Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 changes: 27 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Build Status](https://travis-ci.org/persvr/rql.svg?branch=master)](https://travis-ci.org/persvr/rql)

Resource Query Language (RQL) is a query language designed for use in URIs with object
style data structures. This project includes the RQL specification and
provides a JavaScript implementation of query
Expand Down Expand Up @@ -27,8 +25,14 @@ Such that this can be used in URIs like:
Using the JavaScript library we can construct queries
using chained operator calls in JavaScript. We could execute the query above like this:

var Query = require("rql/query").Query;
var fooEq3Query = new Query().eq("foo",3);
var query = require("rql/js-array").query;

var fooEq3Query = query("eq(foo,3)");
var results = fooEq3Query(data);

// or
var results = query("eq(foo,3)", undefined, data);


# RQL Rules

Expand Down Expand Up @@ -118,9 +122,12 @@ for more less operators):
* contains(<property>,<value | expression>) - Filters for objects where the specified property's value is an array and the array contains any value that equals the provided value or satisfies the provided expression.
* excludes(<property>,<value | expression>) - Filters for objects where the specified property's value is an array and the array does not contain any of value that equals the provided value or satisfies the provided expression.
* limit(count,start,maxCount) - Returns the given range of objects from the result set
* like(property, pattern) - Search for the specified pattern in the specified property.
* and(<query>,<query>,...) - Applies all the given queries
* or(<query>,<query>,...) - The union of the given queries
* not(query) - negation
* eq(<property>,<value>) - Filters for objects where the specified property's value is equal to the provided value
* like(<property>,<value>) - Filters for objects where the specified property's value is like to the provided value in [glob format][1]
* lt(<property>,<value>) - Filters for objects where the specified property's value is less than the provided value
* le(<property>,<value>) - Filters for objects where the specified property's value is less than or equal to the provided value
* gt(<property>,<value>) - Filters for objects where the specified property's value is greater than the provided value
Expand All @@ -138,6 +145,12 @@ for more less operators):

# JavaScript Modules

## rql/js-array

An implementation of RQL for JavaScript arrays. For example:

require("./js-array").query("a=3", {}, [{a:1},{a:3}]) -> [{a:3}]

## rql/query

var newQuery = require("rql/query").Query();
Expand Down Expand Up @@ -181,42 +194,28 @@ For example:
]
}

Installation
========

RQL can be installed using any standard package manager, for example with NPM:

npm install rql

or CPM:

cpm install rql

or RingoJS:

ringo-admin install persvr/rql


Licensing
--------

The RQL implementation is part of the Persevere project, and therefore is licensed under the
AFL or BSD license. The Persevere project is administered under the Dojo foundation,
and all contributions require a Dojo CLA.
This RQL implementation is part of APS JavaScript SDK and licensed under the BSD license.

Project Links
------------

See the main Persevere project for more information:
See the main APS Standard for more information:

### Homepage:

* [http://persvr.org/](http://persvr.org/)
* [http://apsstandard.org/](http://apsstandard.org/)

### About RQL in APS:

* [https://doc.apsstandard.org/2.1/spec/rql/](https://doc.apsstandard.org/2.1/spec/rql/)

### Mailing list:
### RQL Specification:

* [http://groups.google.com/group/json-query](http://groups.google.com/group/json-query)
* [https://github.com/persvr/rql/tree/master/specification](https://github.com/persvr/rql/tree/master/specification)

### IRC:

* [\#persevere on irc.freenode.net](http://webchat.freenode.net/?channels=persevere)
[1]: https://github.com/xiag-ag/rql-parser/#operators
6 changes: 6 additions & 0 deletions js-array.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {Query} from './query'
declare namespace RqlArray {
export function executeQuery(query: string | Query, options: any, target: any[]);
}

export = RqlArray;
Loading