Last page update: November 23, 2011
Main classes:
Other classes:
Exceptions classes:
Complete reference:
there is no public method.
there is no public method.
there is no public method.
Handler for using multi-database
TODO
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
TODO
TODO
| Parameters: |
|
|---|
checks if dbstore exists and if it needs to be aligned
| Parameters: |
|
|---|
TODO
| Parameters: | storename – TODO |
|---|
TODO
TODO
This is the main class of the gnrsql module.
A GnrSqlDb object has the following purposes:
Analyze db
Check if the database structure is compatible with the current model
| Parameters: | applyChanges – boolean. If True, all the changes are executed and committed |
|---|
Clear the current env
Close a connection
Commit a transaction
property .connection
If there’s not connection open and return connection to database
Create a database with a given name and an encoding
| Parameters: |
|
|---|
TODO
Create a database schema
| Parameters: | name – the schema’s name |
|---|
property currentEnv - Return the env currently used in this thread
TODO
TODO
Delete a record from the table
| Parameters: |
|
|---|
Drop a database with a given name
| Parameters: | name – the database’s name |
|---|
Drop a db schema
| Parameters: | name – TODO |
|---|
Dump a database to a given path
| Parameters: | filename – the path on which the database will be dumped |
|---|
Execute the sql statement using given kwargs. Return the sql cursor
| Parameters: |
|
|---|
TODO
Load the model.src extracting it from the database’s information schema.
Populates a database from an XML file
| Parameters: | path – the file path |
|---|
Insert a record in a table
| Parameters: |
|
|---|
Listen for a database event (postgres)
Load the model.src from a XML source
| Parameters: | source – the XML model (diskfile or text or url). |
|---|
property currentEnv - Return the workdate currently used in this thread
Database Notify
| Parameters: |
|
|---|
TODO
Register a mixin for a package.
| Parameters: |
|
|---|
Return a DbModelSrc corresponding to the required package
| Parameters: | name – the package name |
|---|
An sql query
| Parameters: | table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to) |
|---|
TODO
| Parameters: |
|
|---|
Restore db to a given path
| Parameters: | name – the path on which the database will be restored |
|---|
Rollback a transaction
Save the current model in the path as an XML file
| Parameters: | path – the file path |
|---|
TODO
Build the model.obj from the model.src
Return a table object
| Parameters: |
|
|---|
Register an object or a class to mixin to a table.
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
Return a TempEnv class
Get a pickled selection and return it
| Parameters: | fpath – the file path |
|---|
Update a table‘s record
| Parameters: |
|
|---|
Update the currentEnv
TODO
| Parameters: | storename – TODO. |
|---|
TODO
currentEnv TempEnv. Return the workdate used in the current thread
Standard Gnr Sql Base Exception
Standard Gnr Sql Execution Exception
TODO
Example:
with db.tempEnv(foo=7) as db:
# do something
pass