sqlobject-cvs Mailing List for SQLObject (Page 42)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sub...@co...> - 2010-12-24 15:55:12
|
Author: phd Date: Fri Dec 24 08:55:02 2010 New Revision: 4316 Log: Some objects must be strings, some only SQLExpression's. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 24 05:58:41 2010 (r4315) +++ SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 24 08:55:02 2010 (r4316) @@ -97,25 +97,24 @@ parameters except `items` are optional. `items`: - A string, an SQLExpression or a sequence of strings or - SQLExpression's, represents the list of columns. If there are - SQLExpression's Select derives a list of tables for SELECT query. + An SQLExpression or a sequence of SQLExpression's, represents the + list of columns. If there are q-values SQLExpression's Select derives + a list of tables for SELECT query. `where`: - A string or an SQLExpression, represents the WHERE clause. + An SQLExpression, represents the WHERE clause. `groupBy`: - A string or an SQLExpression, represents the GROUP BY clause. + An SQLExpression, represents the GROUP BY clause. `having`: - A string or an SQLExpression, represents the HAVING part of the GROUP - BY clause. + An SQLExpression, represents the HAVING part of the GROUP BY clause. `orderBy`: - A string or an SQLExpression, represents the ORDER BY clause. + An SQLExpression, represents the ORDER BY clause. `limit`: - A string or an SQLExpression, represents the LIMIT clause. + An SQLExpression, represents the LIMIT clause. `join`: A (list of) JOINs (LEFT JOIN, etc.) @@ -187,7 +186,7 @@ A dictionary {key: value}; keys are column names. Required. `where`: - An optional string or an SQLExpression, represents the WHERE clause. + An optional SQLExpression, represents the WHERE clause. Example:: @@ -207,9 +206,9 @@ A string that names the table to UPDATE. Required. `where`: - A string or an SQLExpression, represents the WHERE clause. Required. - If you need to delete all rows pass ``where=None``; this is a safety - measure. + An optional string or an SQLExpression, represents the WHERE clause. + Required. If you need to delete all rows pass ``where=None``; this is + a safety measure. Example:: |
From: <sub...@co...> - 2010-12-24 12:58:48
|
Author: phd Date: Fri Dec 24 05:58:41 2010 New Revision: 4315 Log: Documented required and optional parameters. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 24 05:55:32 2010 (r4314) +++ SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 24 05:58:41 2010 (r4315) @@ -145,7 +145,7 @@ Use connection.query(query) to execute the query. `table`: - A string that names the table to INSERT into. + A string that names the table to INSERT into. Required. `valueList`: A list of (key, value) sequences or {key: value} dictionaries; keys @@ -181,13 +181,13 @@ Use connection.query(query) to execute the query. `table`: - A string that names the table to UPDATE. + A string that names the table to UPDATE. Required. `values`: - A dictionary {key: value}; keys are column names. + A dictionary {key: value}; keys are column names. Required. `where`: - A string or an SQLExpression, represents the WHERE clause. + An optional string or an SQLExpression, represents the WHERE clause. Example:: @@ -204,10 +204,12 @@ Use connection.query(query) to execute the query. `table`: - A string that names the table to UPDATE. + A string that names the table to UPDATE. Required. `where`: - A string or an SQLExpression, represents the WHERE clause. + A string or an SQLExpression, represents the WHERE clause. Required. + If you need to delete all rows pass ``where=None``; this is a safety + measure. Example:: |
From: <sub...@co...> - 2010-12-24 12:55:40
|
Author: phd Date: Fri Dec 24 05:55:32 2010 New Revision: 4314 Log: Documented Delete. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 24 05:51:52 2010 (r4313) +++ SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 24 05:55:32 2010 (r4314) @@ -197,6 +197,25 @@ # UPDATE person SET name='Test', age=42 WHERE id=1 >> connection.query(query) +Delete +~~~~~~ + +A class to build DELETE FROM queries. Accepts a number of parameters. +Use connection.query(query) to execute the query. + +`table`: + A string that names the table to UPDATE. + +`where`: + A string or an SQLExpression, represents the WHERE clause. + +Example:: + + >> update = Delete('person', where='id=1') + >> query = connection.sqlrepr(update) + # DELETE FROM person WHERE id=1 + >> connection.query(query) + Nested SQL statements (subqueries) ================================== |
From: <sub...@co...> - 2010-12-24 12:52:01
|
Author: phd Date: Fri Dec 24 05:51:52 2010 New Revision: 4313 Log: `items` is a required parameter. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 22 04:19:00 2010 (r4312) +++ SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 24 05:51:52 2010 (r4313) @@ -94,7 +94,7 @@ ~~~~~~ A class to build SELECT queries. Accepts a number of parameters, all -parameters are optional. +parameters except `items` are optional. `items`: A string, an SQLExpression or a sequence of strings or |
From: <sub...@co...> - 2010-12-22 11:19:07
|
Author: phd Date: Wed Dec 22 04:19:00 2010 New Revision: 4312 Log: Merged revision 4310 from branch 0.14: changed my online identity. Modified: SQLObject/trunk/docs/Authors.txt SQLObject/trunk/sqlobject/main.py Modified: SQLObject/trunk/docs/Authors.txt ============================================================================== --- SQLObject/trunk/docs/Authors.txt Wed Dec 22 04:18:05 2010 (r4311) +++ SQLObject/trunk/docs/Authors.txt Wed Dec 22 04:19:00 2010 (r4312) @@ -24,7 +24,7 @@ * Christopher Singley <csingley at gmail.com> * David Keeney <dkeeney at rdbhost.com> * Daniel Fetchinson <fetchinson at googlemail.com> -* Oleg Broytman <ph...@ph...> +* Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject Modified: SQLObject/trunk/sqlobject/main.py ============================================================================== --- SQLObject/trunk/sqlobject/main.py Wed Dec 22 04:18:05 2010 (r4311) +++ SQLObject/trunk/sqlobject/main.py Wed Dec 22 04:19:00 2010 (r4312) @@ -7,7 +7,7 @@ SQLObject is a object-relational mapper. See SQLObject.html or SQLObject.txt for more. -With the help by Oleg Broytman <ph...@ph...> and many other contributors. +With the help by Oleg Broytman and many other contributors. See Authors.txt. This program is free software; you can redistribute it and/or modify |
From: <sub...@co...> - 2010-12-22 11:18:12
|
Author: phd Date: Wed Dec 22 04:18:05 2010 New Revision: 4311 Log: Merged revision 4310 from branch 0.14: changed my online identity. Modified: SQLObject/branches/0.15/docs/Authors.txt SQLObject/branches/0.15/sqlobject/main.py Modified: SQLObject/branches/0.15/docs/Authors.txt ============================================================================== --- SQLObject/branches/0.15/docs/Authors.txt Wed Dec 22 04:16:20 2010 (r4310) +++ SQLObject/branches/0.15/docs/Authors.txt Wed Dec 22 04:18:05 2010 (r4311) @@ -23,7 +23,7 @@ * Diez B. Roggisch <deets at web.de> * Christopher Singley <csingley at gmail.com> * David Keeney <dkeeney at rdbhost.com> -* Oleg Broytman <ph...@ph...> +* Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject Modified: SQLObject/branches/0.15/sqlobject/main.py ============================================================================== --- SQLObject/branches/0.15/sqlobject/main.py Wed Dec 22 04:16:20 2010 (r4310) +++ SQLObject/branches/0.15/sqlobject/main.py Wed Dec 22 04:18:05 2010 (r4311) @@ -7,7 +7,7 @@ SQLObject is a object-relational mapper. See SQLObject.html or SQLObject.txt for more. -With the help by Oleg Broytman <ph...@ph...> and many other contributors. +With the help by Oleg Broytman and many other contributors. See Authors.txt. This program is free software; you can redistribute it and/or modify |
From: <sub...@co...> - 2010-12-22 11:16:31
|
Author: phd Date: Wed Dec 22 04:16:20 2010 New Revision: 4310 Log: Changed my online identity. Modified: SQLObject/branches/0.14/docs/Authors.txt SQLObject/branches/0.14/sqlobject/main.py Modified: SQLObject/branches/0.14/docs/Authors.txt ============================================================================== --- SQLObject/branches/0.14/docs/Authors.txt Fri Dec 17 08:22:32 2010 (r4309) +++ SQLObject/branches/0.14/docs/Authors.txt Wed Dec 22 04:16:20 2010 (r4310) @@ -23,7 +23,7 @@ * Diez B. Roggisch <deets at web.de> * Christopher Singley <csingley at gmail.com> * David Keeney <dkeeney at rdbhost.com> -* Oleg Broytman <ph...@ph...> +* Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject Modified: SQLObject/branches/0.14/sqlobject/main.py ============================================================================== --- SQLObject/branches/0.14/sqlobject/main.py Fri Dec 17 08:22:32 2010 (r4309) +++ SQLObject/branches/0.14/sqlobject/main.py Wed Dec 22 04:16:20 2010 (r4310) @@ -7,7 +7,7 @@ SQLObject is a object-relational mapper. See SQLObject.html or SQLObject.txt for more. -With the help by Oleg Broytman <ph...@ph...> and many other contributors. +With the help by Oleg Broytman and many other contributors. See Authors.txt. This program is free software; you can redistribute it and/or modify |
From: <sub...@co...> - 2010-12-17 15:22:40
|
Author: phd Date: Fri Dec 17 08:22:32 2010 New Revision: 4309 Log: Fixed a copy/paste mistake. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 17 08:17:44 2010 (r4308) +++ SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 17 08:22:32 2010 (r4309) @@ -181,7 +181,7 @@ Use connection.query(query) to execute the query. `table`: - A string that names the table to INSERT into. + A string that names the table to UPDATE. `values`: A dictionary {key: value}; keys are column names. |
From: <sub...@co...> - 2010-12-17 15:17:52
|
Author: phd Date: Fri Dec 17 08:17:44 2010 New Revision: 4308 Log: Documented Update. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Thu Dec 16 20:05:14 2010 (r4307) +++ SQLObject/trunk/docs/SQLBuilder.txt Fri Dec 17 08:17:44 2010 (r4308) @@ -155,9 +155,9 @@ >> insert = Insert('person', valueList=[('name', 'Test'), ('age', 42)]) # or >> insert = Insert('person', valueList=[{'name': 'Test'}, {'age': 42}]) + >> query = connection.sqlrepr(insert) # Both generate the same query: # INSERT INTO person (name, age) VALUES ('Test', 42) - >> query = connection.sqlrepr(insert) >> connection.query(query) `values`: @@ -165,15 +165,38 @@ or `values` must be passed, but not both. Example:: >> insert = Insert('person', values={'name': 'Test', 'age': 42}) + >> query = connection.sqlrepr(insert) # The query is the same # INSERT INTO person (name, age) VALUES ('Test', 42) - >> query = connection.sqlrepr(insert) >> connection.query(query) Instances of the class work fast and thus are suitable for mass-insertion. If one needs to populate a database with SQLObject running a lot of INSERT queries this class is the way to go. +Update +~~~~~~ + +A class to build UPDATE queries. Accepts a number of parameters. +Use connection.query(query) to execute the query. + +`table`: + A string that names the table to INSERT into. + +`values`: + A dictionary {key: value}; keys are column names. + +`where`: + A string or an SQLExpression, represents the WHERE clause. + +Example:: + + >> update = Update('person', + >> values={'name': 'Test', 'age': 42}, where='id=1') + >> query = connection.sqlrepr(update) + # UPDATE person SET name='Test', age=42 WHERE id=1 + >> connection.query(query) + Nested SQL statements (subqueries) ================================== |
From: <sub...@co...> - 2010-12-17 03:14:20
|
Author: phd Date: Thu Dec 16 19:43:02 2010 New Revision: 4306 Log: Documented Insert. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Thu Dec 16 02:45:23 2010 (r4305) +++ SQLObject/trunk/docs/SQLBuilder.txt Thu Dec 16 19:43:02 2010 (r4306) @@ -136,13 +136,37 @@ This parameter must be used if `items` is a list of strings from which Select cannot derive a list of tables. -.. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 - :target: http://sourceforge.net/projects/sqlobject - :class: noborder - :align: center - :height: 15 - :width: 80 - :alt: Get SQLObject at SourceForge.net. Fast, secure and Free Open Source software downloads +Insert +~~~~~~ + +A class to build INSERT queries. Accepts a number of parameters. +Use connection.query(query) to execute the query. + +`table`: + A string that names the table to INSERT into. + +`valueList`: + A list of (key, value) sequences or {key: value} dictionaries; keys + are column names. Either `valueList` or `values` must be passed, but + not both. Example:: + + >> insert = Insert('person', valueList=[('name', 'Test'), ('age', 42)]) + # or + >> insert = Insert('person', valueList=[{'name': 'Test'}, {'age': 42}]) + # Both generate the same query: + # INSERT INTO person (name, age) VALUES ('Test', 42) + >> query = connection.sqlrepr(insert) + >> connection.query(query) + +`values`: + A dictionary {key: value}; keys are column names. Either `valueList` + or `values` must be passed, but not both. Example:: + + >> insert = Insert('person', values={'name': 'Test', 'age': 42}) + # The query is the same + # INSERT INTO person (name, age) VALUES ('Test', 42) + >> query = connection.sqlrepr(insert) + >> connection.query(query) Nested SQL statements (subqueries) ================================== @@ -165,3 +189,11 @@ >> PersonWorkplace.deleteMany(where= IN(PersonWorkplace.q.WorkplaceID, Select(Workplace.q.id, Workplace.q.id==SOME_ID))) + +.. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 + :target: http://sourceforge.net/projects/sqlobject + :class: noborder + :align: center + :height: 15 + :width: 80 + :alt: Get SQLObject at SourceForge.net. Fast, secure and Free Open Source software downloads |
From: <sub...@co...> - 2010-12-17 03:05:26
|
Author: phd Date: Thu Dec 16 20:05:14 2010 New Revision: 4307 Log: Fast mass-insertion using sqlbuilder.Insert. Modified: SQLObject/trunk/docs/FAQ.txt SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/FAQ.txt ============================================================================== --- SQLObject/trunk/docs/FAQ.txt Thu Dec 16 19:43:02 2010 (r4306) +++ SQLObject/trunk/docs/FAQ.txt Thu Dec 16 20:05:14 2010 (r4307) @@ -551,6 +551,22 @@ You can use a lower-level machinery available in SQLBuilder_. +How to do mass-insertion? +------------------------- + +Mass-insertion using high-level API in SQLObject is slow. There are many +reasons for that. First, on creation SQLObject instances pass all values +through validators/converters which is convenient but takes time. +Second, after an INSERT query SQLObject executes a SELECT query to get +back autogenerated values (id and timestamps). Third, there is caching +and cache maintaining. Most of this is unnecessary for mass-insertion, +hence high-level API is unsuitable. + +Less convenient (no validators) but much faster API is Insert_ from +SQLBuilder_. + +.. _Insert: SQLBuilder.html#insert + How can I specify the MySQL engine to use, or tweak other SQL-engine specific features? --------------------------------------------------------------------------------------- Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Thu Dec 16 19:43:02 2010 (r4306) +++ SQLObject/trunk/docs/SQLBuilder.txt Thu Dec 16 20:05:14 2010 (r4307) @@ -2,6 +2,8 @@ SQLBuilder `````````` +.. contents:: + A number of variables from SQLBuilder are included with ``from sqlobject import *`` -- see the `relevant SQLObject documentation`_ for more. Its functionality is also available through the special @@ -168,6 +170,10 @@ >> query = connection.sqlrepr(insert) >> connection.query(query) +Instances of the class work fast and thus are suitable for +mass-insertion. If one needs to populate a database with SQLObject +running a lot of INSERT queries this class is the way to go. + Nested SQL statements (subqueries) ================================== |
From: <sub...@co...> - 2010-12-16 09:45:32
|
Author: phd Date: Thu Dec 16 02:45:23 2010 New Revision: 4305 Log: Added a section written by Imri Goldberg. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 20:11:38 2010 (r4304) +++ SQLObject/trunk/docs/SQLBuilder.txt Thu Dec 16 02:45:23 2010 (r4305) @@ -143,3 +143,25 @@ :height: 15 :width: 80 :alt: Get SQLObject at SourceForge.net. Fast, secure and Free Open Source software downloads + +Nested SQL statements (subqueries) +================================== + +There are a few special operators that receive as parameter SQL +statements. These are IN, NOTIN, EXISTS, NOTEXISTS, SOME, ANY and ALL. +Consider the following example: You are interested in removing records +from a table using deleteMany. However, the criterion for doing so +depends on another table. + +You would expect the following to work:: + + >> PersonWorkplace.deleteMany(where= + ((PersonWorkplace.q.WorkplaceID==Workplace.q.id) & + (Workplace.q.id==SOME_ID))) + +But this doesn't work! However, you can't do a join in a deleteMany +call. To work around this issue, use IN:: + + >> PersonWorkplace.deleteMany(where= + IN(PersonWorkplace.q.WorkplaceID, + Select(Workplace.q.id, Workplace.q.id==SOME_ID))) |
From: <sub...@co...> - 2010-12-16 03:11:46
|
Author: phd Date: Wed Dec 15 20:11:38 2010 New Revision: 4304 Log: Hide email from spam robots. Modified: SQLObject/trunk/docs/Authors.txt Modified: SQLObject/trunk/docs/Authors.txt ============================================================================== --- SQLObject/trunk/docs/Authors.txt Wed Dec 15 16:00:59 2010 (r4303) +++ SQLObject/trunk/docs/Authors.txt Wed Dec 15 20:11:38 2010 (r4304) @@ -23,7 +23,7 @@ * Diez B. Roggisch <deets at web.de> * Christopher Singley <csingley at gmail.com> * David Keeney <dkeeney at rdbhost.com> -* Daniel Fetchinson <fet...@go...> +* Daniel Fetchinson <fetchinson at googlemail.com> * Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 |
From: <sub...@co...> - 2010-12-15 23:01:06
|
Author: phd Date: Wed Dec 15 16:00:59 2010 New Revision: 4303 Log: Corrected a misspelling. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 15:48:51 2010 (r4302) +++ SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 16:00:59 2010 (r4303) @@ -83,7 +83,7 @@ >> query = connection.sqlrepr(select) # Convert to SQL string: >> # SELECT name, AVG(salary) FROM employees GROUP BY name >> rows = connection.queryAll(query) # Execute the query - >> # and get back the reuslt as a list of rows + >> # and get back the result as a list of rows >> # where every row is a sequence of length 2 (name and average salary) .. _`higher-level API`: SQLObject.html |
From: <sub...@co...> - 2010-12-15 22:49:00
|
Author: phd Date: Wed Dec 15 15:48:51 2010 New Revision: 4302 Log: Grammar corrections by Daniel Fetchinson. Modified: SQLObject/trunk/docs/Authors.txt SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/Authors.txt ============================================================================== --- SQLObject/trunk/docs/Authors.txt Wed Dec 15 14:06:08 2010 (r4301) +++ SQLObject/trunk/docs/Authors.txt Wed Dec 15 15:48:51 2010 (r4302) @@ -23,6 +23,7 @@ * Diez B. Roggisch <deets at web.de> * Christopher Singley <csingley at gmail.com> * David Keeney <dkeeney at rdbhost.com> +* Daniel Fetchinson <fet...@go...> * Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 14:06:08 2010 (r4301) +++ SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 15:48:51 2010 (r4302) @@ -16,9 +16,9 @@ expressions build SQL expressions -- so long as you start with a Magic Object that knows how to fake it. -With SQLObject, you get a Magic Object by access the ``q`` attribute +With SQLObject, you get a Magic Object by accessing the ``q`` attribute of a table class -- this gives you an object that represents the -field. Maybe explanations aren't as good. Here's some examples:: +field. All of this is probably easier to grasp in an example:: >>> from sqlobject.sqlbuilder import * >>> person = table.person @@ -52,13 +52,13 @@ also work -- I find these easier to work with. ``AND`` and ``OR`` can take any number of arguments. -You can also use ``.startswith()`` and ``.endswith()`` on a SQL +You can also use ``.startswith()`` and ``.endswith()`` on an SQL expression -- these will translate to appropriate ``LIKE`` statements -(but all ``%`` quoting is handled for you, so you can ignore that -implementation detail). There is also a ``LIKE`` function, where you +and all ``%`` quoting is handled for you, so you can ignore that +implementation detail. There is also a ``LIKE`` function, where you can pass your string, with ``%`` for the wildcard, as usual. -If you want to access a SQL function, use the ``func`` variable, +If you want to access an SQL function, use the ``func`` variable, like:: >> person.created < func.NOW() @@ -71,7 +71,7 @@ SQLBuilder implements objects that execute SQL statements. SQLObject uses them internally in its `higher-level API`_, but users can use this -mid-level API to executes SQL queries that aren't supported by the +mid-level API to execute SQL queries that are not supported by the high-level API. To use these objects first construct an instance of a statement object, then ask the connection to convert the instance to an SQL query and finally ask the connection to execute the query and return |
From: <sub...@co...> - 2010-12-15 21:14:20
|
Author: phd Date: Wed Dec 15 13:32:33 2010 New Revision: 4300 Log: Started to document SQLBuilder's public API. First, SQL statements. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 13:09:56 2010 (r4299) +++ SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 13:32:33 2010 (r4300) @@ -66,6 +66,31 @@ To pass a constant, use the ``const`` variable which is actually an alias for func. +SQL statements +============== + +SQLBuilder implements objects that execute SQL statements. SQLObject +uses them internally in its `higher-level API`_, but users can use this +mid-level API to executes SQL queries that aren't supported by the +high-level API. To use these objects first construct an instance of a +statement object, then ask the connection to convert the instance to an +SQL query and finally ask the connection to execute the query and return +the results. For example, for Select class:: + + >>> from sqlobject.sqlbuilder import * + >> select = Select(['name', 'AVG(salary)'], staticTables=['employees'], + >> groupBy='name') # create an instance + >> query = connection.sqlrepr(select) # Convert to SQL string: + >> # SELECT name, AVG(salary) FROM employees GROUP BY name + >> rows = connection.queryAll(query) # Execute the query + >> # and get back the reuslt as a list of rows + >> # where every row is a sequence of length 2 (name and average salary) + +.. _`higher-level API`: SQLObject.html + +Select +~~~~~~ + .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject :class: noborder |
From: <sub...@co...> - 2010-12-15 21:06:15
|
Author: phd Date: Wed Dec 15 14:06:08 2010 New Revision: 4301 Log: Described parameters for Select(). Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 13:32:33 2010 (r4300) +++ SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 14:06:08 2010 (r4301) @@ -91,6 +91,51 @@ Select ~~~~~~ +A class to build SELECT queries. Accepts a number of parameters, all +parameters are optional. + +`items`: + A string, an SQLExpression or a sequence of strings or + SQLExpression's, represents the list of columns. If there are + SQLExpression's Select derives a list of tables for SELECT query. + +`where`: + A string or an SQLExpression, represents the WHERE clause. + +`groupBy`: + A string or an SQLExpression, represents the GROUP BY clause. + +`having`: + A string or an SQLExpression, represents the HAVING part of the GROUP + BY clause. + +`orderBy`: + A string or an SQLExpression, represents the ORDER BY clause. + +`limit`: + A string or an SQLExpression, represents the LIMIT clause. + +`join`: + A (list of) JOINs (LEFT JOIN, etc.) + +`distinct`: + A bool flag to turn on DISTINCT query. + +`start`, `end`: + Integers. Alternative ways to calculate LIMIT. `limit`, if passed, + overrides `end`. + +`reversed`: + A bool flag to do sorting (ORDER BY) in the reverse direction. + +`forUpdate`: + A bool flag to turn on SELECT FOR UPDATE query. + +`staticTables`: + A sequence of strings or SQLExpression's that name tables for FROM. + This parameter must be used if `items` is a list of strings from + which Select cannot derive a list of tables. + .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject :class: noborder |
From: <sub...@co...> - 2010-12-15 20:14:20
|
Author: phd Date: Wed Dec 15 12:55:59 2010 New Revision: 4298 Log: Merged revision 4296 from branch 0.14: LEFT JOINs were implemented long ago. Modified: SQLObject/trunk/sqlobject/sqlbuilder.py Modified: SQLObject/trunk/sqlobject/sqlbuilder.py ============================================================================== --- SQLObject/trunk/sqlobject/sqlbuilder.py Wed Dec 15 12:55:34 2010 (r4297) +++ SQLObject/trunk/sqlobject/sqlbuilder.py Wed Dec 15 12:55:59 2010 (r4298) @@ -49,9 +49,7 @@ types (None==NULL). There are a number of DB-specific SQL features that this does not -implement. There are a bunch of normal ANSI features also not present --- particularly left joins, among others. You may wish to only use -this to generate ``WHERE`` clauses. +implement. There are a bunch of normal ANSI features also not present. See the bottom of this module for some examples, and run it (i.e. ``python sql.py``) to see the results of those examples. |
From: <sub...@co...> - 2010-12-15 20:10:02
|
Author: phd Date: Wed Dec 15 13:09:56 2010 New Revision: 4299 Log: SQLBuilder needs more and better documentation. Modified: SQLObject/trunk/docs/SQLBuilder.txt Modified: SQLObject/trunk/docs/SQLBuilder.txt ============================================================================== --- SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 12:55:59 2010 (r4298) +++ SQLObject/trunk/docs/SQLBuilder.txt Wed Dec 15 13:09:56 2010 (r4299) @@ -9,10 +9,10 @@ .. _`relevant SQLObject documentation`: SQLObject.html#exported-symbols -Using SQLBuilder -================ +SQLExpression +============= -SQLBuilder uses clever overriding of operators to make Python +SQLExpression uses clever overriding of operators to make Python expressions build SQL expressions -- so long as you start with a Magic Object that knows how to fake it. @@ -63,7 +63,8 @@ >> person.created < func.NOW() -That's it -- enjoy! +To pass a constant, use the ``const`` variable which is actually an +alias for func. .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject |
From: <sub...@co...> - 2010-12-15 19:55:41
|
Author: phd Date: Wed Dec 15 12:55:34 2010 New Revision: 4297 Log: Merged revision 4296 from branch 0.14: LEFT JOINs were implemented long ago. Modified: SQLObject/branches/0.15/sqlobject/sqlbuilder.py Modified: SQLObject/branches/0.15/sqlobject/sqlbuilder.py ============================================================================== --- SQLObject/branches/0.15/sqlobject/sqlbuilder.py Wed Dec 15 12:53:56 2010 (r4296) +++ SQLObject/branches/0.15/sqlobject/sqlbuilder.py Wed Dec 15 12:55:34 2010 (r4297) @@ -49,9 +49,7 @@ types (None==NULL). There are a number of DB-specific SQL features that this does not -implement. There are a bunch of normal ANSI features also not present --- particularly left joins, among others. You may wish to only use -this to generate ``WHERE`` clauses. +implement. There are a bunch of normal ANSI features also not present. See the bottom of this module for some examples, and run it (i.e. ``python sql.py``) to see the results of those examples. |
From: <sub...@co...> - 2010-12-15 19:54:04
|
Author: phd Date: Wed Dec 15 12:53:56 2010 New Revision: 4296 Log: LEFT JOINs were implemented long ago. Modified: SQLObject/branches/0.14/sqlobject/sqlbuilder.py Modified: SQLObject/branches/0.14/sqlobject/sqlbuilder.py ============================================================================== --- SQLObject/branches/0.14/sqlobject/sqlbuilder.py Tue Dec 7 06:13:24 2010 (r4295) +++ SQLObject/branches/0.14/sqlobject/sqlbuilder.py Wed Dec 15 12:53:56 2010 (r4296) @@ -49,9 +49,7 @@ types (None==NULL). There are a number of DB-specific SQL features that this does not -implement. There are a bunch of normal ANSI features also not present --- particularly left joins, among others. You may wish to only use -this to generate ``WHERE`` clauses. +implement. There are a bunch of normal ANSI features also not present. See the bottom of this module for some examples, and run it (i.e. ``python sql.py``) to see the results of those examples. |
From: <sub...@co...> - 2010-12-07 13:13:33
|
Author: phd Date: Tue Dec 7 06:13:24 2010 New Revision: 4295 Log: Fixed URLs. Modified: SQLObject/branches/0.15/setup.py Modified: SQLObject/branches/0.15/setup.py ============================================================================== --- SQLObject/branches/0.15/setup.py Tue Dec 7 06:12:20 2010 (r4294) +++ SQLObject/branches/0.15/setup.py Tue Dec 7 06:13:24 2010 (r4295) @@ -35,7 +35,7 @@ Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB). For development see the `subversion repository -<http://svn.colorstudy.com/SQLObject/trunk#egg=SQLObject-0.16dev>`_ +<http://svn.colorstudy.com/SQLObject/branches/0.15>`_ """, classifiers=[ "Development Status :: 5 - Production/Stable", @@ -48,7 +48,7 @@ ], author="Ian Bicking", author_email="ia...@co...", - url="http://sqlobject.org/devel/", + url="http://sqlobject.org/", download_url="http://cheeseshop.python.org/pypi/SQLObject/0.15", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], |
From: <sub...@co...> - 2010-12-07 13:12:31
|
Author: phd Date: Tue Dec 7 06:12:20 2010 New Revision: 4294 Log: Fixed URL. Modified: SQLObject/branches/0.14/setup.py Modified: SQLObject/branches/0.14/setup.py ============================================================================== --- SQLObject/branches/0.14/setup.py Mon Dec 6 08:16:37 2010 (r4293) +++ SQLObject/branches/0.14/setup.py Tue Dec 7 06:12:20 2010 (r4294) @@ -48,7 +48,7 @@ ], author="Ian Bicking", author_email="ia...@co...", - url="http://sqlobject.org/devel/", + url="http://sqlobject.org/", download_url="http://cheeseshop.python.org/pypi/SQLObject/0.14", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], |
From: SourceForge.net <no...@so...> - 2010-12-07 12:19:16
|
Patches item #3131373, was opened at 2010-12-07 12:19 Message generated for change (Tracker Item Submitted) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=3131373&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Widget (example) Group: Unstable (example) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: qxjuuav Initial Comment: fophfpi <a href="http://efhddkz.com">efhddkz</a> [url=http://fgawcri.com]fgawcri[/url] http://oghagsf.com ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=3131373&group_id=74338 |
From: <sub...@co...> - 2010-12-06 15:16:45
|
Author: phd Date: Mon Dec 6 08:16:37 2010 New Revision: 4293 Log: Stable version 0.15.0. Modified: SQLObject/tags/0.15.0/README.txt SQLObject/tags/0.15.0/setup.cfg SQLObject/tags/0.15.0/setup.py SQLObject/tags/0.15.0/sqlobject/__init__.py SQLObject/tags/0.15.0/sqlobject/main.py Modified: SQLObject/tags/0.15.0/README.txt ============================================================================== --- SQLObject/tags/0.15.0/README.txt Mon Dec 6 08:14:22 2010 (r4292) +++ SQLObject/tags/0.15.0/README.txt Mon Dec 6 08:16:37 2010 (r4293) @@ -1,5 +1,5 @@ -SQLObject 0.15 -============== +SQLObject 0.15.0 +================ Thanks for looking at SQLObject. SQLObject is an object-relational mapper, i.e., a library that will wrap your database tables in Python Modified: SQLObject/tags/0.15.0/setup.cfg ============================================================================== --- SQLObject/tags/0.15.0/setup.cfg Mon Dec 6 08:14:22 2010 (r4292) +++ SQLObject/tags/0.15.0/setup.cfg Mon Dec 6 08:16:37 2010 (r4293) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/0.15.0/setup.py ============================================================================== --- SQLObject/tags/0.15.0/setup.py Mon Dec 6 08:14:22 2010 (r4292) +++ SQLObject/tags/0.15.0/setup.py Mon Dec 6 08:16:37 2010 (r4293) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.15", + version="0.15.0", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -49,7 +49,7 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org/devel/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.15", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.15.0", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.15.0/sqlobject/__init__.py ============================================================================== --- SQLObject/tags/0.15.0/sqlobject/__init__.py Mon Dec 6 08:14:22 2010 (r4292) +++ SQLObject/tags/0.15.0/sqlobject/__init__.py Mon Dec 6 08:16:37 2010 (r4293) @@ -1,5 +1,5 @@ """ -SQLObject 0.15 +SQLObject 0.15.0 """ from col import * Modified: SQLObject/tags/0.15.0/sqlobject/main.py ============================================================================== --- SQLObject/tags/0.15.0/sqlobject/main.py Mon Dec 6 08:14:22 2010 (r4292) +++ SQLObject/tags/0.15.0/sqlobject/main.py Mon Dec 6 08:16:37 2010 (r4293) @@ -1,6 +1,6 @@ """ -SQLObject 0.15 --------------- +SQLObject 0.15.0 +---------------- :author: Ian Bicking <ia...@co...> |