Skip to content

Commit b0815c3

Browse files
committed
Added an example to the Query#query() function.
1 parent ce54613 commit b0815c3

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

doc/DatabaseLibrary.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ <h2>Keywords</h2>
148148
<td class="arg">selectStatement</td>
149149
<td class="doc">Uses the input <span class="name">selectStatement</span> to query for the values that will be returned as a list of tuples.<br />
150150
<br />
151-
Tip: try specifying the column names in your select statements much as possible to prevent any unnecessary surprises with schema changes and to easily see what your [] indexing is trying to retrieve.</td>
151+
Tip: try specifying the column names in your select statements as much as possible to prevent any unnecessary surprises with schema changes and to easily see what your [] indexing is trying to retrieve (i.e. instead of <span class="name">"select * from my_table"</span>, try <span class="name">"select id, col_1, col_2 from my_table"</span>).</td>
152152
</tr>
153153
</table>
154154
<p id="footer">
155155
Altogether 4 keywords.<br />
156156
Generated by <a href="http://code.google.com/p/robotframework/wiki/LibraryDocumentationTool">libdoc.py</a>
157-
on 2010-11-28 12:05:37.
157+
on 2010-11-28 12:08:28.
158158
</p>
159159
</body>
160160
</html>

src/DatabaseLibrary/query.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ def query(self, selectStatement):
2222
will be returned as a list of tuples.
2323
2424
Tip: try specifying the column names in your select statements
25-
much as possible to prevent any unnecessary surprises with schema
26-
changes and to easily see what your [] indexing is trying to retrieve.
25+
as much as possible to prevent any unnecessary surprises with schema
26+
changes and to easily see what your [] indexing is trying to retrieve
27+
(i.e. instead of `"select * from my_table"`, try
28+
`"select id, col_1, col_2 from my_table"`).
2729
"""
2830
cur = self._dbconnection.cursor()
2931
cur.execute (selectStatement);

src/DatabaseLibrary/query.pyc

257 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)