ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:dictionary_index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dictionary:data_dictionary [2015/10/26 03:48] – [XML Driven Functions] mnewnhamv5:dictionary:dictionary_index [2023/06/04 11:41] (current) – ↷ Links adapted because of a move operation dregad
Line 1: Line 1:
 +<WRAP right box>
 +[[v5:dictionary:Index]]\\
 +</WRAP>
 ====== The Data Dictionary ====== ====== The Data Dictionary ======
 ===== Introduction ===== ===== Introduction =====
Line 4: Line 7:
 ===== Portable Data Types ===== ===== Portable Data Types =====
  
-ADOdb provides a cross-platform method of identifying the data type of a field. These values can be used as a replacement in code that relies on the data type of field to produce a result. Each database driver contains a cross-reference table of datatypes that can accessed using the [[dictionary:metatype|metaType()]] method. +ADOdb provides a cross-platform method of identifying the data type of a field. These values can be used as a replacement in code that relies on the data type of field to produce a result. Each database driver contains a cross-reference table of datatypes that can accessed using the [[v5:dictionary:metatype|metaType()]] method. 
-==== Summary Of Types ==== +==== Summary Of Standard Types ==== 
-^ Type  ^ Represents Field Types                                                                                                                                ^ When Using addColumnSql               ^ Example +^ Type  ^ Represents Field Types                                                                                                                                                                    ^ When Using addColumnSql               ^ Example 
-| C     | character fields that should be shown in a <input type="text"> tag                                                                                    | Add the length of the field           | C 20     +| C     | character fields that should be shown in a <input type="text"> tag                                                                                                                        | Add the length of the field           | C(20)    | 
-| X     | TeXt, large text fields that should be shown in a <textarea>                                                                                          |                                                | +| C2    | Like a C field, but where possible a field that can hold multi-byte (unicode) data is created                                                                                             | Add the length of the field           | C2(20)   
-| B     | Blobs, or Binary Large Objects. Typically images.                                                                                                     |                                                | +| X     | TeXt, large text or CLOB fields that should be shown in a <textarea>                                                                                                                                                                     | 
-| D     | Date field                                                                                                                                            |                                                | +| X2    | Like an X field, but where possible creates a field that can hold multi-byte (unicode) data is created                                                                                    |                                                | 
-| T     | Timestamp field                                                                                                                                       |                                                | +| XL    | On systems that support it, creates a large clob field (32K). This may require additional database configuration. If the database does not support it, a standard clob field is created.  |                                                | 
-| L     | Logical field (boolean or bit-field). Some databases emulate logicals using I2 fields                                                                 |                                                | +| B     | Blobs, or Binary Large Objects. Typically images.                                                                                                                                         |                                                | 
-| I     | Integer field, This may be broken down further into I2,I4 or I8 types                                                                                 |                                                | +| D     | Date (sometimes DateTime) field                                                                                                                                                           |                                                | 
-| N     | Numeric field. Includes autoincrement, numeric, floating point, real and integer.                                                                     | Add the precision and decimal digits  | N 14.4   | +| T     | Timestamp field                                                                                                                                                                           |                                                | 
-| R     | Serial field. Includes serial, autoincrement integers. This works for selected databases. Some databases do not signify if a field is auto-increment  |                                                |+| L     | Logical field (boolean or bit-field). Some databases emulate logicals using I2 fields                                                                                                     |                                                | 
 +| I     | Integer field, This may be broken down further into I2,I4 or I8 types to represent small,medium and large integers. The largest integer data size is always represented by an I field     |                                                | 
 +| N     | Numeric field. Includes autoincrement, numeric, floating point, real and integer.                                                                                                         | Add the precision and decimal digits  | N 14.4   | 
 +| R     | Serial field. Includes serial, autoincrement integers. This works for selected databases. Some databases do not signify if a field is auto-increment                                      |                                                |
 ==== Using Data Types For Non-Portable Applications ==== ==== Using Data Types For Non-Portable Applications ====
-There are benefits to using ADOdb data types even when writing an application that is not designed to be portable. The ''metaType()'' method can hide numerous data sub-types from a developer, when the difference in the field is not important. For example the following actual data types in the [[database:Microsoft SQL Server]] driver are all represented by the ADOdb type ''C'':+There are benefits to using ADOdb data types even when writing an application that is not designed to be portable. The ''metaType()'' method can hide numerous data sub-types from a developer, when the difference in the field is not important. For example the following actual data types in the [[v5:database:microsoft_sql_server]] driver are all represented by the ADOdb type ''C'':
  
 ^Data Type^Description^ ^Data Type^Description^
