The db_config model is used to establish a database connection with an SQL database. To create a connection object you need to provide the connection string which identifies the database you want to connect to and well as a valid user id and password that is authorized to access the database. Let's review the parameters of a db_config definition. Connection StringThe connection string identifies the database server, host name and database name. The exact format and contents of the connection string are database specific. Consult your database documentation for details related to the connection string you should use. DBMS AdapterEach database platform has certain nuances or differences in the way it supports or processes SQL commands. The DBMS adapter is intended to handle these database specific rules so that developers can work with different SQL databases in a generic way. Adapters are implemented as PHP classes and are normally stored in the system pseudo site under the classes\dbms_adapter folder. User NameEnter a user name that has been configured within the database you wish to access. PasswordEnter the password associated with the User Name above. EncryptBy default, passwords are stored in plain text within the generated config file. This means that anyone who has access to this file could discover the user name and password required to connect to the database. By checking the Encrypt option, the password will be stored as an encrypted value so that the actual password is not revealed in the generated code. Permitted EnvironmentsIn most cases you will want to connect to a different database depending on what environment you are executing in. Check all of the environments that are permitted to connect to the database you are configuring. If you want to take a database out of service temporarily you could uncheck all of these environment flags and after promoting this db_config file to production the database would not be accessible. Database Driver OptionsThis grid is used to supply any options that you would like to set to configure the database. Both the Attribute value and the setting value can reference PDO constants or hard-coded text or numerical values. The following settings are used by default but can be overridden by supplying alternate settings:
Adding Databases to SchemasUse the schema model to define which database should be used in each environment. The schema model refers to the definitions created using the db_config model. |