Truncates the entire database and clears the cache.
Warning
This will commit to the database, ALL information stored in the database WILL be lost!
Usage:
# From a model file
>>> web2py_utils.db.RESET(db, cache)
Convenience, cross-database functions that operate on a Rows object.
These are useful if you already have your data queried, and would like to perform these statistics on them, and actually get the record that is associated with this.
Find the MAX column from rows. Returns record, max
Usage:
>>> dogs = db().select(db.dogs.ALL)
>>> oldest_dog, age = web2py_utils.db.DBRowsFunctions.MAX(dogs, 'age')
Find the MIN column from rows. Returns record, min
Usage:
>>> dogs = db().select(db.dogs.ALL)
>>> youngest_dog, age = web2py_utils.db.DBRowsFunctions.MIN(dogs, 'age')
Find the AVG column from rows. Returns avg
Usage:
>>> dogs = db().select(db.dogs.ALL)
>>> average_age = web2py_utils.db.DBRowsFunctions.AVG(dogs, 'age')
Find the SUM column from rows. Returns sum
Usage:
>>> dogs = db().select(db.dogs.ALL)
>>> total_age = web2py_utils.db.DBRowsFunctions.SUM(dogs, 'age')