Friday, March 10, 2017

laravel db postgresql columns with quotes

I have a website (Laravel & AngularJS) which used MySQL. Now i'm trying to change to Postgres, the database is created and accessible (with all the columns in lowercase which i can't change because there's another application sharing the database). The problem is Laravel's Illuminate is creating the db queries with quotes around the columns' keys like this:

DB::table('generalsettings')->where('settingsKey', '=', 'LicenseSerial');

this creates: SELECT * FROM "generalsettings" WHERE "settingsKey"='LicenseSerial'

Which doesn't work due to the columns' key lowercase. Is there anyway to configure Illuminate's DB to not append quotes to columns keys?



via user3297530

Advertisement