Doctrine Column Sensitivity Identifier

I am trying to query the mssql database using Doctrine. I set up a connection, built a schema from a database, and built classes. Everything went smoothly, but now when I try to query the database:

symfony doctrine:dql "from TABLE_NAME" 

I get the error Invalid column name "column_name" because our mssql database server is configured to use the CASE SENSITIVE and UPPER CASE column names, while the doctrine forces all column names to be lowercase. How to create a doctrine to maintain sensitivity (better) or make it upper case?

+2
source share
2 answers

see link

http://www.doctrine-project.org/projects/orm/1.2/docs/manual/configuration/en

 $conn->setAttribute(Doctrine_Core::ATTR_PORTABILITY, Doctrine_Core::PORTABILITY_FIX_CASE ) 
+3
source

In order not to delve into the configuration. Use "" in your declarations. This makes the column name case sensitive for some databases, such as PostgreSQL.

Example:

 @ORM\JoinColumn(name="""Apples""", referencedColumnName="applies") 
0
source

Source: https://habr.com/ru/post/1346139/


All Articles