Line 26: Line 32:
    
 ===== The Meta Functions ===== ===== The Meta Functions =====
-Metadata functions convert database specific table, column and index queries into a standardized cross-database format. As of ADOdb version 6.0, the casing of keys and values returned by the metaFunctions can be controlled by [[dictionary:metaCasing]].+Metadata functions convert database specific table, column and index queries into a standardized cross-database format. 
  
-| [[dictionary:actualType|actualType()]]            | Returns a string description of the actual data type linked to the [[dictionary:metatype|metaType]] for the currently connected database +| [[v5:dictionary:actualtype|actualType()]]            | Returns a string description of the actual data type linked to the [[v5:dictionary:metatype|metaType]] for the currently connected database 
-| [[dictionary:MetaColumns|metaColumns()]]          | Returns a list of available columns and column type information for the supplied table name                                               | +| [[v5:reference:connection:setcustomactualtype|setCustomActualType()]]     | Links a physical database type to a custom metatype | 
-| [[dictionary:MetaColumnNames|metaColumnNames()]]  | Returns a list of available columns for the supplied table name                                                                           | +| [[v5:dictionary:getcustomactualtypes|getCustomActualTypes()]]    | Returns a list of previously defined custom 
-| [[dictionary:metadatabases|metaDatabases()]]      | Returns a list of available databases                                                                                                     | +| [[v5:dictionary:metacolumns|metaColumns()]]          | Returns a list of available columns and column type information for the supplied table name                                               | 
-| [[dictionary:MetaForeignKeys|metaForeignKeys()]]  | Returns a list of foreign keys for the supplied table name                                                                                | +| [[v5:dictionary:metacolumnnames|metaColumnNames()]]  | Returns a list of available columns for the supplied table name                                                                           | 
-| [[dictionary:metaindexes|metaIndexes()]]          | Returns a list of indexes for the supplied table name                                                                                     | +| [[v5:dictionary:metadatabases|metaDatabases()]]      | Returns a list of available databases                                                                                                     | 
-| [[dictionary:MetaPrimaryKeys|metaPrimaryKeys()]]  | Returns a list of primary keys for the supplied table name                                                                                | +| [[v5:dictionary:metaforeignkeys|metaForeignKeys()]]  | Returns a list of foreign keys for the supplied table name                                                                                | 
-| [[dictionary:MetaProcedures|metaProcedures()]]    | Returns a list of procedures and functions for the connected database                                                                     | +| [[v5:dictionary:metaindexes|metaIndexes()]]          | Returns a list of indexes for the supplied table name                                                                                     | 
-| [[dictionary:MetaTables|metaTables()]]            | Returns list of available tables for the supplied database name                                                                           | +| [[v5:dictionary:metaprimarykeys|metaPrimaryKeys()]]  | Returns a list of primary keys for the supplied table name                                                                                | 
-| [[dictionary:metatransaction|metaTransaction()]]  | Returns a database specific transaction mode for a provided meta transaction type                                                         | +| [[v5:dictionary:metaprocedures|metaProcedures()]]    | Returns a list of procedures and functions for the connected database                                                                     | 
-| [[dictionary:metatype|metaType()]]                | Converts database-specific data type into a portable type                                                                                 | +| [[v5:dictionary:metatables|metaTables()]]            | Returns list of available tables for the supplied database name                                                                           | 
-| [[dictionary:serverinfo|serverInfo()]]            | Returns a set of server information                                                                                                       |+| [[v5:dictionary:metatransaction|metaTransaction()]]  | Returns a database specific transaction mode for a provided meta transaction type                                                         | 
 +| [[v5:dictionary:metatype|metaType()]]                | Converts database-specific data type into a portable type                                                                                 | 
 +| [[v5:dictionary:setcustommetatype|setCustomMetaType()]] | Creates a custom, database-specific data type and defines how it is handled by inserts and updates                                                                            | 
 +| [[v5:dictionary:getcustommetatypes|getCustomMetaTypes()]] | Returns a list of custom metatypes                                                                             | 
 +| [[v5:reference:connection:serverinfo|serverInfo()]]            | Returns a set of server information                                                                                                       |
 ===== Schema Management ===== ===== Schema Management =====
 <WRAP info> <WRAP info>
