Propel2 icon indicating copy to clipboard operation
Propel2 copied to clipboard

pgsql: Did not apply identifierQuoting="true" to the schema when importing schema from database

Open Tsaukpaetra opened this issue 6 years ago • 3 comments

Similar to #1478 , I used the "easy mode" to init the schema and model from an existing postgresql database, which all worked fine (barring invalid PHP names being generated, that's another issue).

However, since the schema generation did not add identifierQuoting="true" to the database node, each query dies with a SQLSTATE[42703]: Undefined column error.

Manually adding the setting and rebuilding the model seems to work fine, but why is it missing in the first place? Or rather, if the default is intended to be enabled, why is it not working?

Tsaukpaetra avatar Sep 18 '19 07:09 Tsaukpaetra

the identifierQuoting="true" does not work on SQLite either

mj-kiwi avatar Sep 19 '19 03:09 mj-kiwi

This affects the class generation, in specific the doInsert() method, which makes a query:

$dataFetcher = $con->query("SELECT nextval('MyTable_ID_seq')");

When it should be:

$dataFetcher = $con->query("SELECT nextval('\"MyTable_ID_seq\"')");

This is kinda important, 'cause I'm not able to workaround this with the identifiedQuoting flag (apparently).

Tsaukpaetra avatar Oct 08 '19 08:10 Tsaukpaetra

Is someone able to make a PR here with suggested changes?

dereuromark avatar Jul 01 '20 11:07 dereuromark