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

setting COMMENT on columns and tables (PostgreSQL) #3360

Closed
ulo opened this issue Jan 4, 2019 · 14 comments · Fixed by #6902
Closed

setting COMMENT on columns and tables (PostgreSQL) #3360

ulo opened this issue Jan 4, 2019 · 14 comments · Fixed by #6902

Comments

@ulo
Copy link

ulo commented Jan 4, 2019

Issue type:

[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Feature request:
When I define my entities I would like to be able to set a COMMENT to the database object. From looking at the source code this seems to be currently possible only for MySQL and not for PostgreSQL:

@Entity()
export class User {
  ...
  @Column({comment: 'The age in years.'})  // <--
  age: number
}

Using PostgreSQL one can also set a COMMENT on the table itself, which is not yet supported by TypeORM at all, but could look like this:

@Entity({comment: 'A user profile in the wep app.'})  // <--
export class User {
  ...
  @Column({comment: 'The age in years.'})
  age: number
}

I am asking for this feature as I am using the awesome PostGraphile tool, which heavily relies on COMMENTs for its configuration, and it would be really useful to do this by using TypeORM entity decorators!!

Many thanks,
Ulrich

@ulo ulo changed the title setting COMMENT setting COMMENT on columns and tables (PostgreSQL) Jan 4, 2019
@pleerock
Copy link
Member

pleerock commented Jan 4, 2019

Feature is opened for contributions!

@vlapo
Copy link
Contributor

vlapo commented Jan 11, 2019

This should be fixed also for mysql. And investigate comments in all supported databases and implemented it too.

@Diluka
Copy link
Contributor

Diluka commented Mar 5, 2019

Please save comment in meta first. It helps generating API docs.

@AlexMesser AlexMesser self-assigned this Mar 13, 2019
@DavidTheProgrammer

This comment has been minimized.

@imagine10255

This comment has been minimized.

@auerbachb
Copy link

auerbachb commented Aug 25, 2020

+1
(it should be noted that as of this post, adding comments to the args for typeorm for the @Column() decorator does not break anything, but also does not modify the psql database (ie it fails silently)

@imnotjames imnotjames assigned imnotjames and unassigned AlexMesser Oct 12, 2020
imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 13, 2020
adds support for column comments to both the Postgres and
CockroachDB driver - for migrations & in metadata.  also includes
new tests that validate the functionality works as expected

updates the MySQL support so there's better handling of the column
comments in MySQL so it also passes the column comment tests

fixes typeorm#3360
imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 13, 2020
adds support for column comments to both the Postgres and
CockroachDB driver - for migrations & in metadata.  also includes
new tests that validate the functionality works as expected

updates the MySQL support so there's better handling of the column
comments in MySQL so it also passes the column comment tests

fixes typeorm#3360
imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 14, 2020
adds support for column comments to both the Postgres and
CockroachDB driver - for migrations & in metadata.  also includes
new tests that validate the functionality works as expected

updates the MySQL support so there's better handling of the column
comments in MySQL so it also passes the column comment tests

fixes typeorm#3360
@imnotjames
Copy link
Contributor

Code in #6902 is ready to go, has tests, should be good to merge.

imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 18, 2020
adds support for column comments to both the Postgres and
CockroachDB driver - for migrations & in metadata.  also includes
new tests that validate the functionality works as expected

updates the MySQL support so there's better handling of the column
comments in MySQL so it also passes the column comment tests

fixes typeorm#3360
imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 19, 2020
adds support for column comments to both the Postgres and
CockroachDB driver - for migrations & in metadata.  also includes
new tests that validate the functionality works as expected

fixes typeorm#3360
imnotjames added a commit that referenced this issue Oct 19, 2020
adds support for column comments to both the Postgres and
CockroachDB driver - for migrations & in metadata.  also includes
new tests that validate the functionality works as expected

fixes #3360
zaro pushed a commit to zaro/typeorm that referenced this issue Jan 12, 2021
adds support for column comments to both the Postgres and
CockroachDB driver - for migrations & in metadata.  also includes
new tests that validate the functionality works as expected

fixes typeorm#3360
@AlainBartmanDilaw
Copy link

This should be fixed also for mysql. And investigate comments in all supported databases and implemented it too.

Has this feature been implemented for mysql databases ?

@derushio
Copy link

derushio commented Oct 28, 2022

@Entity({comment: 'A user profile in the wep app.'})
export class User {
...
}

Is this option not implemented?

@nawaz-pasha
Copy link

nawaz-pasha commented Nov 29, 2022

@Entity({comment: 'A user profile in the wep app.'})
export class User {
...
}

Is this option not implemented?

Don't think so.

Looks like as part of the PR #6902, only column comments support was added. Is there a different issue for table comments support?

@manoger
Copy link

manoger commented Feb 13, 2023

@vlapo, I'm facing the same issue as mentioned above by @derushio and @nawaz-pasha .

@gabbrieu
Copy link

gabbrieu commented Aug 1, 2023

Any news to table comments? (MySQL)

It would be good if it were implemented to EntitySchema as well

@Josefh90
Copy link

can we reopen this ? i dont think that table comments are implemented

@block2k
Copy link

block2k commented Oct 19, 2023

table comments are not implement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.