sunaoka/laravel-postgres-extension 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sunaoka/laravel-postgres-extension

最新稳定版本:v4.2.0

Composer 安装命令:

composer require sunaoka/laravel-postgres-extension

包简介

Extended PostgreSQL driver for Laravel.

README 文档

README

Latest Stable Version License PHP from Packagist Laravel Test codecov

Installation

composer require sunaoka/laravel-postgres-extension

Configurations

php artisan vendor:publish --tag=postgres-extension

Features

Usage

Table

CREATE TABLE some_models
(
    id bigserial PRIMARY KEY NOT NULL,
    code text NOT NULL,
    term tsrange NOT NULL,
    CONSTRAINT code_uq UNIQUE (code)
);

Model

<?php

namespace App\Models;

class SomeModel extends \Sunaoka\LaravelPostgres\Eloquent\Model
{
    protected $casts = [
        'term' => \Sunaoka\LaravelPostgres\Eloquent\Casts\TsRangeCast::class, // tsrange
    ];
}

RETURNING

$some = SomeModel::whereId(1)
    ->returning(['*'])
    ->update([
        'term' => new TsRange('2020-09-01 00:00:00', '2020-09-01 23:59:59'),
    ]);

echo get_class($some);
// => Illuminate\Database\Eloquent\Collection

echo get_class($some->first());
// => App\Models\SomeModel
update "some_models" 
set "term" = '[2020-09-01 00:00:00,2020-09-01 23:59:59)' 
where "id" = '1' 
returning *

Caching "information_schema" table.

Permanently cache the results for a table like the one below.

select * 
from information_schema.tables 
where table_schema = 'public' and table_name = 'some_models'

Range Types

see: sunaoka/laravel-postgres-range

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固