Object representation of a single database schema (as per CREATE DATABASE Syntax). Supports equality and inequality comparison of DatabaseSchemas.
name is the database name. parent is an instance of SchemaObject
>>> for db in schema.databases:
... print schema.databases[db].name
...
sakila
>>> schema.databases['sakila'].name
'sakila'
Note
DatabaseSchema objects are automatically created for you by DatabaseSchemaBuilder and loaded under schema.databases
>>> schema.databases['sakila'].alter()
'ALTER DATABASE `sakila`'
>>> schema.databases['sakila'].create()
'CREATE DATABASE `sakila` CHARACTER SET=latin1 COLLATE=latin1_swedish_ci;'
>>> schema.databases['sakila'].drop()
'DROP DATABASE `sakila`;'
Dictionary of the supported MySQL database options. See OptionSchema for usage.
>>> schema.databases['sakila'].select()
'USE `sakila`;'
>>> len(schema.databases['sakila'].tables)
16
Returns a dictionary loaded with all of the databases availale on the MySQL instance. instance must be an instance SchemaObject.
Note
This function is automatically called for you and set to schema.databases when you create an instance of SchemaObject