Skip to content

Commit 1d5a2f6

Browse files
authored
Describe smart comment support for Enum Types (#267)
1 parent 1189549 commit 1d5a2f6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/pages/postgraphile/enums.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ create table pets (
2121
);
2222
```
2323

24+
The `@enum` smart comments can be used to set the name (`@enumName`)
25+
or the description (`@enumDescription`) of PostgreSQL enums.
26+
27+
e.g.:
28+
```sql
29+
COMMENT ON TYPE animal_type IS E'@enum\n@enumName TypeOfAnimal';
30+
```
31+
2432
Sometimes people prefer not to use PostgreSQL enums due to their technical
2533
limitations (e.g. you can never drop a value from a PostgreSQL enum, and you
2634
cannot add a value to it within a transaction). There are other ways to add

0 commit comments

Comments
 (0)