Commit graph

46 commits

Author SHA1 Message Date
Denis Knauf a4ce8a1e6b v0.0.7 2012-07-03 16:28:46 +02:00
Denis Knauf 7f43e9fb86 not compatible to ruby1.8 now! new: ActiveRecordExtensions 2012-07-03 16:28:27 +02:00
Denis Knauf 3d922c5e47 v0.0.6 2012-02-09 14:10:58 +01:00
Denis Knauf 7229fd185c overlaps: key-pairs will be ored 2012-02-09 13:31:24 +01:00
Denis Knauf 08d1610987 optimizer optimized (AND[Or["abc"]] -> "abc"). ()-bugfix in where-clause. 2012-01-18 13:34:26 +01:00
Denis Knauf ce81d21bd8 v0.0.5.2. build-methods renamed to an underscored class-name with suffix _build and aliases build to these methods created. equal_join_build fixed; it never use col.joins.each. #foreigh_key 2012-01-17 10:52:31 +01:00
Denis Knauf fbf5a7019c v0.0.5.1 2012-01-16 12:52:28 +01:00
Denis Knauf 27639e24b7 #join: ",".to_alias OPS! 2012-01-16 12:52:01 +01:00
Denis Knauf 40deac93bf v0.0.5 2012-01-12 17:12:22 +01:00
Denis Knauf 6f8569f80a OVERLAPS-Operator <=> bzw. <!> implementiert. SmqlToAR.reload_library löscht zuerst SmqlToAR, läd dann erst neu. 2012-01-12 17:11:55 +01:00
Denis Knauf a4a1d1b9e9 v0.0.4.8 2012-01-12 16:55:25 +01:00
Denis Knauf f6b9579073 over-datanamelen-bug fixed 2012-01-12 16:54:51 +01:00
Denis Knauf 3ba285548c patch fix 2011-12-05 12:39:41 +01:00
Denis Knauf 3d08496ec4 ( ( ) ( ) ) 2011-11-30 16:20:56 +01:00
Denis Knauf db1eec6fa7 v0.0.4.7 2011-11-30 13:55:34 +01:00
Denis Knauf edcc68a4ed dependency to methodphitamine removed. 2011-11-30 13:52:19 +01:00
Denis Knauf 2b3922e158 v0.0.4.6 2011-11-29 12:02:54 +01:00
Denis Knauf 493556fda2 Column::Col is comparable 2011-11-29 12:01:38 +01:00
Denis Knauf 1c97319d9c Column::Col-fixes (==, ===) 2011-11-29 12:00:40 +01:00
Denis Knauf 293909b58b v0.0.4.5 2011-11-28 15:48:13 +01:00
Denis Knauf 080237c5d7 bugfixes: ranges, vid===Symbol, And/Or in NotInRange 2011-11-28 15:47:48 +01:00
Denis Knauf 1d6baf41e3 0.0.4.4 unstable? 2011-11-22 12:15:36 +01:00
Denis Knauf 63be31734b debugging removed 2011-11-22 12:14:22 +01:00
Denis Knauf 69aceef180 aliased tables. firm: { "people[users]": {type: "User"}, "people[old]": {"age>:": 50 } # Every ToDo which has a User as Person or people older than 50. It is not an OR, it is an AND, but {people:{type:"User","age>":50}} or {"people":{type:"User"},"people":{"age>:":50} means every User older than 50. "users" and "old" are independet questions and both must be present, if firm should be true. 2011-11-21 10:06:46 +01:00
Denis Knauf 8eebb3ac1f VERSION 0.0.4.3 2011-10-27 15:28:34 +02:00
Denis Knauf 3b60648ee7 Version 0.0.4.3 2011-10-27 15:22:49 +02:00
Denis Knauf 5c68b74ee4 lesser logging. order-bug fixed 2011-10-27 15:21:56 +02:00
Denis Knauf f9ee0754f1 Version 0.0.4.2 2011-10-27 14:26:53 +02:00
Denis Knauf f3bcdd4b25 has_one-reflection (like has_many), group & having. subqueries deactivated 2011-10-25 16:31:18 +02:00
Denis Knauf 8eeb66d99f order by subnodes 2011-10-25 14:30:09 +02:00
Denis Knauf d5aa6052ec lesser debug 2011-10-06 15:28:40 +02:00
Denis Knauf 11466211ac group and having clause init 2011-10-06 13:27:41 +02:00
Denis Knauf cc49fdefe9 v0.0.4.1 2011-10-06 13:24:44 +02:00
Denis Knauf 863ebca9cd fixes: OR... 2011-10-06 13:24:17 +02:00
Denis Knauf 09dfa782a8 debugging-output removed 2011-10-05 14:53:34 +02:00
Denis Knauf 75c314159b v0.0.4 2011-10-05 14:06:50 +02:00
Denis Knauf 2fdc45d1d5 "self" and or
=============

This lines mean the same:

	User.smql :self => {:id => 1}
	User.smql :id => 1
	User.smql 'self.id' => 1
	User.smql 'self.self.self.self.id' => 1

self is like a reflection to itself.

Very userful if you need the new disjunction:

	User.smql :self => [{:surname => 'Mueller', :givenname => 'Michael'}, {:givenname => 'Horst', :surname => 'Schlemmer'}], :firm => {:name => 'Hotel an der Elbe'}

SmqlToAR::Column
----------------

Rejects every `self`,  so it is really like no self,
but you use `'self'` as like as a simple reflection.
You can ask,  if it is self via Column#self?

SmqlToAR::QueryBuilder
======================

joins:  The old `#join`. Renames because SmqlToAR::And and SmqlToAR::Or which has Array#join,
        so we cannot delegate `#join` to the QueryBuilder.

`#where`
--------

Now only one argument!  Needed for SmqlToAR::And and SmqlToAR::Or.

`#build` will generates LEFT OUTER JOINS now.  Needed for disjunctions.
The most queries will work like before.
Problems:

	User.smql :articles => {}

Before it will return all users with articles,  now it will return also users without articles.
If you want to have only all users with articles,  you ask:

	User.smql :articles => {:id => true}

Will fail if id IS NULL,  but this should not happen. ;)

