Skip to main content
To model a Postgres table in Tygress you need to create a class and decorate it with the @Table decorator. Once you do this we call the class an . To define columns you need to create fields in the class and decorate them with the @Column decorator. Every needs to have a . Example:

Columns

The @Column allows you to specify column attributes such as nullability, precision or max length.

Indexes

To define an index on a table use the @Index class decorator:
This decorator also allows you to make the index unique and specify include columns, where conditions or a different index method: