Overview

Packages

  • Db
    • Adapter
    • Migration

Classes

  • Horde_Db_Adapter_Base
  • Horde_Db_Adapter_Base_Column
  • Horde_Db_Adapter_Base_ColumnDefinition
  • Horde_Db_Adapter_Base_Index
  • Horde_Db_Adapter_Base_Schema
  • Horde_Db_Adapter_Base_Table
  • Horde_Db_Adapter_Base_TableDefinition
  • Horde_Db_Adapter_Mysql
  • Horde_Db_Adapter_Mysql_Column
  • Horde_Db_Adapter_Mysql_Result
  • Horde_Db_Adapter_Mysql_Schema
  • Horde_Db_Adapter_Mysqli
  • Horde_Db_Adapter_Mysqli_Result
  • Horde_Db_Adapter_Pdo_Base
  • Horde_Db_Adapter_Pdo_Mysql
  • Horde_Db_Adapter_Pdo_Pgsql
  • Horde_Db_Adapter_Pdo_Sqlite
  • Horde_Db_Adapter_Postgresql_Column
  • Horde_Db_Adapter_Postgresql_Schema
  • Horde_Db_Adapter_SplitRead
  • Horde_Db_Adapter_Sqlite_Column
  • Horde_Db_Adapter_Sqlite_Schema

Interfaces

  • Horde_Db_Adapter
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Db_Adapter_Sqlite_Schema

Horde_Db_Adapter_Base_Schema
Extended by Horde_Db_Adapter_Sqlite_Schema
Package: Db\Adapter
Category: Horde
License: http://www.horde.org/licenses/bsd
Author: Mike Naberezny mike@maintainable.com
Author: Derek DeVries derek@maintainable.com
Author: Chuck Hagenbuch chuck@horde.org
Author: Jan Schneider jan@horde.org
Located at Horde/Db/Adapter/Sqlite/Schema.php
Methods summary
public Horde_Db_Adapter_Base_Column
# makeColumn( string $name, string $default, string $sqlType = null, boolean $null = true )

Factory for Column objects.

Factory for Column objects.

Parameters

$name
<p>The column's name, such as "supplier_id" in "supplier_id int(11)".</p>
$default
<p>The type-casted default value, such as "new" in "sales_stage varchar(20) default 'new'".</p>
$sqlType
<p>Used to extract the column's type, length and signed status, if necessary. For example "varchar" and "60" in "company_name varchar(60)" or "unsigned => true" in "int(10) UNSIGNED".</p>
$null
Whether this column allows NULL values.

Returns

Horde_Db_Adapter_Base_Column
A column object.

Overrides

Horde_Db_Adapter_Base_Schema::makeColumn()
public string
# quoteColumnName( string $name )

Returns a quoted form of the column name.

Returns a quoted form of the column name.

Parameters

$name
A column name.

Returns

string
The quoted column name.
public string
# quoteTrue( )

Returns a quoted boolean true.

Returns a quoted boolean true.

Returns

string
The quoted boolean true.

Overrides

Horde_Db_Adapter_Base_Schema::quoteTrue()
public string
# quoteFalse( )

Returns a quoted boolean false.

Returns a quoted boolean false.

Returns

string
The quoted boolean false.

Overrides

Horde_Db_Adapter_Base_Schema::quoteFalse()
public string
# quoteBinary( mixed $value )

Returns a quoted binary value.

Returns a quoted binary value.

Parameters

$value
binary value.

Returns

string
The quoted binary value.

Overrides

Horde_Db_Adapter_Base_Schema::quoteBinary()
public array
# nativeDatabaseTypes( )

Returns a hash of mappings from the abstract data types to the native database types.

Returns a hash of mappings from the abstract data types to the native database types.

See TableDefinition::column() for details on the recognized abstract data types.

Returns

array
A database type map.

See

TableDefinition::column()

Overrides

Horde_Db_Adapter_Base_Schema::nativeDatabaseTypes()
public array
# tables( )

Returns a list of all tables of the current database.

Returns a list of all tables of the current database.

Returns

array
A table list.
public Horde_Db_Adapter_Base_Index
# primaryKey( string $tableName, string $name = null )

Returns a table's primary key.

Returns a table's primary key.

Parameters

$tableName
A table name.
$name
(can be removed?)

Returns

Horde_Db_Adapter_Base_Index
The primary key index object.
public array
# indexes( string $tableName, string $name = null )

Returns a list of tables indexes.

Returns a list of tables indexes.

Parameters

$tableName
A table name.
$name
(can be removed?)

