- Create a database and import
data.sql
into it. - Copy
ormconfig.sample.json
toormconfig.json
and modify to suit your needs. - Run
npm install
- Run application with
npm start
. - Examine the results from console output.
TypeORM creates column aliases when doing queries to the database. However with long column and table names, the aliases get so long that they get cutted in Postgres, since there is a 63 byte limit in column and table names.
This same 63 byte name limit restriction applies to column aliases as well.
An example of the issue by doing a query to the test database in Postgres:
[typeorm_test=# SELECT "andHereWehaveAnTooLongEntityNameThatIsVeryDescriptive" AS "EntityWithVeryLongAndDescriptiveName_andHereWehaveAnTooLongEntityNameThatIsVeryDescriptive" FROM entity_with_very_long_and_descriptive_name;
NOTICE: identifier "EntityWithVeryLongAndDescriptiveName_andHereWehaveAnTooLongEntityNameThatIsVeryDescriptive" will be truncated to "EntityWithVeryLongAndDescriptiveName_andHereWehaveAnTooLongEnti"
EntityWithVeryLongAndDescriptiveName_andHereWehaveAnTooLongEnti
-----------------------------------------------------------------
1
(1 row)