Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obj_description added to TypeORM table comment support - causes error #380

Open
coler-j opened this issue Feb 9, 2024 · 1 comment
Open

Comments

@coler-j
Copy link

coler-j commented Feb 9, 2024

Describe the bug

TypeORM which is a very popular ORM for Node recently added the following obj_description function call to support table comments in typeorm/typeorm#10613 (typeOrm v0.3.20)

https://github.com/typeorm/typeorm/blob/83567f533482d0170c35e2f99e627962b8f99a08/src/driver/postgres/PostgresQueryRunner.ts#L3291

This will cause the following error during sync

QueryFailedError: ERROR: function obj_description(regclass,text) does not exist

Since TypeORM is a popular lib, it would be good to add support for obj_description or else many people will come here with the same issue.

To Reproduce

SELECT "table_schema", "table_name", obj_description(('"' || "table_schema" || '"."' || "table_name" || '"')::regclass, 'pg_class') AS table_comment FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'my_table') 

pg-mem version

2.8.1

@anton-brass
Copy link

anton-brass commented Feb 17, 2024

Workaround till then for me:

 this.db.public.registerFunction({
            name: "obj_description",
            args: [DataType.text, DataType.text],
            returns: DataType.text,
            implementation: () => "test",
        });

Ho-s added a commit to Ho-s/NestJS-GraphQL-TypeORM-PostgresQL that referenced this issue Feb 28, 2024
- Install swc related dependencies
- Update docs with error handling
- Add swc setting in nest.cli
- Fix obj_description issue(oguimbal/pg-mem#380)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants