# -*- coding: iso-8859-1 -*-
#-----------------------------------------------------------------------------
# Modeling Framework: an Object-Relational Bridge for python
#
# Copyright (c) 2001-2004 Sbastien Bigaret <sbigaret@users.sourceforge.net>
# All rights reserved.
#
# This file is part of the Modeling Framework.
#
# This code is distributed under a "3-clause BSD"-style license;
# see the LICENSE file for details.
#-----------------------------------------------------------------------------
"""
AbstractDBAPI2SchemaGeneration
This module only show the needed methods to define in your concrete
SchemaGeneration ; you should not subclass the
AbstractDBAPI2SchemaGeneration.
CVS information
$Id: AbstractDBAPI2SchemaGeneration.py 933 2004-08-02 19:58:54Z sbigaret $
"""
__version__='$Revision: 933 $'[11:-2]
from StringIO import StringIO
# Framework
from Modeling.SchemaGeneration import SchemaGeneration
# Interfaces
#from Modeling.interfaces.SchemaGeneration import ISchemaGeneration
#
from Modeling.SchemaGeneration import \
CreateDatabaseKey, CreatePrimaryKeySupportKey, CreateTablesKey, \
DropDatabaseKey, DropPrimaryKeySupportKey, DropTablesKey, \
ForeignKeyConstraintsKey, PrimaryKeyConstraintsKey
class AbstractDBAPI2SchemaGeneration(SchemaGeneration):
"""
This class is here for information only ; it does not contain any reusable
logic. Your concrete SchemaGeneration should inherit directly from
Modeling.SchemaGeneration.
See Modeling.interfaces.SchemaGeneration for further details
"""
#__implements__ = (ISchemaGeneration,)
def createDatabaseStatementsForConnectionDictionary(self, connectionDictionary, administrativeConnectionDictionary, createUserFlag=1):
"""
Returns a list of SQLExpression statements, creating the requested
database.
See also: interfaces.SchemaGeneration for details
"""
self.__abstract__()
def dropDatabaseStatementsForConnectionDictionary(self, connectionDictionary, administrativeConnectionDictionary, dropUserFlag=1):
"""
Returns a list of SQLExpression statements, dropping the requested
database.
See Modeling.interfaces.SchemaGeneration for details
"""
self.__abstract__()
def dropPrimaryKeySupportStatementsForEntityGroup(self, entityGroup):
"""
See Modeling.interfaces.SchemaGeneration for further details
See also: AbstractDBAPI2AdaptorChannel.primaryKeysForNewRowsWithEntity()
"""
self.__abstract__()
def foreignKeyConstraintStatementsForRelationship(self, relationship):
"""
"""
## __TBD + INITIALLY DEFERRED
self.__abstract__()
def primaryKeySupportStatementsForEntityGroup(self, entityGroup):
"""
See Modeling.interfaces.SchemaGeneration for further details
See also:
dropPrimaryKeySupportStatementsForEntityGroup()
AbstractDBAPI2AdaptorChannel.primaryKeysForNewRowsWithEntity()
"""
self.__abstract__()
def __abstract__():
raise 'Unimplemented', 'abstract method, should be implemented in subclasses'
|