Option

class schemaobject.option.SchemaOption(name, value=None)
Object representation of a database or table option
>>> schema.databases['sakila'].tables['rental'].options['engine'].name
'ENGINE'
>>> schema.databases['sakila'].tables['rental'].options['engine'].value
'InnoDB'
>>> schema.databases['sakila'].tables['rental'].options['engine'].create()
'ENGINE=InnoDB'
create()
Generate the SQL for this option
>>> schema.databases['sakila'].options['charset'].create()
'CHARSET=latin1'
>>> schema.databases['sakila'].tables['rental'].options['engine'].create()
'ENGINE=InnoDB'
>>> schema.databases['sakila'].tables['rental'].options['auto_increment'].create()
'AUTO_INCREMENT=1'

Previous topic

Foreign Key

This Page