ArsenyYankovsky / typeorm-aurora-data-api-driver

A bridge between TypeORM and Aurora Data API
MIT License
175 stars 38 forks source link

fix: Unable to use enums in a different than default DB schema in PostgreSQL #166

Closed vitherain closed 7 months ago

vitherain commented 7 months ago

There was an issue when we used enums with PostgreSQL and we used other than default DB schema at the same time. In that case the cast property of the SQL parameter was wrong because it pointed to non-existent enum - it was not prefixed with the schema name and so the cast parameter is invalid from PostgreSQL point of view and then it failed.

So the fix is about prefixing enum name with database schema in case the entity is decorated with custom schema.

I created a test for this scenario. I wrote it first and then it failed. After the fix it became green.

I also found out, that there was a mistake in pg.yml. The tests ran on top of postgres database and not test database so I made it clear by not creating test database at all because it was always ignored anyway.

ArsenyYankovsky commented 7 months ago

:tada: This PR is included in version 3.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: