@Generated public class TableConstraintsAPI extends Object
Primary and foreign keys are informational only and are not enforced. Foreign keys must reference a primary key in another table. This primary key is the parent constraint of the foreign key and the table this primary key is on is the parent table of the foreign key. Similarly, the foreign key is the child constraint of its referenced primary key; the table of the foreign key is the child table of the primary key.
You can declare primary keys and foreign keys as part of the table specification during table creation. You can also add or drop constraints on existing tables.
Constructor and Description |
---|
TableConstraintsAPI(ApiClient apiClient)
Regular-use constructor
|
TableConstraintsAPI(TableConstraintsService mock)
Constructor for mocks
|
Modifier and Type | Method and Description |
---|---|
TableConstraint |
create(CreateTableConstraint request)
Create a table constraint.
|
TableConstraint |
create(String fullNameArg,
TableConstraint constraint) |
void |
delete(DeleteTableConstraintRequest request)
Delete a table constraint.
|
void |
delete(String fullName,
String constraintName,
boolean cascade) |
TableConstraintsService |
impl() |
public TableConstraintsAPI(ApiClient apiClient)
public TableConstraintsAPI(TableConstraintsService mock)
public TableConstraint create(String fullNameArg, TableConstraint constraint)
public TableConstraint create(CreateTableConstraint request)
Creates a new table constraint.
For the table constraint creation to succeed, the user must satisfy both of these conditions: - the user must have the **USE_CATALOG** privilege on the table's parent catalog, the **USE_SCHEMA** privilege on the table's parent schema, and be the owner of the table. - if the new constraint is a __ForeignKeyConstraint__, the user must have the **USE_CATALOG** privilege on the referenced parent table's catalog, the **USE_SCHEMA** privilege on the referenced parent table's schema, and be the owner of the referenced parent table.
public void delete(DeleteTableConstraintRequest request)
Deletes a table constraint.
For the table constraint deletion to succeed, the user must satisfy both of these conditions: - the user must have the **USE_CATALOG** privilege on the table's parent catalog, the **USE_SCHEMA** privilege on the table's parent schema, and be the owner of the table. - if __cascade__ argument is **true**, the user must have the following permissions on all of the child tables: the **USE_CATALOG** privilege on the table's catalog, the **USE_SCHEMA** privilege on the table's schema, and be the owner of the table.
public TableConstraintsService impl()
Copyright © 2023. All rights reserved.