maddyscout/laravel-odbc-hive

laravel-odbc-hive 是为 Laravel 提供的一个简单的 Hive 服务提供程序。它通过扩展 Laravel 框架的 Illuminate 数据库组件来提供 Hive 连接。

v6.0.4 2019-10-30 03:00 UTC

This package is not auto-updated.

Last update: 2024-10-01 18:58:22 UTC


README

laravel-odbc-hive 是为 Laravel 提供的一个简单的 Hive 服务提供程序。它通过扩展 Laravel 框架的 Illuminate 数据库组件来提供 Hive 连接。

安装

将 laravel-db2 添加到您的 composer.json 文件中

"require": {
    "sukhilss/laravel-odbc-hive": "^6.0"
}

使用 composer 安装此软件包。

$ composer update

配置

使用软件包配置文件配置 Hive

从项目的根目录运行命令行

$ php artisan vendor:publish

按照上述方式在 app/config/hive.php 中设置您的 laravel-odbc-hive 凭据

支持的 DDL 命令

Schema::connection("hive")->create('dummy_' . time(), function (Blueprint $table) {
    // Numeric Types
    $table->integer('integer_field');
    $table->bigInteger('big_integer');
    $table->smallInteger('small_integer');
    $table->tinyInteger('tinyinteger_field');
    $table->float('float_field');
    $table->double('double_field');
    $table->decimal('decimal_field');

    $table->timestamp('timestamp_field');
    $table->date('date_field');

    // String Types
    $table->string('string_field'); // String literals can be expressed with either single quotes (') or double quotes ("). 
    $table->char('char_field'); // fixed-length strings, the values should be shorter than the specified length
    $table->varChar('varchar_fied'); // varchar between 1 and 65535

    $table->boolean('boolean_field');
    $table->binary('binary_field');
});