Closed monoteos closed 5 years ago
Hello there! Thanks for opening your first issue on this repo!
Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.
Backpack communication mediums:
backpack-for-laravel
tag;Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.
Thank you!
-- Justin Case The Backpack Robot
Thank you for writing the detailed report @monoteos .
Unfortunately, Backpack does not provide official support for PosgreSQL. We use Eloquent which should abstract away the DBMS, but in practice there are quirks and bugs, features of Eloquent that only MySQL supports (like json column type), things like that.
Our focus is on providing an excellent user experience on MySQL, but we do have reports of people using Backpack successfully with Postgres, and have a number of conditionals in code to provide support for those few Posgres users.
We're happy to merge PRs that bring PosgreSQL support, but don't bloat our code. However, it's not a priority for us right now to push for full PosgreSQL support - so we won't be actively working on it. Maybe in the future.
Sorry to disappoint. Thanks again for taking the time to write this issue. Cheers!
Bug report
Model getSchema returns MySqlBuilder and MySqlGrammar for Postgres connection which causing error in getting columns list
What I did:
I got latest release of Laravel, and installed latest release of Backpack
this is my DB config in .env
this is my database config in configs:
Then I generated a model, controller and request
Added CRUD to routes:
This is my generated model, I tweaked to use my pgsql table and connection:
What I expected to happen:
I expected to open admin route and see list of my model
What happened:
When I'm trying to open my model route in admin panel I got error:
What I've already tried to fix it:
I found a place where it fails and thinking about extend Column trait to avoid this
Columns trait, line 419:
Dump of $this:
Dump of $this->getSchema():
so builder in getSchema must be PostgresBuilder instead of MySqlBuilder and also grammar must be PostgresGrammar, but somewhere it get overwritten
Backpack, Laravel, PHP, DB version:
Backpack: 3.6.22
Laravel: v5.8.29
PHP 7.3.6 (cli) (built: Jun 17 2019 08:40:34) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.6, Copyright (c) 1999-2018, by Zend Technologies
DB: Mysql: 8.0.13 (MySQL Community Server - GPL) Postgres: PostgreSQL 10.6