Permalink
Commits on Mar 30, 2011
  1. Added documentation for integration tests

    Explain how integration tests are run
    paraseba committed Mar 30, 2011
  2. Added update! function

    (update! [this pred record])
    
    Updates a record where pred is true. Record
    is a map from strings or keywords (identifying columns)
    to updated values.
    
    Ex. (update! (table :one) (where (= :id 5)) {:age 22})
    paraseba committed Mar 30, 2011
  3. update-in! accepts only one record

    It was accepting multiple maps, but the implementation was broken.
    It doesn't seem to have much sense to pass multiple maps to update.
    paraseba committed Mar 30, 2011
Commits on Mar 27, 2011
  1. Fixed to-orderlist to not qualify artificial columns.

      (-> (table :continents)
          (sort [(str "distance(location, ST_GeomFromText('SRID=4326;POINT(0 0)'))")]))
    
       "SELECT continents.* FROM continents ORDER BY distance(location, ST_GeomFromText('SRID=4326;POINT(0 0)')) ASC"
    r0man committed Mar 27, 2011
Commits on Mar 24, 2011
  1. Added test to verify that a printed sql without quotes does

    execute correctly.
    
    The form:
    
      (select (table :users) (where (= :title "Dev")))
    
    generates
    
      SELECT users.* FROM users WHERE (users.title = Dev)
    
    but should generate
    
      SELECT users.* FROM users WHERE (users.title = Dev)
    
    Running the query does actually work.
    r0man committed Mar 24, 2011
  2. Bugfix for aliased tables. The ClojureQL form:

      (select (table {:users :developers}) (where (= :title "Dev")))
    
    should generate
    
      SELECT developers.* FROM users developers WHERE (developers.title = Dev)
    
    instead of
    
      SELECT developers.* FROM users developers WHERE (users developers.title = Dev)
    r0man committed Mar 24, 2011
Commits on Mar 22, 2011
  1. Fixed bug in declare-tables

    LauJensen committed Mar 22, 2011
Commits on Mar 17, 2011
Commits on Mar 8, 2011
  1. fixed joins not carrying info through to other joins

    joins should be sorted by dependency on previously joined tables
    
    e.g. this
    
    SELECT * FROM t1
    JOIN t3 ON (t3.c = t2.c)
    JOIN t2 ON (t1.a = t2.a)
    
    is not valid, since t3 cannot be joined to anything on t1, without t2.  Should be
    
    SELECT * FROM t1
    JOIN t2 ON (t1.a = t2.a)
    JOIN t3 ON (t3.c = t2.c)
    l0st3d committed Mar 3, 2011
Commits on Mar 3, 2011
  1. add transform method for modifying results on deref. implement pick u…

    …sing it. add tests for all of this.
    ninjudd committed with ninjudd Mar 1, 2011
Commits on Feb 27, 2011
Commits on Feb 24, 2011
  1. Fixed issue where the order of the environment components was reverse…

    …d for joins
    
    Closes issue 70
    LauJensen committed Feb 24, 2011
Commits on Feb 11, 2011
Commits on Jan 27, 2011
  1. Fixed the compilation for aliased tables so that their names dont get…

    … subselected
    
    (table {:a :b})
    LauJensen committed Jan 27, 2011
Commits on Jan 25, 2011
  1. Added support for select-if.

    clizzin committed Jan 25, 2011
Commits on Jan 21, 2011
  1. conj! now returns the last inserted ID as meta data

    clojureql.core> (meta (conj! (table db :users) {:name "Frank" :title "Dev"}))
    {:last-index 25}
    LauJensen committed Jan 21, 2011
  2. Changed URL in core.clj

    LauJensen committed Jan 21, 2011
Commits on Jan 20, 2011
  1. Added nil? operator

    LauJensen committed Jan 20, 2011
Commits on Jan 17, 2011
  1. Clarify order and semantics of how to connect to database

    Do away with in-connection* in favor of with-cnx, which is now the central point of responsibility for connections.
    Restucture with-cnx so that the order in which different connection methods are tried is clearly visible.
    bendlas committed Jan 17, 2011
Commits on Jan 15, 2011
Commits on Jan 13, 2011
Commits on Jan 12, 2011
  1. Fixed a monstrous bug which caused environments to be dropped between…

    … compile and build-join
    
    Example:
    
    (join (table :t2)
          (-> (table :t1)
          (select (where (= :title "Dev")))
          (aggregate [[:sum/wage :as :sum]] [:id])
          (select (where (<= :sum 50000)))) :id)
    SELECT t2.*,t1_subselect.id,t1_subselect.sum FROM t2 JOIN (SELECT t1.id,sum(t1.wage) AS sum FROM t1 WHERE (t1.title = ?) GROUP BY t1.id HAVING (t1.sum <= ?)) AS t1_subselect USING(id)
    
    Notice how the values for t1.title and t1.sum are questionmarks.
    LauJensen committed Jan 12, 2011
  2. Pushed another fix for qualifying fields in the ORDER BY clause.

    Still, we need to determine if a field is derrived from a subselect and
    if so - we should not qualify it.
    LauJensen committed Jan 12, 2011
  3. If you call select on a table with an aggregate and a group by you au…

    …tomatically get a HAVING clause.
    
    clojureql.core> (-> (table :t1)
                        (select (where (> :id 5)))
                        (aggregate [[:count/* :as :cnt]] [:id])
                        (select (where (> :id 5))))
    
    SELECT t1.id,count(*) AS cnt FROM t1 WHERE (t1.id > 5) GROUP BY t1.id HAVING (t1.id > 5)
    LauJensen committed Jan 12, 2011
  4. Stopped qualifying column names when sorting

    It broke aggregates since they dont belong to any table
    LauJensen committed Jan 12, 2011
Commits on Jan 11, 2011
  1. Predicates now carry information about their columns, such that they …

    …can always be qualified
    LauJensen committed Jan 11, 2011