Line 45: Line 55:
 </WRAP> </WRAP>
 ==== Executing prepared code to update the schema ==== ==== Executing prepared code to update the schema ====
-Each of the methods below return an array of data, which should be executed using the [[dictionary:executesqlarray|executeSqlArray()]] method +Each of the methods below return an array of data, which should be executed using the [[v5:dictionary:executesqlarray|executeSqlArray()]] method  
 + 
 +==== Creating A Database ==== 
 +| [[v5:dictionary:createdatabase|createDatabase()]]  | Returns the SQL necessary to create a database  |
  
 ==== Managing Tables ==== ==== Managing Tables ====
  
  
-| [[dictionary:createtablesql|createTableSql()]]  | Returns an SQL statement necessary to create a new table in the database +| [[v5:dictionary:createtablesql|createTableSql()]]  | Returns an SQL statement necessary to create a new table in the database 
-| [[dictionary:changetablesql|changeTableSql()]]  | Returns an SQL statement necessary to change a table in the database      | +| [[v5:dictionary:changetablesql|changeTableSql()]]  | Returns an SQL statement necessary to change a table in the database      | 
-| [[dictionary:renametablesql|renameTableSql()]]  | Returns an SQL statement necessary to rename a table in the database      | +| [[v5:dictionary:renametablesql|renameTableSql()]]  | Returns an SQL statement necessary to rename a table in the database      | 
-| [[dictionary:droptablesql|dropTableSql()]]      | Returns an SQL statement necessary to drop a table from the database      |+| [[v5:dictionary:droptablesql|dropTableSql()]]      | Returns an SQL statement necessary to drop a table from the database      |
  
 ==== Managing Columns ==== ==== Managing Columns ====
-| [[dictionary:addcolumnsql|addColumnSql()]]        | Returns an SQL statement necessary to add a new column to an existing table in the database                   | +| [[v5:dictionary:addcolumnsql|addColumnSql()]]        | Returns an SQL statement necessary to add a new column to an existing table in the database                   | 
-| [[dictionary:altercolumnsql|altercolumnSql()]]    | Returns an SQL statement necessary to modify the attributes of an existing column in a table in the database +| [[v5:dictionary:altercolumnsql|altercolumnSql()]]    | Returns an SQL statement necessary to modify the attributes of an existing column in a table in the database 
-| [[dictionary:renamecolumnsql|renameColumnSql()]]  | Returns an SQL statement necessary to rename an existing column in an existing table in the database          | +| [[v5:dictionary:renamecolumnsql|renameColumnSql()]]  | Returns an SQL statement necessary to rename an existing column in an existing table in the database          | 
-| [[dictionary:dropcolumnsql|dropColumnSql()]]      | Returns an SQL statement necessary to drop an existing column from an existing table in the database          |+| [[v5:dictionary:dropcolumnsql|dropColumnSql()]]      | Returns an SQL statement necessary to drop an existing column from an existing table in the database          |
 ==== Managing Indexes ==== ==== Managing Indexes ====
-| [[dictionary:createindexsql|createIndexSql()]]  | Returns an SQL statement necessary to add an index to an existing table in the database    | +| [[v5:dictionary:createindexsql|createIndexSql()]]  | Returns an SQL statement necessary to add an index to an existing table in the database    | 
-| [[dictionary:dropindexsql|dropIndexSql()]]   | Returns an SQL statement necessary to drop an existing index from a table in the database +| [[v5:dictionary:dropindexsql|dropIndexSql()]]   | Returns an SQL statement necessary to drop an existing index from a table in the database 
 +==== Managing Database Column Comments ==== 
 +|[[v5:dictionary:getcommentsql]]| Returns the SQL necessary to read the comment on a column| 
 +|[[v5:dictionary:setcommentsql]]| Returns the SQL necessary to write the comment on a column|
 ===== XML Driven Functions ===== ===== XML Driven Functions =====
-[[dictionary:xmlschema]]+See the section on [[v5:dictionary:xmlschema|ADOdb-xmlschema]] on how to extend data dictionary functions using XML
v5/dictionary/dictionary_index.1445827731.txt.gz · Last modified: 2017/04/21 11:28 (external edit)