Returns

array
A list of Horde_Db_Adapter_Base_Index objects.
public array
# columns( string $tableName, string $name = null )

Returns a list of table columns.

Returns a list of table columns.

Parameters

$tableName
A table name.
$name
(can be removed?)

Returns

array
A list of Horde_Db_Adapter_Base_Column objects.
public
# renameTable( string $name, string $newName )

Renames a table.

Renames a table.

Parameters

$name
A table name.
$newName
The new table name.
public
# addColumn( string $tableName, string $columnName, string $type, array $options = array() )

Adds a new column to a table.

Adds a new column to a table.

Parameters

$tableName
A table name.
$columnName
A column name.
$type
A data type.
$options
<p>Column options. See Horde_Db_Adapter_Base_TableDefinition#column() for details.</p>

Overrides

Horde_Db_Adapter_Base_Schema::addColumn()
public
# removeColumn( string $tableName, string $columnName )

Removes a column from a table.

Removes a column from a table.

Parameters

$tableName
A table name.
$columnName
A column name.

Overrides

Horde_Db_Adapter_Base_Schema::removeColumn()
public
# changeColumn( string $tableName, string $columnName, string $type, array $options = array() )

Changes an existing column's definition.

Changes an existing column's definition.

Parameters

$tableName
A table name.
$columnName
A column name.
$type
A data type.
$options
<p>Column options. See Horde_Db_Adapter_Base_TableDefinition#column() for details.</p>
public
# changeColumnDefault( string $tableName, string $columnName, mixed $default )

Sets a new default value for a column.

Sets a new default value for a column.

If you want to set the default value to NULL, you are out of luck. You need to execute the apppropriate SQL statement yourself.

Parameters

$tableName
A table name.
$columnName
A column name.
$default
The new default value.
public
# renameColumn( string $tableName, string $columnName, string $newColumnName )

Renames a column.

Renames a column.

Parameters

$tableName
A table name.
$columnName
A column name.
$newColumnName
The new column name.
public
# addPrimaryKey( string $tableName, string|array $columns )

Adds a primary key to a table.

Adds a primary key to a table.

Parameters

$tableName
A table name.
$columns
$columnName One or more column names.

Throws

Horde_Db_Exception

Since

Horde_Db 1.1.0

Overrides

Horde_Db_Adapter_Base_Schema::addPrimaryKey()
public
# removePrimaryKey( string $tableName )

Removes a primary key from a table.

Removes a primary key from a table.

Parameters

$tableName
A table name.

Throws

Horde_Db_Exception

Since

Horde_Db 1.1.0
public
# removeIndex( string $tableName, string|array $options = array() )

Removes an index from a table.

Removes an index from a table.

See parent class for examples.

Parameters

$tableName
A table name.
$options
<p>Either a column name or index options: - name: (string) the index name. - column: (string|array) column name(s).</p>

Overrides

Horde_Db_Adapter_Base_Schema::removeIndex()
public
# createDatabase( string $name, array $options = array() )

Creates a database.

Creates a database.

Parameters

$name
A database name.
$options
Database options.
public
# dropDatabase( string $name )

Drops a database.

Drops a database.

Parameters

$name
A database name.
public string
# currentDatabase( )

Returns the name of the currently selected database.

Returns the name of the currently selected database.

Returns

string
The database name.
public string
# modifyDate( string $reference, string $operator, integer $amount, string $interval )

Generates a modified date for SELECT queries.

Generates a modified date for SELECT queries.

Parameters

$reference
<p>The reference date - this is a column referenced in the SELECT.</p>
$operator
Add or subtract time? (+/-)
$amount
<p>The shift amount (number of days if $interval is DAY, etc).</p>
$interval
<p>The interval (SECOND, MINUTE, HOUR, DAY, MONTH, YEAR).</p>

Returns

string
The generated INTERVAL clause.

Since

Horde_Db 1.2.0

Overrides

Horde_Db_Adapter_Base_Schema::modifyDate()
Methods inherited from Horde_Db_Adapter_Base_Schema
__call(), __construct(), __get(), addColumnOptions(), addIndex(), addOrderByForAssocLimiting(), buildClause(), createTable(), distinct(), dropTable(), endTable(), indexName(), makeColumnDefinition(), makeIndex(), makeTable(), makeTableDefinition(), quote(), quoteDate(), quoteString(), quoteTableName(), recreateDatabase(), setAdapter(), table(), tableAliasFor(), tableAliasLength(), typeToSql()
API documentation generated by ApiGen