Giter VIP home page Giter VIP logo

database's Introduction

Laravel Postgres Extended

Build Status SensioLabsInsight Code Climate Latest Stable Version Total Downloads Monthly Downloads License

An extended PostgreSQL driver for Laravel 5.2+ with support for some aditional PostgreSQL data types: hstore, uuid, geometric types (point, path, circle, line, polygon...)

Getting Started

Laravel 5.2+

  1. Run composer require bosnadev/database in your project root directory.
  2. Add Bosnadev\Database\DatabaseServiceProvider::class to config/app.php's providers array.

Then you are done.

Lumen 5.*

  1. Run composer require bosnadev/database in your project root directory.
  2. Add $app->register(Bosnadev\Database\DatabaseServiceProvider::class); to bootstrap/app.php (under the "Register Service Providers" section)
  3. Uncomment the line $app->withEloquent(); in bootstrap/app.php

database's People

Contributors

deadem avatar gbuckingham89 avatar gueroverde avatar hotmeteor avatar howlowck avatar jimmypuckett avatar krzysztofrewak avatar martinnaughton avatar masunov avatar mirzap avatar olegmelnik avatar pelim avatar phaza avatar rap2hpoutre avatar zakhenry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

database's Issues

Xml type

Hello, are you planning to add a xml type?

ENUM type support?

Laravel doesn't support ENUM type for postgres. It declares it as a VARCHAR with constrain which is not very convenient.ย  Can we have ENUM support at this great library?

Can't get Laravel 5 to recognize Bosnadev\Database\Schema\Blueprint

I'm having an issue getting migrations to work with this package.

The problem seems to be a class loading issue, but I'm not 100% sure. Here's what my migration file looks like:

use Bosnadev\Database\Schema;
use Bosnadev\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class TestMigration extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('test', function(Blueprint $table)
        {
            $table->engine = "InnoDB";

                $table->increments('id');
            $table->uuid('public_uid');
            $table->uuid('private_uid');

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('test');
    }
}

Here's the error I get when trying to migrate:

[ErrorException]                                                                                                                                                                              
  Argument 1 passed to TestMigration::{closure}() must be an instance of Bosnadev\Database\Schema\Blueprint, instance of Illuminate\Database\Schema\Blueprint given, called in /Users/mydir/LaravelProjects/laravel5/vendor/illuminate/database/Schema/Builder.php on line 132 and defined

I'm hoping other users, or @mirzap might be able to help me troubleshoot this issue. Thanks!

Laravel + Postgresql timestamp with timezone

Using Postgres timestamp with time zone column with Laravel causes an issue with Carbon

InvalidArgumentException in Carbon.php line 414:
Trailing data

This is because the data returned by Postgres include the +00 timezone information on the end. One fix would be to override getDateFormat and have it return 'Y-m-d H:i:sO' but of course we'd only want to do that where timezones are being used.

Models can override their own dateFormat property, but pivot tables with timestamps can't do this (since there's no actual model for them).

Unsigned causes Postgres error when used with Integer or BigInteger

Laravel Version: 8.48.1
PHP Version: 8.0.1

Migrations that mix integer() (or bigInteger()) with unsigned() no longer migrate, but throw an error with Postgres error.

Schema::create('broken_primary', function (Blueprint $table) {
    $table->integer('broken_id')->unsigned()->primary();
    $table->timestamps();
});

Loading BaseTestCase in production autoload

You are loading BaseTestCase in prod, but there does not seem to be a need to. I want to move it to the -dev autoload. I am about 5 min from making a PR. I just wanted an issue number to reference.

This is causing us an issue as we strip "tests" from vendor folders when pushing to prod servers to make the transfer as small as possible. Since you are loading that file from the test folder in prod, then composer dies for us.

I have grep'ed through the code & only see references to it from files in the test folder, so I am hoping that this will be a non-issue & we can make the change.

Thanks for your time & work on this package.

Issue with using useCurrent on Laravel 10

When using useCurrent in a migration:

$table->dateTime('intCreatedDateTime')->useCurrent();

This throws the error:

   TypeError 

  preg_match(): Argument #2 ($subject) must be of type string, Illuminate\Database\Query\Expression given

  at vendor/bosnadev/database/src/Bosnadev/Database/Schema/Grammars/PostgresGrammar.php:300

Is this a known issue? Thanks for your help.

Add Installation-Guide to Readme

Hey, I included your stuff per autoload in my Laravel project (installing via composer and vcs doesn't work). It seems to boot nicely though I still get an error when using the new types in my migrations like $table->uuid('id') Please, could you guide me through how to set it up correctly or how it's intended to be included in a laravel project?

ABANDONED?

This repository feels abandoned - nothing has been done in ages and support for modern versions of Laravel is not being implemented.

I have forked the repository at https://github.com/BrekiTomasson/database and updated it to support Laravel 10. I will continue to maintain the project until @bosnadev tells me otherwise. If I have not heard from him in the next couple of months, I will consider the project to be abandoned and will release my fork officially.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.