From 40960a8eb788c9442a2cf0630508849a2e2735a6 Mon Sep 17 00:00:00 2001 From: Portnov Date: Mon, 27 Jul 2009 13:57:32 +0600 Subject: [PATCH] Some docs --- Framework/ORM/SQL.hs | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/Framework/ORM/SQL.hs b/Framework/ORM/SQL.hs index 9086509..58c9c04 100644 --- a/Framework/ORM/SQL.hs +++ b/Framework/ORM/SQL.hs @@ -52,11 +52,14 @@ sql' (UpdateQuery table fields values whre) = "UPDATE "++table++" SET "++eqs++wp sql' (DelQuery table whre) = "DELETE FROM "++table++wpart where wpart = if whre==NoCondition then "" else " WHERE "++(sqlFragment whre) +-- | Get list of SqlValue's, given in query +getParameters :: Query -> [SqlValue] getParameters (Query {qWhere=conds}) = params conds getParameters (UpdateQuery {uWhere=conds}) = params conds getParameters (DelQuery {dWhere=conds}) = params conds getParameters _ = [] +params :: SQLCondition -> [SqlValue] params (c :&: d) = concatMap params [c,d] params (c :|: d) = concatMap params [c,d] params (a :==: b) = appendValues a b -- 1.7.2.3