SilverStripe\PostgreSQL\PostgreSQLSchemaManager
PostgreSQL schema manager
Synopsis
class PostgreSQLSchemaManager
extends DBSchemaManager
{
- // constants
- const ID = 'PostgreSQL';
- // members
- protected PostgreSQLDatabase $database = NULL;
- protected static array $cached_constraints = ;
- protected static array $cached_fieldlists = ;
- // methods
- protected void indexKey()
- public void createPostgresDatabase()
- public void createDatabase()
- public boolean postgresDatabaseExists()
- public void databaseExists()
- public array postgresDatabaseList()
- public void databaseList()
- public void dropPostgresDatabase()
- public void dropDatabase()
- public boolean schemaExists()
- public void createSchema()
- public void dropSchema()
- public array schemaList()
- public void createTable()
- protected string buildPostgresIndexName()
- public string buildPostgresTriggerName()
- public void alterTable()
- private void alterTableAlterColumn()
- public void renameTable()
- public void checkAndRepairTable()
- public void createField()
- public void alterField()
- public void renameField()
- public void fieldList()
- public void clearCachedFieldlist()
- public void createIndex()
- protected void getIndexSqlDefinition()
- public void alterIndex()
- protected array extractTriggerColumns()
- public void indexList()
- public void tableList()
- protected false|array constraintExists()
- private array getConstraintForTable()
- public array tableDetails()
- protected void dropTrigger()
- protected array triggerFieldsFromTrigger()
- public string boolean()
- public string date()
- public string decimal()
- public string enum()
- public string float()
- public string double()
- public string int()
- public string bigint()
- public string datetime()
- public string text()
- public string time()
- public string varchar()
- public void year()
- protected array fulltext()
- public void IdColumn()
- public void hasTable()
- public array enumValuesForField()
- protected array enumValuesFromConstraint()
- public void dbDataType()
- public void createOrReplaceTablespace()
- public void createOrReplacePartition()
- public void createLanguage()
- public string set()
Hierarchy
Extends
- SilverStripe\ORM\Connect\DBSchemaManager
Tasks
Line | Task |
---|---|
495 | this returns an empty array for the following string: int(11) not null auto_increment |
755 | create table partition support |
756 | create clustering options |
1261+ | : create custom functions to allow weighted searches |
1310+ | Make a proper implementation |
Constants
Name | Value |
---|---|
ID | 'PostgreSQL' |
Members
protected
- $cached_constraints
—
array
This holds a copy of all the constraint results that are returned via the function constraintExists(). This is a bit faster than repeatedly querying this column, and should allow the database to use it's built-in caching features for better queries. - $cached_fieldlists
—
array
This holds a copy of all the queries that run through the function fieldList() This is one of the most-often called functions, and repeats itself a great deal in the unit tests. - $database
—
SilverStripe\PostgreSQL\PostgreSQLDatabase
Instance of the database controller this schema belongs to
Methods
private
- alterTableAlterColumn()
- getConstraintForTable() — Retrieve a list of constraints for the provided table name.
protected
- buildPostgresIndexName() — Builds the internal Postgres index name given the silverstripe table and index name
- constraintExists() — Find out what the constraint information is, given a constraint name.
- dropTrigger() — Pass a legit trigger name and it will be dropped This assumes that the trigger has been named in a unique fashion
- enumValuesFromConstraint() — Get the actual enum fields from the constraint value:
- extractTriggerColumns() — Given a trigger name attempt to determine the columns upon which it acts
- fulltext() — Create a fulltext search datatype for PostgreSQL This will also return a trigger to be applied to this table
- getIndexSqlDefinition()
- indexKey()
- triggerFieldsFromTrigger() — This will return the fields that the trigger is monitoring
public
- IdColumn()
- alterField() — Change the database type of the given field.
- alterIndex()
- alterTable()
- bigint() — Return a bigint type-formatted string
- boolean() — Return a boolean type-formatted string
- buildPostgresTriggerName() — Builds the internal Postgres trigger name given the silverstripe table and trigger name
- checkAndRepairTable()
- clearCachedFieldlist()
- createDatabase()
- createField()
- createIndex() — Create an index on a table.
- createLanguage()
- createOrReplacePartition()
- createOrReplaceTablespace()
- createPostgresDatabase() — Creates a postgres database, ignoring model_schema_as_database
- createSchema() — Creates a schema in the current database
- createTable()
- databaseExists()
- databaseList()
- date() — Return a date type-formatted string
- datetime() — Return a datetime type-formatted string For PostgreSQL, we simply return the word 'timestamp', no other parameters are necessary
- dbDataType()
- decimal() — Return a decimal type-formatted string
- double() — Return a float type-formatted string cause double is not supported
- dropDatabase()
- dropPostgresDatabase() — Drops a postgres database, ignoring model_schema_as_database
- dropSchema() — Drops a schema from the database. Use carefully!
- enum() — Return a enum type-formatted string
- enumValuesForField() — Returns the values of the given enum field
- fieldList()
- float() — Return a float type-formatted string
- hasTable()
- indexList()
- int() — Return a int type-formatted string
- postgresDatabaseExists() — Determines if a postgres database exists, ignoring model_schema_as_database
- postgresDatabaseList() — Determines the list of all postgres databases, ignoring model_schema_as_database
- renameField()
- renameTable()
- schemaExists() — Returns true if the schema exists in the current database
- schemaList() — Returns the list of all available schemas on the current database
- set() — Return a set type-formatted string This is used for Multi-enum support, which isn't actually supported by Postgres.
- tableDetails() — A function to return the field names and datatypes for the particular table
- tableList()
- text() — Return a text type-formatted string
- time() — Return a time type-formatted string
- varchar() — Return a varchar type-formatted string
- year()