List comprehensions for database requests Background
List comprehensions for database requests Icon

A way to make a request to a database is to write a string with the SQL syntax.

6
Downloads
-
0 Ratings
All Versions
6
Total Downloads
0
Downloads Last Week
Current Version
6
Total Downloads
0
Downloads Last Week
Downloads Last 10 Weeks
All Versions
-
0 Ratings
5
4
3
2
1
Current Version
-
0 Ratings
5
4
3
2
1

List comprehensions for database requestsOverview

The usual way to make a request to a database is to write a String with the SQL syntax, then execute this request and get the result as a list with cursor.fetchall() or cursor.fetchone()

Python has list comprehensions to select items in an iterable if a certain condition is true ; this is very Similar to database requests

This recipe wraps a table of a DB-API compliant database in a class that implements the iteration protocol, so that you can use the for ... in ... if ... syntax

New

Fixed some bugs.

List comprehensions for database requestsTech Specs

Version
1.0
Date
08.26.10
License
Free
Language
English
File Size
1KB
Category
SubCategory
Operating Systems
Windows ,Linux,Mac OS,BSD,Solaris
System Requirements
No additional system requirements.

SelectedFor You

ECG simulation using MATLAB Icon
Premshree Pillai
Improved Gray Scale (IGS) codes are used for the elimination of false
Dendrogram drawing Icon
David Eppstein
This recipe draws a dendrogram (horizontal format used for evolutionary trees)
ProfitSponder Icon
aprofitsponder.com
Makes mailing list management and smart auto responder management drop.
Fast Fourier Transform Icon
Kangas, George
This code implements the O(n log n) Cooley-Tukey FFT algorithm as simply.
Principal Component Analysis (PCA) Icon
Oliver Tomic
A class that carries out Principal Component Analysis (PCA).
Hopcroft-Karp bipartite matching Icon
David Eppstein
A bipartite graph in a variation of Guido van Rossum's dictionary-of-lists forma