File: test/out-py

Recommend this page to a friend!
  Classes of Nikos M.  >  Dialect PHP SQL Query Builder  >  test/out-py  >  Download  
File: test/out-py
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Dialect PHP SQL Query Builder
Build SQL queries from templates
Author: By
Last change: v.1.3.0

* support for UNION [ALL] clause
* getting sql string DOES NOT reset the instance, can call .sql() multiple times
* update examples and tests
Date: 4 months ago
Size: 2,884 bytes
 

Contents

Class file image Download
Dialect.VERSION = 1.3.0

SQL dialect = postgresql

SELECT "t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3","t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3",COUNT("t"."f0") AS "f0","t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3","t"."f1" AS "f11","t"."f1" AS "f111",COUNT(DISTINCT("t"."f1")) AS "f22",COUNT(DISTINCT("t"."f2"))
FROM "t"
INNER JOIN "t2" ON (("t"."id" = "t2"."id"))
WHERE (("t"."f1" = '2')) AND (("t"."f1" = %d:id%) AND ("t"."f1" = %d:id%) OR ("t"."f2" = '3') OR ("t"."f2" = '1'))
LIMIT 100 OFFSET 100

SELECT "t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3"
FROM "t"
WHERE ("t"."f1" = 12)
LIMIT 100 OFFSET 100

SELECT "t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3","t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3"
FROM "t","t"
WHERE ("t"."f1" = 12) AND ("t"."f1" = 12)
LIMIT 100 OFFSET 100

SELECT "t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3","t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3",COUNT("t"."f0") AS "f0","t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3","t"."f1" AS "f11","t"."f1" AS "f111",COUNT(DISTINCT("t"."f1")) AS "f22",COUNT(DISTINCT("t"."f2")),*
FROM "t","table" AS "main"
INNER JOIN "t2" ON (("t"."id" = "t2"."id"))
INNER JOIN "usermeta" AS "usermeta1" ON ("main"."ID"="usermeta1"."user_id")
WHERE (("t"."f1" = '2')) AND (("t"."f1" = %d:id%) AND ("t"."f1" = %d:id%) OR ("t"."f2" = '3') OR ("t"."f2" = '1') AND ("usermeta1"."meta_key" = 'project') AND ("usermeta1"."meta_value" IN (1,2,3)) AND ("main"."name" LIKE %l:name%) AND ("main"."str" = %str%) AND ("main"."year" = 2000) AND (("main"."foo" = ',*,') OR (position(',12,' in "main"."foo") > 0)) AND ("main"."null" IS NULL) AND ("main"."not_null" IS NOT NULL))
ORDER BY "main"."field1" ASC,"main"."field2" ASC
LIMIT 1000 OFFSET 2000

SELECT "t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3","t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3",COUNT("t"."f0") AS "f0","t"."f1" AS "f1","t"."f2" AS "f2","t2"."f3" AS "f3","t"."f1" AS "f11","t"."f1" AS "f111",COUNT(DISTINCT("t"."f1")) AS "f22",COUNT(DISTINCT("t"."f2")),*
FROM "t","table" AS "main"
INNER JOIN "t2" ON (("t"."id" = "t2"."id"))
INNER JOIN "usermeta" AS "usermeta1" ON ("main"."ID"="usermeta1"."user_id")
WHERE (("t"."f1" = '2')) AND (("t"."f1" = '') AND ("t"."f1" = '') OR ("t"."f2" = '3') OR ("t"."f2" = '1') AND ("usermeta1"."meta_key" = 'project') AND ("usermeta1"."meta_value" IN (1,2,3)) AND ("main"."name" LIKE E'%na\%me%') AND ("main"."str" = 'a string') AND ("main"."year" = 2000) AND (("main"."foo" = ',*,') OR (position(',12,' in "main"."foo") > 0)) AND ("main"."null" IS NULL) AND ("main"."not_null" IS NOT NULL))
ORDER BY "main"."field1" ASC,"main"."field2" ASC
LIMIT 1000 OFFSET 2000

(SELECT *
FROM "t1"
LIMIT 10 OFFSET 0)
UNION ALL
(SELECT *
FROM "t2"
LIMIT 5 OFFSET 0)
LIMIT 100 OFFSET 0

SELECT *
FROM "table"
SELECT *
FROM "table"


For more information send a message to info at phpclasses dot org.