ajthinking / data-story

A visual process builder
https://datastory.dev
186 stars 16 forks source link

Seems like it does not work with PostgreSQL #7

Closed Phil-Venter closed 3 years ago

Phil-Venter commented 3 years ago

Using Composer 2, Laravel 8, and PostgreSQL

Ran composer require ajthinking/data-story --dev and I was greeted with the error below. I am assuming that the issue could be that PostgreSQL is not supported. Database exists, default tables are migrated and populated with seeders, no tables with the same name exists, and eloquent gets data from the DB.

composer require ajthinking/data-story --dev
Using version ^0.0.10 for ajthinking/data-story
./composer.json has been updated
Running composer update ajthinking/data-story
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
  - Locking ajthinking/data-story (v0.0.10)
  - Locking calebporzio/sushi (v2.1.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Downloading calebporzio/sushi (v2.1.1)
  - Downloading ajthinking/data-story (v0.0.10)
  - Installing calebporzio/sushi (v2.1.1): Extracting archive
  - Installing ajthinking/data-story (v0.0.10): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Illuminate\Database\QueryException 

  could not find driver (SQL: create table "stories" ("id" integer not null primary key autoincrement, "name" varchar, "path" varchar, "content" varchar, "deleted_at" varchar))

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678
    674▕         // If an exception occurs when attempting to run a query, we'll format the error
    675▕         // message to include the bindings with SQL, which will make this exception a
    676▕         // lot more helpful to the developer instead of just the database's errors.
    677▕         catch (Exception $e) {
  ➜ 678▕             throw new QueryException(
    679▕                 $query, $this->prepareBindings($bindings), $e
    680▕             );
    681▕         }
    682▕ 

  1   [internal]:0
      DataStory\Models\Story::bootSushi()

  2   [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

LOVE the concept BTW

ajthinking commented 3 years ago

Hi, thanks for testing and reporting 👍

I just tried installing on an app using Composer 2, Laravel 8, and PostgreSQL with no issues.

Your log indicates something goes wrong when it discover packages at line@php artisan package:discover --ansi. Not sure why. Could you share what other packages you have in your composer.json?

I assume you have sqlite enabled in your php.ini and sqlite usually works? EDIT: because the Story model relies on that internally when using Sushi.

extension=php_pdo_sqlite.dll

extension=php_sqlite.dll
Phil-Venter commented 3 years ago

composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.12",
        "laravel/telescope": "^4.4",
        "laravel/tinker": "^2.5",
        "laravel/ui": "^3.2",
        "livewire/livewire": "^2.3"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

@php artisan package:discover --ansi this line came with the Laravel install... weird.

I will try to enable sqllite, I don't think that it is installed/active

Phil-Venter commented 3 years ago

SQLite was the issue, thanks man... 72c2ca1441f780b255e3e63859c600283a858014