CakeDC / cakephp-oracle-driver

CakePHP 3 Driver for Oracle Database
Other
40 stars 25 forks source link

Add cacheMetadata key to the config example in README #40

Closed xavier83ar closed 4 years ago

xavier83ar commented 5 years ago

The example configuration en REAME does not have the cacheMetadata key, and while I know that it's something that's beyond the scope of this plugin I guess that many others (as I did), will copy it as it's and use it in its project configs.

Without that key CakePHP won't cache the schema, and it will be quering for it every time, hitting down performance.

<?php
return [
    'Datasources' => [
        'default' => [
            'className' => 'CakeDC\OracleDriver\Database\OracleConnection',
            'driver' => 'CakeDC\OracleDriver\Database\Driver\OracleOCI', # For OCI8
            #'driver' => 'CakeDC\\OracleDriver\\Database\\Driver\\OraclePDO', # For PDO_OCI
            'host' => 'oracle11g',          # Database host name or IP address
            //'port' => 'nonstandard_port', # Database port number (default: 1521)
            'username' => 'blogs',          # Database username
            'password' => 'password',       # Database password
            'database' => 'XE',             # Database name (maps to Oracle's `SERVICE_NAME`)
            'sid' => '',                    # Database System ID (maps to Oracle's `SID`)
            'instance' => '',               # Database instance name (maps to Oracle's `INSTANCE_NAME`)
            'pooled' => '',                 # Database pooling (maps to Oracle's `SERVER=POOLED`)
            /**
             * tell cakephp to cache schema
             */
            'cacheMetadata' => true,
        ]
    ]
];
skie commented 4 years ago

documnetaiton updated