Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 1083 lines (29 kb)
Included or required: 3 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ADODB_DataDict:: (32 methods):
  getCommentSQL()
  setCommentSQL()
  metaTables()
  metaColumns()
  metaPrimaryKeys()
  metaIndexes()
  metaType()
  nameQuote()
  tableName()
  executeSQLArray()
  actualType()
  createDatabase()
  createIndexSQL()
  dropIndexSQL()
  setSchema()
  addColumnSQL()
  alterColumnSQL()
  renameColumnSQL()
  dropColumnSQL()
  dropTableSQL()
  renameTableSQL()
  createTableSQL()
  _genFields()
  _getSize()
  _createSuffix()
  _indexSQL()
  _dropAutoIncrement()
  _tableSQL()
  _triggers()
  _options()
  _getSizePrec()
  changeTableSQL()

Defines 32 functions


Class: ADODB_DataDict  - X-Ref

getCommentSQL($table,$col)   X-Ref
No description

setCommentSQL($table,$col,$cmt)   X-Ref
No description

metaTables()   X-Ref
No description

metaColumns($tab, $upper=true, $schema=false)   X-Ref
No description

metaPrimaryKeys($tab,$owner=false,$intkey=false)   X-Ref
No description

metaIndexes($table, $primary = false, $owner = false)   X-Ref
No description

metaType($t,$len=-1,$fieldobj=false)   X-Ref
No description

nameQuote($name = NULL,$allowBrackets=false)   X-Ref
No description

tableName($name)   X-Ref
No description

executeSQLArray($sql, $continueOnError = true)   X-Ref
No description

actualType($meta)   X-Ref
No description

createDatabase($dbname,$options=false)   X-Ref
No description

createIndexSQL($idxname, $tabname, $flds, $idxoptions = false)   X-Ref
No description

dropIndexSQL($idxname, $tabname = NULL)   X-Ref
No description

setSchema($schema)   X-Ref
No description

addColumnSQL($tabname, $flds)   X-Ref
No description

alterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')   X-Ref
Change the definition of one column

As some DBMs can't do that on their own, you need to supply the complete definition of the new table,
to allow recreating the table and copying the content over to the new table
param: string $tabname table-name
param: string $flds column-name and type for the changed column
param: string $tableflds='' complete definition of the new table, eg. for postgres, default ''
param: array/string $tableoptions='' options for the new table see createTableSQL, default ''
return: array with SQL strings

renameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='')   X-Ref
Rename one column

Some DBMs can only do this together with changeing the type of the column (even if that stays the same, eg. mysql)
param: string $tabname table-name
param: string $oldcolumn column-name to be renamed
param: string $newcolumn new column-name
param: string $flds='' complete column-definition-string like for addColumnSQL, only used by mysql atm., default=''
return: array with SQL strings

dropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')   X-Ref
Drop one column

Some DBM's can't do that on their own, you need to supply the complete definition of the new table,
to allow, recreating the table and copying the content over to the new table
param: string $tabname table-name
param: string $flds column-name and type for the changed column
param: string $tableflds='' complete definition of the new table, eg. for postgres, default ''
param: array/string $tableoptions='' options for the new table see createTableSQL, default ''
return: array with SQL strings

dropTableSQL($tabname)   X-Ref
No description

renameTableSQL($tabname,$newname)   X-Ref
No description

createTableSQL($tabname, $flds, $tableoptions=array()   X-Ref
No description

_genFields($flds,$widespacing=false)   X-Ref
No description

_getSize($ftype, $ty, $fsize, $fprec, $options=false)   X-Ref
No description

_createSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)   X-Ref
No description

_indexSQL($idxname, $tabname, $flds, $idxoptions)   X-Ref
No description

_dropAutoIncrement($tabname)   X-Ref
No description

_tableSQL($tabname,$lines,$pkey,$tableoptions)   X-Ref
No description

_triggers($tabname,$taboptions)   X-Ref
No description

_options($opts)   X-Ref
No description

_getSizePrec($size)   X-Ref
No description

changeTableSQL($tablename, $flds, $tableoptions = false, $dropOldFlds=false)   X-Ref
No description

Functions that are not part of a class:

lens_ParseTest()   X-Ref
No description

ctype_alnum($text)   X-Ref
No description

lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')   X-Ref
No description