jaschweder/laravel-sqlanywhere

基于Sybase驱动的Laravel 4 Eloquent模型和查询构建器

dev-master 2014-12-09 13:53 UTC

This package is not auto-updated.

Last update: 2020-01-06 10:09:50 UTC


README

为Laravel 4添加Sybase驱动,可使用Fluent和Eloquent。

注意!关于Schema创建和修改表,还存在一些BUG。

待办 - 与Migrate的集成,还未100%完成:/ - 测试以查找BUG

安装

Jaschweder\laravel-sqlanywhereJaschweder/sql-anywhere-client添加到composer.json的要求中

{
    "require": {
        "Jaschweder/sql-anywhere-client": "dev-master",
        "Jaschweder/laravel-sqlanywhere": "dev-master"
    }
}

使用composer update更新您的包,或使用composer install进行安装。

一旦Composer已安装或更新了您的包,您需要将LaravelODBC及其使用的包(extradb)注册到Laravel中。打开app/config/app.php,找到底部的providers键。

将以下内容添加到提供者列表中

'Jaschweder\SQLAnywhere\SQLAnywhereServiceProvider',

您不需要在别名部分添加任何内容。

配置

对于LaravelODBC没有单独的包配置文件。您只需在app/config/database.php中的connections数组中添加一个新的数组。

		'sqlanywhere' => array(
            'host'        => 'tcpip{host=Carlos.bludata.local;port=2638}',
            'username'    => 'teste-conexao',
            'password'    => 'teste',
            'database'    => 'teste-conexao',
            'auto_commit' => true,
            'persintent'  => false,
        ),

ODBC驱动程序与预安装的驱动程序不同,您将传递DSN而不是让Laravel为您构建它。配置ODBC数据库的方式太多了,这个包无法为您完成。一些示例配置在php.net

别忘了更新您的默认数据库连接。