`SmqlToAR::And` and `SmqlToAR::Or`
==================================

`SmqlToAR::QueryBuilder`-proxies.  QueryBuilder let them build where-clauses.
And will will produce a conjunction and  Or a disjunction of course.
They delegates all QueryBuilder-methods to QueryBuilder.
Only `#where` will stored local and `#build` will do it partial.

They have the same superclass: `SmqlToAR::SubBuilder`.

The small changes
=================

* `SmqlToAR.reload_library`:  Reloads SmqlToAR-lib.  Useful while development.
* `SmqlToAR::ConditionTypes#conditions`:  Return all Conditions.  `#try_parse` uses it.
* Some classes have a new `#inspect`.
* `SmqlToAR::ConditionTypes#Exists` / `NotExists`:
  `{:id => true}` / `{:id => false}`:
  This object has setted an id or not?  `#id` must exists as column of course!
	Uses `IS NOT NULL` and `IS NULL`.
2011-10-05 13:25:56 +02:00
Denis Knauf 93fd3eeda4 pretty_print removed 2011-09-27 16:51:18 +02:00
Denis Knauf db5bbcb93a AR-through-reflections in query_builder; SmqlToAR.models returns the reflections-graph; limit, offset, sub-query "()" (not sub-conditions). unstable 0.3 2011-09-27 16:35:49 +02:00
Denis Knauf 8144c72284 0.0.2: lesser logging; IN-clauses fixed ("table"."table.id"-bug) 2011-09-16 14:55:05 +02:00
Denis Knauf 28fcd2c6ae lesser debug 2011-09-11 12:44:16 +02:00
Denis Knauf b20deed92e v0.0.1 2011-09-11 12:39:51 +02:00
Denis Knauf 967ac14819 logger in Rails fixed 2011-09-11 12:39:13 +02:00
Denis Knauf 553833ded9 readme: translationfixes 2011-09-09 00:05:43 +02:00
Denis Knauf e3df066c3a readme: translationfixes 2011-09-09 00:02:24 +02:00
Denis Knauf c61dbfe31d init 2011-09-08 17:03:52 +02:00