This project has moved. For the latest updates, please go here.
From Python console you can create scripts to browse schema and manipulate data. First you need to create a Database object, passing the name of the connection entry as a parameter, for example:

db = Database("World")


The object created will have a dynamic property for each Table and View of the database, but before referencing them, make sure the connection is open in the Database Explorer (see Connecting to a Database).

Database class

Represents a database, contains functions to execute commands to it, and expose Tables as dynamic attributes.
  • Constructor. Creates a database object.
    • Parameter database. String with the name of the connection entry in Database Explorer.
  • Query function. Executes a Query in the database and returns an iterator of Row objects.
    • Parameter command. string containing the SQL command text to be executed (see Command Syntax to include parameters).
    • Parameter *values. Arbitrary parameters must be the values for the command text parameters values.
  • NonQuery function. Executes a Command in the database and returns the number of rows affected.
    • Parameter command. string containing the the SQL command text to be executed, (see Command Syntax to include parameters).
    • Parameter *values. Arbitrary parameters must be the values for the command text parameters values.
  • Scalar function. Executes a Query in the database and returns the firsts column of the first row of the result set.
    • Parameter command. string containing the the SQL command text to be executed, (see Command Syntax to include parameters).
    • Parameter *values. Arbitrary parameters must be the values for the command text parameters values.
  • Dynamic attributes. Each table in database is added to the class as a dynamic attribute returning a Table object.

Table class

Represents a table on the database and contains functionality to create, read, update and delete rows through a System.Data.DbDataAdapter object for the table.
  • AutoSaveChanges property. Gets or sets if changes in the Row objects returned by iterators are saved automatically before moving to next Row, default is true.
  • Select function. Returns an iterator of Row objects from the current Table object.
    • Parameter where. Optional string parameter, containing the command text filter.
  • NewRow function. Creates and returns a new Row object.
    • No parameters.
  • Insert function. Add a specified Row to an internal DataTable object and if AutoSaveChanges is set to true saves it to the database.
    • Paramerer row. The Row object to add to the table.
  • Update function. Sets state to Modified to a specified Row to an internal DataTable object and if AutoSaveChanges is set to true saves it to the database.
    • Paramerer row. The Row object to set as modified.
  • Delete function. Deletes a specified Row object from the internal DataTable and if AutoSaveChanges is set to true deletes it from the database.
    • Paramerer row. The Row object to be deleted.
  • Import function. Imports another tables/database Row object to an internal DataTable object and if AutoSaveChanges is set to true saves it to the database.
    • Paramerer row. The Row object to add to the table.
  • ImportAll function. Iterates a Table object and imports all returned Row objects using Import function.
    • Paramerer fromTable. The Table object from which all rows will be imported.
  • SaveChanges function. Updates pending changes contained in internal DataTable object.
    • No parameters.
  • ClearChanges function. Clears changes of internal DataTable object.
    • No parameters.
  • Iterator functionality. Returns an iterator of Row objects from the current Table object.

Row class

Wraps a System.Data.DataRow object to add syntax sugar for accessing values as dynamic attributes.
  • Dynamic attributes. Gets or sets values in internal DataRow object.

Last edited Mar 26, 2016 at 3:47 AM by AlexLE, version 1