SMQL is a JSON-based query langauage similar to MQL. This gem convertes these querys to ActiveRecord.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Denis Knauf a4ce8a1e6b v0.0.7 10 years ago
lib not compatible to ruby1.8 now! new: ActiveRecordExtensions 10 years ago
.gitignore AR-through-reflections in query_builder; SmqlToAR.models returns the reflections-graph; limit, offset, sub-query "()" (not sub-conditions). unstable 0.3 11 years ago
AUTHORS init 11 years ago
LICENSE init 11 years ago
README.md readme: translationfixes 11 years ago
Rakefile dependency to methodphitamine removed. 11 years ago
TODO bugfixes: ranges, vid===Symbol, And/Or in NotInRange 11 years ago
VERSION v0.0.7 10 years ago

README.md

Idea

Similar to MQL: SMQL allows to perform queries on your database but in a JSON-based language.

This query language is SQL-injection-safe. However, expensive queries can slow down your machine.

Usage

Example: An easy query in ruby: User is a ActiveRecord-Model and has a column username. We want to find all users where username = "auser".

require 'smql'

SmqlToAR.to_ar User, '{"username": "auser"}' # Query in JSON
SmqlToAR.to_ar User, username: "auser"       # Query in Ruby

In Rails:

SmqlToAR.to_ar User, params[:smql]

Don't forget to add my gem to the Gemfile:

gem 'smql'