定制 appsero/laravel-datastore 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

appsero/laravel-datastore

最新稳定版本:0.0.6

Composer 安装命令:

composer require appsero/laravel-datastore

包简介

A package for using google datastore as a database driver.

README 文档

README

Laravel Datastore

Datastore Driver for Laravel

Latest Stable Version License

A package for using google datastore as a database driver.

By using this package, you can use query builder and eloquent to access data from datastore.

Installation

You can install the package via composer:

composer require appsero/laravel-datastore

If you are using Laravel Package Auto-Discovery, you don't need you to manually add the ServiceProvider.

Without auto-discovery:

If you don't use auto-discovery, add the below ServiceProvider to the $providers array in config/app.php file.

Appsero\LaravelDatastore\DatastoreServiceProvider::class,

Roadmap

  • Data read using query builder (available).
  • Data read using eloquent model (available).
  • Data insert (available).
  • Data update (Using query builder, model coming soon).
  • Data delete (available).
  • Cursor Paginate (soon).
  • Relations (soon).

Usage

You need to add datastore connection in config/database.php file.

'connections' => [
    ...
    'datastore' => [
        'driver' => 'datastore',
        'key_file_path' => env('GOOGLE_APPLICATION_CREDENTIALS', 'gcloud-credentials.json'),
        'prefix' => env('DATASTORE_PREFIX', null),
    ],
    ...
],

Access using Eloquent Model

You need to extend Appsero\LaravelDatastore\Eloquent\Model class instead of laravel's default eloquent model class.

Example-

<?php

namespace App\Models;

use Appsero\LaravelDatastore\Eloquent\Model;

class Project extends Model
{
    // Your works here
}

Access using Query Builder

Example-

DB::connection('datastore')
    ->table('projects')
    ->where('project_id', '>', 5)
    ->skip(3)
    ->take(5)
    ->get();

It will return a collection.

Tested Builder Functions

  • connection
  • table
  • from
  • select (for projection query)
  • kind (same as table)
  • where (Available: = , > , < , >= , <= )
  • limit
  • take
  • skip
  • orderBy
  • get
  • simplePaginate
  • paginate (works same as simplePaginate)
  • first
  • delete
  • insert
  • upsert
  • find / lookup

Contribution Guide

This driver is still not stable. You can contribute by reporting bugs, fixing bugs, reviewing pull requests and more ways. Go to issues section, and you can start working on a issue immediately. If you want to add or fix something, open a pull request by following Laravel contribution guide.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 601
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固