# sqlobject.maxdb.maxdbconnection module

Contributed by Edigram SAS, Paris France Tel:01 44 77 94 00 Ahmed MOHAMED ALI <ahmedmoali@yahoo.com> 27 April 2004

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

connection creation sample:

    __connection__ = DBConnection.maxdbConnection(
        host=hostname, database=dbname,
        user=user_name, password=user_password, autoCommit=1, debug=1)

exception `sqlobject.maxdb.maxdbconnection.``IncorrectIDStyleError`(value)

  Bases: `sqlobject.maxdb.maxdbconnection.maxdbException`

exception `sqlobject.maxdb.maxdbconnection.``LowerBoundOfSliceIsNotSupported`(value)

  Bases: `sqlobject.maxdb.maxdbconnection.maxdbException`

class `sqlobject.maxdb.maxdbconnection.``MaxdbConnection`(host='', port=None, user=None, password=None, database=None, autoCommit=1, sqlmode='internal', isolation=None, timeout=None, **kw)

  Bases: `sqlobject.dbconnection.DBAPI`

  `GET_COLUMNS` = "\n SELECT COLUMN_NAME, NULLABLE, DATA_DEFAULT, DATA_TYPE,\n DATA_LENGTH, DATA_SCALE\n FROM USER_TAB_COLUMNS WHERE TABLE_NAME=UPPER('%s')"
  `GET_PK_AND_FK` = "\n SELECT constraint_cols.column_name, constraints.constraint_type,\n refname,reftablename\n FROM user_cons_columns constraint_cols\n INNER JOIN user_constraints constraints\n ON constraint_cols.constraint_name = constraints.constraint_name\n LEFT OUTER JOIN show_foreign_key fk\n ON constraint_cols.column_name = fk.columnname\n WHERE constraints.table_name =UPPER('%s')"
  `addColumn`(tableName, column)
  `columnsFromSchema`(tableName, soClass)
  `createColumn`(soClass, col)
  `createIDColumn`(soClass)
  `createIndexSQL`(soClass, index)
  `createReferenceConstraint`(soClass, col)
  `createSequenceName`(table)

    sequence name are builded with the concatenation of the table name with ‘_SEQ’ word we truncate the name of the sequence_name because sapdb identifier cannot exceed 32 characters so that the name of the sequence does not exceed 32 characters

  `createTable`(soClass)
  `dbName` = 'maxdb'
  `delColumn`(sqlmeta, column)
  `dropTable`(tableName, cascade=False)
  `guessClass`(t, flength, fscale=None)

    An internal method that tries to figure out what Col subclass is appropriate given whatever introspective information is available – both very database-specific.

  `joinSQLType`(join)
  `makeConnection`()
  `schemes` = ['maxdb']
  classmethod `sqlAddLimit`(query, limit)
  `supportTransactions` = True
  `tableExists`(tableName)

exception `sqlobject.maxdb.maxdbconnection.``PrimaryKeyNotFounded`(value)

  Bases: `sqlobject.maxdb.maxdbconnection.maxdbException`

exception `sqlobject.maxdb.maxdbconnection.``StyleMismatchError`(value)

  Bases: `sqlobject.maxdb.maxdbconnection.maxdbException`

exception `sqlobject.maxdb.maxdbconnection.``maxdbException`(value)

  Bases: `Exception`