Foreign Keys
List of foreign keys
Log in using the POST /api/v1/auth/ endpoint
Success: List of foreign keys
Message: unable to fetch engine from external service
GET /api/v1/foreign_keys/{database_id}/ HTTP/1.1
Host: /
Accept: */*
{
"foreign_keys": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"table_id": "123e4567-e89b-12d3-a456-426614174000",
"references_table_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"apply": true,
"is_virtual": true,
"scan_result": 1,
"fk_columns": [
"text"
],
"fk_schema": "text",
"fk_table": "text",
"pk_columns": [
"text"
],
"pk_schema": "text",
"pk_table": "text",
"sync_status": "new"
}
]
}Create virtual foreign key
Log in using the POST /api/v1/auth/ endpoint
Success: Created foreign keys
POST /api/v1/foreign_keys/{database_id}/create/ HTTP/1.1
Host: /
Content-Type: application/json
Accept: */*
Content-Length: 276
{
"foreign_keys": [
{
"name": "text",
"table_id": "123e4567-e89b-12d3-a456-426614174000",
"references_table_id": "123e4567-e89b-12d3-a456-426614174000",
"apply": true,
"fk_columns": [
"text"
],
"fk_schema": "text",
"fk_table": "text",
"pk_columns": [
"text"
],
"pk_schema": "text",
"pk_table": "text"
}
]
}Success: Created foreign keys
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "text",
"errors": [
{
"type": "text",
"message": "text"
}
]
}Export list of foreign keys
Log in using the POST /api/v1/auth/ endpoint
Success: Exported list of foreign keys
Message: unable to fetch engine from external service
GET /api/v1/foreign_keys/{database_id}/export/ HTTP/1.1
Host: /
Accept: */*
{
"foreign_keys": [
{
"apply": true,
"fk_columns": [
"text"
],
"fk_schema": "text",
"fk_table": "text",
"pk_columns": [
"text"
],
"pk_schema": "text",
"pk_table": "text"
}
]
}Filter foreign keys
Log in using the POST /api/v1/auth/ endpoint
Success: Paginated filtered list of foreign keys
Message: unable to fetch engine from external service
POST /api/v1/foreign_keys/{database_id}/filter/ HTTP/1.1
Host: /
Content-Type: application/json
Accept: */*
Content-Length: 102
{
"is_virtual": true,
"is_applied": true,
"fk_columns": [
"text"
],
"pk_columns": [
"text"
],
"table_ids": [
"text"
]
}{
"foreign_keys": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"table_id": "123e4567-e89b-12d3-a456-426614174000",
"references_table_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"apply": true,
"is_virtual": true,
"scan_result": 1,
"fk_columns": [
"text"
],
"fk_schema": "text",
"fk_table": "text",
"pk_columns": [
"text"
],
"pk_schema": "text",
"pk_table": "text",
"sync_status": "new"
}
],
"pagination": {
"total_elements": 1,
"total_pages": 1,
"current_page": 1,
"returned_elements": 1,
"is_last_page": true
}
}Import list of foreign keys
Log in using the POST /api/v1/auth/ endpoint
Success: list of foreign keys imported
Message: unable to fetch engine from external service
POST /api/v1/foreign_keys/{database_id}/import/ HTTP/1.1
Host: /
Content-Type: application/json
Accept: */*
Content-Length: 151
{
"foreign_keys": [
{
"apply": true,
"fk_columns": [
"text"
],
"fk_schema": "text",
"fk_table": "text",
"pk_columns": [
"text"
],
"pk_schema": "text",
"pk_table": "text"
}
]
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "text",
"errors": [
{
"type": "text",
"message": "text"
}
]
}Scan for foreign keys
Log in using the POST /api/v1/auth/ endpoint
Success: Started the job
Message: unable to fetch engine from external service
POST /api/v1/foreign_keys/{database_id}/scan/ HTTP/1.1
Host: /
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "STARTED",
"reason": "text"
}Get foreign keys stats
Log in using the POST /api/v1/auth/ endpoint
Success: foreign keys stats
Message: unable to fetch engine from external service
GET /api/v1/foreign_keys/{database_id}/stats/ HTTP/1.1
Host: /
Accept: */*
{
"n_virtual": 1
}Delete foreign key
Log in using the POST /api/v1/auth/ endpoint
DELETE /api/v1/foreign_keys/{foreign_key_id}/delete/ HTTP/1.1
Host: /
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "text",
"errors": [
{
"type": "text",
"message": "text"
}
]
}Resolve foreign_keys
Log in using the POST /api/v1/auth/ endpoint
Success: Resolved foreign keys
Message: unable to fetch engine from external service
POST /api/v1/foreign_keys/update_batch/ HTTP/1.1
Host: /
Content-Type: application/json
Accept: */*
Content-Length: 320
{
"foreign_keys": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"apply": true,
"name": "text",
"table_id": "123e4567-e89b-12d3-a456-426614174000",
"references_table_id": "123e4567-e89b-12d3-a456-426614174000",
"fk_columns": [
"text"
],
"fk_schema": "text",
"fk_table": "text",
"pk_columns": [
"text"
],
"pk_schema": "text",
"pk_table": "text"
}
]
}{
"foreign_keys": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"table_id": "123e4567-e89b-12d3-a456-426614174000",
"references_table_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"apply": true,
"is_virtual": true,
"scan_result": 1,
"fk_columns": [
"text"
],
"fk_schema": "text",
"fk_table": "text",
"pk_columns": [
"text"
],
"pk_schema": "text",
"pk_table": "text",
"sync_status": "new"
}
]
}Last updated
Was this helpful?

