Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mitch
committed
Nov 10, 2009
1 parent
405ab0a
commit 66f9bfa
Showing
48 changed files
with
1,136 additions
and
586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
== 0.5.1 / 2009-10-10 | ||
* bug fixes | ||
* updated test configuration, added more tests | ||
* added ability to retrieve comments on columns | ||
* updated collections.orderedDict | ||
- added support for index(), insert() and __delitem__() | ||
* changed output of database options | ||
- CHARSET is now CHARACTER SET | ||
- <key> <value> is now <key>=<value> | ||
* newlines and multiple spaces removed from table.create() string | ||
* Changed DatabaseConnection to explicitly require a call to connect() | ||
* backported to work with python 2.4 | ||
* schema name dropped from table.alter() and table.drop() to be consistent with table.create() | ||
|
||
== 0.5.0 / 2009-09-17 | ||
* Initial public release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2009 Mitch Matuson | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,63 @@ | ||
SchemaObject v0.5 | ||
+++++++++++++++++ | ||
SchemaObject v0.5.1 documentation | ||
+++++++++++++++++++++++++++++++++ | ||
|
||
Introduction | ||
============ | ||
SchemaObject creates an object representation of a MySQL schema including its databases, tables, columns, indexes, and foreign keys. It allows you to process and iterate over a MySQL schema through python object properties and methods. | ||
SchemaObject provides a simple, easy to use Python object interface to a MySQL database schema. You can effortlessly write tools to test, validate, sync, migrate, or manage your schema as well as generate the SQL necessary to make changes to the it. | ||
|
||
You can generate the SQL syntax for creating, altering and dropping any part of the schema. As of v0.5, a separate process is needed to push any generated changes to your database instance/schema. | ||
Example 1: Verify all tables are InnoDB | ||
--------------------------------------- | ||
import schemaobject | ||
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb') | ||
tables = schema.databases['mydb'].tables #or schema.selected.tables | ||
for t in tables: | ||
assert tables[t].options['engine'].value == 'InnoDB' | ||
|
||
|
||
Example 2: Verify our MySQL instance is at least version 5.1 | ||
------------------------------------------------------------ | ||
import schemaobject | ||
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb') | ||
assert schema.version >= '5.1.0' | ||
|
||
|
||
Notes and Limitations | ||
--------------------- | ||
* SchemaObject instances are read-only. Modifying the object or calling create(), modify(), alter(), or drop() will not change your schema. | ||
* The MySQL User needs to have privileges to execute SELECT and SHOW statements, as well as access the INFORMATION_SCHEMA. | ||
* All Databases, Tables, Columns, Indexes, and Foreign Keys are lazily loaded. | ||
* SchemaObject does not load Events, Triggers, or Stored Procedures. | ||
|
||
Dependancies and Requirements | ||
============================= | ||
* Python 2.5 | ||
* MySQLdb | ||
|
||
Download and Install | ||
==================== | ||
|
||
Prerequisites | ||
------------- | ||
* SchemaObject has been tested against Python 2.4, 2.5, and 2.6. | ||
* To use SchemaObject, you need to have MySQL <http://www.mysql.com/>, version 5.0 or higher and MySQLdb <http://sourceforge.net/projects/mysql-python>, version 1.2.1p2 or higher installed. | ||
* To run the test suite, you need to install a copy of the Sakila Database <http://dev.mysql.com/doc/sakila/en/sakila.html>, version 0.8 | ||
|
||
Installing with easy_install | ||
============================ | ||
|
||
Installing with easy_install | ||
---------------------------- | ||
sudo easy_install schemaobject | ||
|
||
Installing the latest development version | ||
========================================= | ||
----------------------------------------- | ||
git clone git://github.com/mmatuson/SchemaObject.git | ||
cd schemaobject | ||
sudo python setup.py install | ||
|
||
|
||
$ git clone git://github.com/mmatuson/SchemaObject.git | ||
$ cd schemaobject | ||
$ sudo python setup.py develop | ||
|
||
*OR* | ||
|
||
$ sudo python setup.py develop | ||
|
||
Documentation | ||
============= | ||
Documentation is available @ http://matuson.com/code/schemaobject | ||
Documentation is available @ http://matuson.com/code/schemaobject/ | ||
|
||
Status & License | ||
================ | ||
SchemaObject is under active development and released under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>. | ||
|
||
You can obtain a copy of the latest source code from the Git repository <http://github.com/mmatuson/SchemaObject>, or fork it on Github <http://www.github.com>. | ||
|
||
Examples | ||
======== | ||
Verify all tables in our database are InnoDB:: | ||
|
||
import schemaobject | ||
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb') | ||
tables = schema.databases['mydb'].tables #or schema.selected.tables | ||
for t in tables: | ||
assert tables[t].options['engine'].value == 'InnoDB' | ||
|
||
Verify our MySQL instance is version 5.x+:: | ||
You can report bugs via the SchemaObject Issues page <http://github.com/mmatuson/SchemaObject/issues> | ||
|
||
import schemaobject | ||
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb') | ||
assert int(schema.version[:1]) >= 5 #test against the major # of the version string | ||
Comments, questions, and feature requests can be sent to code at matuson dot com |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 189fedddec8b2bc13990cbf7dd1e6bae | ||
config: f3c667b3f33a8c748c47e756f9befa46 | ||
tags: fbb0d17656682115ca4d033fb2f83ba1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.