Package Data | |
---|---|
Maintainer Username: | jfelder |
Maintainer Contact: | jimmyfelder@gmail.com (Jimmy Felder) |
Package Create Date: | 2013-05-23 |
Package Last Update: | 2024-09-10 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-11 15:16:04 |
Package Statistics | |
---|---|
Total Downloads: | 16,074 |
Monthly Downloads: | 167 |
Daily Downloads: | 3 |
Total Stars: | 115 |
Total Watchers: | 16 |
Total Forks: | 45 |
Total Open Issues: | 0 |
OracleDB is an Oracle Database Driver package for Laravel Framework - thanks @taylorotwell. OracleDB is an extension of Illuminate/Database that uses either the [PDO_OCI] (http://www.php.net/manual/en/ref.pdo-oci.php) extension or the OCI8 Functions wrapped into the PDO namespace.
Please report any bugs you may find.
Add jfelder/oracledb
as a requirement to composer.json:
{
"require": {
"jfelder/oracledb": "5.4.*"
}
}
And then run composer update
Once Composer has installed or updated your packages you need to register OracleDB. Open up config/app.php
and find
the providers
key and add:
Jfelder\OracleDB\OracleDBServiceProvider::class,
Finally you need to publish a configuration file by running the following Artisan command.
$ php artisan vendor:publish
This will copy the configuration file to config/oracledb.php
The configuration file for this package is located at 'config/oracledb.php'. In this file you define all of your oracle database connections. If you need to make more than one connection, just copy the example one. If you want to make one of these connections the default connection, enter the name you gave the connection into the "Default Database Connection Name" section in 'config/database.php'.
Once you have configured the OracleDB database connection(s), you may run queries using the 'DB' class as normal.
$results = DB::select('select * from users where id = ?', array(1));
The above statement assumes you have set the default connection to be the oracle connection you setup in config/database.php file and will always return an 'array' of results.
$results = DB::connection('oracle')->select('select * from users where id = ?', array(1));
Just like the built-in database drivers, you can use the connection method to access the oracle database(s) you setup in config/oracledb.php file.
$id = DB::connection('oracle')->table('users')->insertGetId(
array('email' => 'john@example.com', 'votes' => 0), 'userid'
);
Note: When using the insertGetId method, you can specify the auto-incrementing column name as the second parameter in insertGetId function. It will default to "id" if not specified.
See Laravel Database Basic Docs for more information.
Licensed under the MIT License.