gensaschema._column module

Column inspection and representation

Column inspection and generation.

Copyright

Copyright 2010 - 2019 André Malo or his licensors, as applicable

License

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

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.

class gensaschema._column.Column(name, ctype, nullable, primary_key, autoincrement, server_default, symbols)

Column container

IVariables
_nameunicode

Name

_ctypeSA type

Column type

_nullablebool

Nullable?

_primary_keybool

Part of a primary key?

_autoincrementbool

Possible autoincrement?

_server_defaultDefault clause

Default clause

__dict__ = mappingproxy({'__module__': 'gensaschema._column', '__doc__': '\n Column container\n\n :IVariables:\n `_name` : ``unicode``\n Name\n\n `_ctype` : SA type\n Column type\n\n `_nullable` : ``bool``\n Nullable?\n\n `_primary_key` : ``bool``\n Part of a primary key?\n\n `_autoincrement` : ``bool``\n Possible autoincrement?\n\n `_server_default` : Default clause\n Default clause\n ', '__init__': <function Column.__init__>, 'from_sa': <classmethod object>, '__repr__': <function Column.__repr__>, '__dict__': <attribute '__dict__' of 'Column' objects>, '__weakref__': <attribute '__weakref__' of 'Column' objects>})
__init__(name, ctype, nullable, primary_key, autoincrement, server_default, symbols)

Initialization

Parameters
nameunicode

Column name

ctypeSA type

Column type

nullablebool

Nullable?

primary_keybool

Part of a primary key?

autoincrementbool

Possible autoincrement?

server_defaultDefault clause

Default clause

__module__ = 'gensaschema._column'
__repr__()

Make string representation

Return

The string representation

Rtype

str

__weakref__

list of weak references to the object (if defined)

classmethod from_sa(column, symbols)

Construct from SA column

Parameters
columnSA column

SA column

Return

New column instance

Rtype

Column

class gensaschema._column.ServerDefault(default, symbols)

Default clause container

IVariables
_defaultDefault clause

Default clause

__dict__ = mappingproxy({'__module__': 'gensaschema._column', '__doc__': '\n Default clause container\n\n :IVariables:\n `_default` : Default clause\n Default clause\n ', '__init__': <function ServerDefault.__init__>, '__repr__': <function ServerDefault.__repr__>, '__dict__': <attribute '__dict__' of 'ServerDefault' objects>, '__weakref__': <attribute '__weakref__' of 'ServerDefault' objects>})
__init__(default, symbols)

Initialization

Parameters
defaultDefault clause

Default clause

__module__ = 'gensaschema._column'
__repr__()

Make string representation

Return

The string representation

Rtype

str

__weakref__

list of weak references to the object (if defined)