Foreign Keys

get

List of foreign keys

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
database_idstringRequired
Responses
200

Success: List of foreign keys

application/json
get
/api/v1/foreign_keys/{database_id}/
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"
    }
  ]
}
post

Create virtual foreign key

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
database_idstringRequired
Body
Responses
200

Success: Created foreign keys

application/json
post
/api/v1/foreign_keys/{database_id}/create/
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"
    }
  ]
}
200

Success: Created foreign keys

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "text",
  "errors": [
    {
      "type": "text",
      "message": "text"
    }
  ]
}
get

Export list of foreign keys

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
database_idstringRequired
Responses
200

Success: Exported list of foreign keys

application/json
get
/api/v1/foreign_keys/{database_id}/export/
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"
    }
  ]
}
post

Filter foreign keys

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
database_idstringRequired
Query parameters
elements_per_pageintegerOptional
keywordstringOptional
requested_pageintegerOptional
Body
is_virtualany ofRequired
booleanOptional
or
nullOptional
is_appliedany ofRequired
booleanOptional
or
nullOptional
fk_columnsany ofRequired
string[]Optional
or
nullOptional
pk_columnsany ofRequired
string[]Optional
or
nullOptional
table_idsany ofRequired
string[]Optional
or
nullOptional
Responses
200

Success: Paginated filtered list of foreign keys

application/json
post
/api/v1/foreign_keys/{database_id}/filter/
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
  }
}
post

Import list of foreign keys

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
database_idstringRequired
Body
Responses
200

Success: list of foreign keys imported

application/json
post
/api/v1/foreign_keys/{database_id}/import/
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"
    }
  ]
}
post

Scan for foreign keys

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
database_idstringRequired
Query parameters
allow_pk_stringsbooleanOptional
bidirectional_data_checkbooleanOptional
column_name_checkbooleanOptional
exact_data_type_checkbooleanOptional
n_scannersintegerOptional
pk_scanbooleanOptional
read_batch_sizeintegerOptional
Responses
200

Success: Started the job

application/json
post
/api/v1/foreign_keys/{database_id}/scan/
POST /api/v1/foreign_keys/{database_id}/scan/ HTTP/1.1
Host: /
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "STARTED",
  "reason": "text"
}
get

Get foreign keys stats

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
database_idstringRequired
Responses
200

Success: foreign keys stats

application/json
get
/api/v1/foreign_keys/{database_id}/stats/
GET /api/v1/foreign_keys/{database_id}/stats/ HTTP/1.1
Host: /
Accept: */*
{
  "n_virtual": 1
}
delete

Delete foreign key

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Path parameters
foreign_key_idstringRequired
Responses
200Success
application/json
delete
/api/v1/foreign_keys/{foreign_key_id}/delete/
DELETE /api/v1/foreign_keys/{foreign_key_id}/delete/ HTTP/1.1
Host: /
Accept: */*
200Success
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "text",
  "errors": [
    {
      "type": "text",
      "message": "text"
    }
  ]
}
post

Resolve foreign_keys

Authorizations
sessionidstringRequired

Log in using the POST /api/v1/auth/ endpoint

Body
Responses
200

Success: Resolved foreign keys

application/json
post
/api/v1/foreign_keys/update_batch/
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?