Skip to content

Commit

Permalink
version 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mitch committed Nov 10, 2009
1 parent 405ab0a commit 66f9bfa
Show file tree
Hide file tree
Showing 48 changed files with 1,136 additions and 586 deletions.
16 changes: 16 additions & 0 deletions CHANGES
@@ -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
13 changes: 13 additions & 0 deletions LICENSE
@@ -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.
84 changes: 48 additions & 36 deletions README
@@ -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 modified docs/_build/doctrees/api/column.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/api/database.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/api/option.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/api/table.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
@@ -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
117 changes: 59 additions & 58 deletions docs/_build/html/_sources/index.txt
@@ -1,52 +1,62 @@
.. SchemaObject documentation master file, created by
sphinx-qschemaobjectuickstart on Wed Sep 16 09:45:22 2009.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
SchemaObject v0.5.1 documentation
+++++++++++++++++++++++++++++++++

SchemaObject v0.5 documentation
+++++++++++++++++++++++++++++++
Introduction and Examples
-------------------------
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 it.

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.
**Verify all tables are InnoDB**

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.
::

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>`_.
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 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.

Installation
=============
Download and Install
--------------------

Dependancies and Requirements
-----------------------------
* Python 2.5
* MySQLdb
**Prerequisites**

Installing with easy_install
--------------------------------
Simply run the following command::
* 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

$ sudo easy_install schemaobject

Installing the latest development version
------------------------------------------
**Installing with easy_install**
::

Standard install::
sudo easy_install schemaobject

$ git clone git://github.com/mmatuson/SchemaObject.git
$ cd schemaobject
$ sudo python setup.py install
**Installing the latest development version**
::

Development Mode::
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

Documentation
=============
-------------
.. toctree::
:maxdepth: 1

Expand All @@ -57,29 +67,20 @@ Documentation
api/index.rst
api/foreignkey.rst
api/option.rst



Projects using SchemaObject
---------------------------
Schema Sync - a MySQL schema synchronization utility


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+::

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>`_.

You can report bugs via the `SchemaObject Issues page <http://github.com/mmatuson/SchemaObject/issues>`_.

Comments, questions, and feature requests can be sent to code at matuson dot com

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


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit 66f9bfa

Please sign in to comment.