Laravel-OracleDB

Oracle DB driver for Laravel Framework

  • 所有者: jfelder/Laravel-OracleDB
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Laravel Oracle Database Package

OracleDB (updated for 5.4)

Latest Stable Version Total Downloads Build Status

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.

Installation

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

Basic Usage

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.

NEW: The oci8 library in now the default library. If you want to use the pdo library, enter "pdo" as the driver and the code will automatically use the pdo library instead of the oci8 library. Any other value will result in the oci8 library being used.

$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.

Inserting Records Into A Table With An Auto-Incrementing ID

	$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.

License

Licensed under the MIT License.

主要指標

概覽
名稱與所有者jfelder/Laravel-OracleDB
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證
所有者活动
創建於2013-05-23 03:03:56
推送於2025-03-20 15:26:25
最后一次提交2025-03-20 11:26:25
發布數45
最新版本名稱11.0.2 (發布於 )
第一版名稱0.2.0 (發布於 )
用户参与
星數115
關注者數16
派生數45
提交數150
已啟用問題?
問題數30
打開的問題數0
拉請求數36
打開的拉請求數0
關閉的拉請求數8
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?