1

Is there a way to add foreign constraints in a QLDB table?

Suppose I have two open tables, one with and another without, a primary key. Can I add a foreign key constraint referencing those with a primary key?

Does the same work with indexes? If I don't have any primary keys, but only indexes on the tables, can I add foreign key referencing these indexes?

Arahant
  • 29
  • 1

1 Answers1

1

There is no Primary Key or Foreign Key concept in QLDB at this time.

Document IDs are a closely related concept to Primary Keys in that each Document ID is a universally unique identifier.

To enforce Foreign Constraints on the application-level, you can SELECT before UPDATE or DELETE or DROP TABLE in a transaction to ensure the referential integrity of the Foreign Key.