| Trees | Indices | Help |
|
|---|
|
|
object --+
|
DbConnect
This class is intended to abstract away many of the details of interacting with databases. It includes some GUI functionality
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
Constructor **Arguments** (all optional) - dbName: the name of the DB file to be used - tableName: the name of the table to be used - user: the username for DB access - password: the password to be used for DB access
|
Modifies a connect dialog to reflect new table names **Arguments** - dlg: the dialog to be updated |
gets a list of tables available in a database
**Arguments**
- includeViews: if this is non-null, the views in the db will
also be returned
**Returns**
a list of table names
**Notes**
- this uses _DbInfo.GetTableNames_
|
gets a list of columns available in the current table
**Returns**
a list of column names
**Notes**
- this uses _DbInfo.GetColumnNames_
|
gets a list of columns available in the current table along with their types
**Returns**
a list of 2-tuples containing:
1) column name
2) column type
**Notes**
- this uses _DbInfo.GetColumnNamesAndTypes_
|
gets a set of data from a table
**Arguments**
- fields: a string with the names of the fields to be extracted,
this should be a comma delimited list
**Returns**
a list of the data
**Notes**
- this uses _DbUtils.GetColumns_
|
a more flexible method to get a set of data from a table
**Arguments**
- table: (optional) the table to use
- fields: a string with the names of the fields to be extracted,
this should be a comma delimited list
- where: the SQL where clause to be used with the DB query
- removeDups: indicates which column should be used to recognize
duplicates in the data. -1 for no duplicate removal.
**Returns**
a list of the data
**Notes**
- this uses _DbUtils.GetData_
|
returns a count of the number of results a query will return
**Arguments**
- table: (optional) the table to use
- where: the SQL where clause to be used with the DB query
- join: the SQL join clause to be used with the DB query
**Returns**
an int
**Notes**
- this uses _DbUtils.GetData_
|
returns a cursor for direct manipulation of the DB only one cursor is available |
adds a table to the database **Arguments** - tableName: the name of the table to add - colString: a string containing column defintions **Notes** - if a table named _tableName_ already exists, it will be dropped - the sqlQuery for addition is: "create table %(tableName) (%(colString))" |
inserts data into a table **Arguments** - tableName: the name of the table to manipulate - vals: a sequence with the values to be inserted |
inserts data into a particular column of the table **Arguments** - tableName: the name of the table to manipulate - columnName: name of the column to update - value: the value to insert - where: a query yielding the row where the data should be inserted |
adds a column to a table **Arguments** - tableName: the name of the table to manipulate - colName: name of the column to insert - colType: the type of the column to add |
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Feb 1 16:13:01 2018 | http://epydoc.sourceforge.net |