Skip to content
Snippets Groups Projects
Commit e1306464 authored by Leah Tacke genannt Unterberg's avatar Leah Tacke genannt Unterberg
Browse files

added db mapping export capability (from base package mitm-tooling)

parent a5e4c272
No related branches found
No related tags found
No related merge requests found
Pipeline #611687 passed
...@@ -3,6 +3,10 @@ import mitm_tooling ...@@ -3,6 +3,10 @@ import mitm_tooling
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from mitm_tooling import * from mitm_tooling import *
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from mitm_tooling.data_types import *
# noinspection PyUnresolvedReferences
from mitm_tooling.definition import *
# noinspection PyUnresolvedReferences
from mitm_tooling.extraction.sql.data_models import * from mitm_tooling.extraction.sql.data_models import *
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from mitm_tooling.extraction.sql.data_models.base import * from mitm_tooling.extraction.sql.data_models.base import *
...@@ -13,25 +17,22 @@ from mitm_tooling.extraction.sql.mapping import * ...@@ -13,25 +17,22 @@ from mitm_tooling.extraction.sql.mapping import *
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from mitm_tooling.extraction.sql.transformation import * from mitm_tooling.extraction.sql.transformation import *
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from mitm_tooling.data_types import * from mitm_tooling.io import *
# noinspection PyUnresolvedReferences
from mitm_tooling.definition import *
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from mitm_tooling.representation import * from mitm_tooling.representation import *
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from mitm_tooling.io import *
# noinspection PyUnresolvedReferences
from mitm_tooling.utilities import * from mitm_tooling.utilities import *
__all__ = [ __all__ = [
MITMDataType, SA_SQLTypeName, MITM, MITMDefinition, get_mitm_def, mitm_definitions, MITMDataType, SA_SQLTypeName, MITM, MITMDefinition, get_mitm_def, mitm_definitions,
ExplicitTableSelection, ExplicitColumnSelection, DBMetaQuery, ExplicitTableSelection, ExplicitColumnSelection, DBMetaQuery,
ConceptMapping, GroupValidationResult, MappingExport, ConceptMapping, MappingGroupValidationContext, GroupValidationResult, MappingExport,
ForeignKeyConstraintBase, ForeignKeyConstraintBase, add_foreign_key_constraint,
SchemaName, TableName, SourceDBType, SchemaName, TableName, SourceDBType,
TableMetaInfoBase, DBMetaInfoBase, TableProbeBase, TableMetaInfoBase, DBMetaInfoBase, TableProbeBase,
DBProbeBase, VirtualViewBase, VirtualDBBase, DBProbeBase, VirtualViewBase, VirtualDBBase,
DBProbe, DBMetaInfo, VirtualDB, DBProbe, DBMetaInfo, VirtualDB,
StandaloneDBMapping, DBMapping, VirtualDBCreation,
VirtualViewCreation VirtualViewCreation
] ]
......
import logging import logging
from typing import Annotated from typing import Annotated, Any, Generator
from fastapi import Depends from fastapi import Depends
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
...@@ -41,12 +41,12 @@ WorkingDBConnStateDependency = Annotated[DBConnectionState, Depends(get_working_ ...@@ -41,12 +41,12 @@ WorkingDBConnStateDependency = Annotated[DBConnectionState, Depends(get_working_
WorkingDBMetaStateDependency = Annotated[DBMetadataState, Depends(get_working_db_meta_state)] WorkingDBMetaStateDependency = Annotated[DBMetadataState, Depends(get_working_db_meta_state)]
def get_db_session(db_conn_state: DBConnStateDependency) -> Session: def get_db_session(db_conn_state: DBConnStateDependency) -> Generator[Session, Any, None]:
with db_conn_state.DBSession() as sess: with db_conn_state.DBSession() as sess:
yield sess yield sess
def get_working_db_session(db_conn_state: WorkingDBConnStateDependency) -> Session: def get_working_db_session(db_conn_state: WorkingDBConnStateDependency) -> Generator[Session, Any, None]:
with db_conn_state.DBSession() as sess: with db_conn_state.DBSession() as sess:
yield sess yield sess
......
import pathlib import pathlib
from fastapi import HTTPException from fastapi import HTTPException
from mitm_tooling.extraction.sql.data_models import SourceDBType from app.core import SourceDBType
from starlette import status from starlette import status
from app.dependencies import DBSessionDependency from app.dependencies import DBSessionDependency
from app.models.export import MappingExportRequest from app.models.export import MappingExportRequest
from app.core import Exportable, ConceptMapping, GroupValidationResult from app.core import Exportable, ConceptMapping, GroupValidationResult, MappingGroupValidationContext
from app.core import validation_models, mapping from app.core import validation_models, concept_mapping
from app.core import python_utils from app.core import python_utils
from app.state.db_state import DBMetadataState from app.state.db_state import DBMetadataState
...@@ -19,7 +19,7 @@ async def create_exportable(source_db_meta_state: DBMetadataState, virtual_db_me ...@@ -19,7 +19,7 @@ async def create_exportable(source_db_meta_state: DBMetadataState, virtual_db_me
try: try:
return request.apply(db_metas={SourceDBType.OriginalDB: source_db_meta_state.current_meta, return request.apply(db_metas={SourceDBType.OriginalDB: source_db_meta_state.current_meta,
SourceDBType.VirtualDB: virtual_db_meta_state.current_meta}) SourceDBType.VirtualDB: virtual_db_meta_state.current_meta})
except mapping.ConceptMappingException as e: except concept_mapping.ConceptMappingException as e:
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e)) raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
...@@ -31,7 +31,7 @@ async def validate_mappings(source_db_meta_state: DBMetadataState, virtual_db_me ...@@ -31,7 +31,7 @@ async def validate_mappings(source_db_meta_state: DBMetadataState, virtual_db_me
per_mitm = python_utils.grouped(((cm.mitm, cm) for cm in concept_mappings)) per_mitm = python_utils.grouped(((cm.mitm, cm) for cm in concept_mappings))
for mitm, cms in per_mitm.items(): for mitm, cms in per_mitm.items():
ctxt = mapping.MappingGroupValidationContext.for_mitm(mitm=mitm, db_metas={ ctxt = MappingGroupValidationContext.for_mitm(mitm=mitm, db_metas={
SourceDBType.OriginalDB: source_db_meta_state.current_meta, SourceDBType.OriginalDB: source_db_meta_state.current_meta,
SourceDBType.VirtualDB: virtual_db_meta_state.current_meta}) SourceDBType.VirtualDB: virtual_db_meta_state.current_meta})
for cm in cms: for cm in cms:
......
from app.core import MappingExport import pydantic
from app.core import MappingExport, ConceptMapping, MITM, VirtualViewCreation
class DBMappingExportRequest(pydantic.BaseModel):
mitm: MITM
concept_mappings: list[ConceptMapping]
virtual_view_creations: list[VirtualViewCreation] = pydantic.Field(default_factory=list)
class MappingExportRequest(MappingExport): class MappingExportRequest(MappingExport):
......
...@@ -11,11 +11,6 @@ class MitMDataTypeInfo(pydantic.BaseModel): ...@@ -11,11 +11,6 @@ class MitMDataTypeInfo(pydantic.BaseModel):
MitMDataTypesInfo = dict[MITMDataType, MitMDataTypeInfo] MitMDataTypesInfo = dict[MITMDataType, MitMDataTypeInfo]
class MappingGroupValidationResult(pydantic.BaseModel):
#evaluated_mappings: list[ConceptMapping] | None = None
validation_result: GroupValidationResult
class PublishedMitMResponse(pydantic.BaseModel): class PublishedMitMResponse(pydantic.BaseModel):
url: HttpUrl url: HttpUrl
relative_uri: str relative_uri: str
......
import logging import logging
import pydantic
from fastapi import APIRouter from fastapi import APIRouter
from fastapi import HTTPException from fastapi import HTTPException
from mitm_tooling.extraction.sql.transformation import VirtualDBCreation
from starlette import status from starlette import status
from app.core import SourceDBType, SchemaName, TableName, CompiledVirtualView, \
from mitm_tooling.extraction.sql.data_models import SourceDBType, SchemaName, TableName, CompiledVirtualView, \ DBMetaInfo, VirtualView, CompiledVirtualDB, add_foreign_key_constraint
DBMetaInfo, VirtualView
from mitm_tooling.extraction.sql.db import add_foreign_key_constraint
from app.models.foreign_key import FKCreationResponse, FKCreationRequest
from app.models.virtual_view import VirtualViewResponse, VirtualViewCreationRequest
from app.dependencies import SessionDependency, DBConnStateDependency, DBMetaStateDependency, DBStateDependency, \ from app.dependencies import SessionDependency, DBConnStateDependency, DBMetaStateDependency, DBStateDependency, \
DBSessionDependency DBSessionDependency
from app.dependencies.virtual_db_dependencies import VirtualDBStateDependency from app.dependencies.virtual_db_dependencies import VirtualDBStateDependency
from app.state_accessors.retrievers import retrieve_virtual_view, retrieve_virtual_views from app.models.foreign_key import FKCreationResponse, FKCreationRequest
from app.models.virtual_view import VirtualViewResponse, VirtualViewCreationRequest
from app.state_accessors.retrievers import retrieve_virtual_view, retrieve_virtual_views, retrieve_virtual_db
from app.state_mutators.db_state_mutators import create_and_store_working_db, create_and_store_db_reflection, \ from app.state_mutators.db_state_mutators import create_and_store_working_db, create_and_store_db_reflection, \
update_db_reflection_inplace update_db_reflection_inplace
from app.state_mutators.virtual_db_state_mutators import create_and_store_virtual_view, drop_virtual_view_from_state, \ from app.state_mutators.virtual_db_state_mutators import create_and_store_virtual_view, drop_virtual_view_from_state, \
...@@ -35,7 +33,6 @@ async def init_working_db(session: SessionDependency): ...@@ -35,7 +33,6 @@ async def init_working_db(session: SessionDependency):
await create_and_store_working_db(session) await create_and_store_working_db(session)
@router.post('/mark-foreign-key') @router.post('/mark-foreign-key')
async def mark_foreign_key(source_db_state: DBStateDependency, virtual_db_state: VirtualDBStateDependency, async def mark_foreign_key(source_db_state: DBStateDependency, virtual_db_state: VirtualDBStateDependency,
foreign_key: FKCreationRequest, foreign_key: FKCreationRequest,
...@@ -100,11 +97,18 @@ async def get_compiled_virtual_view(virtual_db_state: VirtualDBStateDependency, ...@@ -100,11 +97,18 @@ async def get_compiled_virtual_view(virtual_db_state: VirtualDBStateDependency,
return vv.as_compiled(db_conn_state.engine.dialect) return vv.as_compiled(db_conn_state.engine.dialect)
@router.get('/compiled-virtual-views') @router.get('/compiled-virtual-db')
async def get_compiled_virtual_views(virtual_db_state: VirtualDBStateDependency, async def get_compiled_virtual_db(virtual_db_state: VirtualDBStateDependency,
db_conn_state: DBConnStateDependency) -> list[CompiledVirtualView]: db_conn_state: DBConnStateDependency) -> CompiledVirtualDB:
vvs = await retrieve_virtual_views(virtual_db_state) vdb = await retrieve_virtual_db(virtual_db_state)
return [vv.as_compiled(db_conn_state.engine.dialect) for vv in vvs.values()] return vdb.as_compiled(db_conn_state.engine.dialect)
@router.get('/virtual-db-creation')
async def get_virtual_db_creation(virtual_db_state: VirtualDBStateDependency,
db_conn_state: DBConnStateDependency) -> VirtualDBCreation:
vdb = await retrieve_virtual_db(virtual_db_state)
return VirtualDBCreation.from_virtual_db(vdb, db_conn_state.engine.dialect)
@router.put('/virtual-views-batch', response_model=list[VirtualViewResponse]) @router.put('/virtual-views-batch', response_model=list[VirtualViewResponse])
......
import logging import logging
from fastapi import APIRouter, BackgroundTasks from fastapi import APIRouter, BackgroundTasks, HTTPException
from pydantic import HttpUrl from pydantic import HttpUrl
from starlette.background import BackgroundTask from starlette.background import BackgroundTask
from starlette.requests import Request from starlette.requests import Request
from starlette.responses import Response from starlette.responses import Response, StreamingResponse
from app.dependencies import DBSessionDependency, DBMetaStateDependency, SessionDependency from app.core import GroupValidationResult
from app.core import StandaloneDBMapping
from app.core import VirtualDBCreation
from app.dependencies import DBSessionDependency, DBMetaStateDependency, SessionDependency, DBConnStateDependency
from app.dependencies.virtual_db_dependencies import VirtualDBStateDependency from app.dependencies.virtual_db_dependencies import VirtualDBStateDependency
from app.export_tools.file_utils import create_session_folder, delete_session_folder from app.export_tools.file_utils import create_session_folder, delete_session_folder
from app.logic.mitm import create_exportable, validate_mappings, exec_export_to_zip_file from app.logic.mitm import create_exportable, validate_mappings, exec_export_to_zip_file
from app.models.export import MappingExportRequest from app.models.export import MappingExportRequest, DBMappingExportRequest
from app.models.mitm import ConceptMappingRequest from app.models.mitm import ConceptMappingRequest, PublishedMitMResponse
from app.models.mitm import MappingGroupValidationResult, PublishedMitMResponse
logger = logging.getLogger('api') logger = logging.getLogger('api')
...@@ -22,24 +24,71 @@ router = APIRouter(prefix='/mitm', tags=['mitm']) ...@@ -22,24 +24,71 @@ router = APIRouter(prefix='/mitm', tags=['mitm'])
@router.post('/validate-concept-mappings') @router.post('/validate-concept-mappings')
async def validate_concept_mappings(source_db_meta_state: DBMetaStateDependency, async def validate_concept_mappings(source_db_meta_state: DBMetaStateDependency,
virtual_db_state: VirtualDBStateDependency, virtual_db_state: VirtualDBStateDependency,
concept_mappings: list[ConceptMappingRequest]) -> MappingGroupValidationResult: concept_mappings: list[ConceptMappingRequest]) -> GroupValidationResult:
result = await validate_mappings(source_db_meta_state, virtual_db_state.to_db_meta_state(), concept_mappings) result = await validate_mappings(source_db_meta_state, virtual_db_state.to_db_meta_state(), concept_mappings)
logger.info('Validated a concept mappings:\n' + str(result)) logger.info('Validated a concept mappings:\n' + str(result))
return MappingGroupValidationResult(validation_result=result) return result
@router.post('/export-mitm', response_class=Response) @router.post('/export-standalone-db-mapping')
async def export_mitm(db_session: DBSessionDependency, source_db_meta_state: DBMetaStateDependency, async def export_standalone_db_mapping(source_db_meta_state: DBMetaStateDependency,
virtual_db_state: VirtualDBStateDependency, request: MappingExportRequest) -> Response: virtual_db_state: VirtualDBStateDependency,
db_conn_state: DBConnStateDependency,
request: DBMappingExportRequest,
include_virtual_db: bool = True,
validate: bool = True) -> StandaloneDBMapping:
from .control import get_compiled_virtual_db
if validate:
gvr = await validate_mappings(source_db_meta_state,
virtual_db_state.to_db_meta_state(),
request.concept_mappings)
if not gvr.is_valid:
raise HTTPException(400, f'The concept mappings are not valid: {gvr.individual_validations}')
if include_virtual_db:
vdbc = await get_compiled_virtual_db(virtual_db_state, db_conn_state)
virtual_db_creation = VirtualDBCreation.from_compiled(vdbc)
else:
virtual_db_creation = VirtualDBCreation()
virtual_db_creation.virtual_view_creations.extend(request.virtual_view_creations)
# error-prone handling of post-processing transforms
# pp_dict = defaultdict(list)
# for pp in request.post_processing.table_postprocessing:
# ti = TableIdentifier.from_any(pp.target_table)
# if ti.source == SourceDBType.VirtualDB:
# pp_dict[ti.as_tuple()].append(pp.transforms)
# for vvc in virtual_db_creation.virtual_view_creations:
# if pps := pp_dict.get(vvc.table_identifier.as_tuple()):
# vvc.transforms = list(itertools.chain(*pps))
return StandaloneDBMapping(mitm=request.mitm,
concept_mappings=request.concept_mappings,
virtual_db_creation=virtual_db_creation)
@router.post('/export-mitm', response_class=StreamingResponse)
async def export_mitm(db_session: DBSessionDependency,
source_db_meta_state: DBMetaStateDependency,
virtual_db_state: VirtualDBStateDependency,
request: MappingExportRequest,
use_streaming: bool = False) -> StreamingResponse:
exportable = await create_exportable(source_db_meta_state, virtual_db_state.to_db_meta_state(), request) exportable = await create_exportable(source_db_meta_state, virtual_db_state.to_db_meta_state(), request)
export = exportable.execute_to_memory(db_session) export = exportable.export_to_memory(db_session)
buf = export.to_buffer() if use_streaming:
byts = buf.getvalue() ze = exportable.export_as_stream(db_session)
headers = {'Content-Disposition': f'attachment; filename="{export.filename}"', data = ze.iter_bytes()
"Content-Length": str(len(byts))} else:
ze = exportable.export_to_memory(db_session)
return Response(byts, headers=headers, media_type='application/zip') data = ze.to_buffer()
headers = {'Content-Disposition': f'attachment; filename="{export.filename}"'}
return StreamingResponse(data,
#media_type='application/zip',
headers=headers)
@router.post('/publish-mitm-export') @router.post('/publish-mitm-export')
...@@ -49,7 +98,7 @@ async def publish_mitm_export(session: SessionDependency, db_session: DBSessionD ...@@ -49,7 +98,7 @@ async def publish_mitm_export(session: SessionDependency, db_session: DBSessionD
background_tasks: BackgroundTasks, background_tasks: BackgroundTasks,
request: MappingExportRequest, request: MappingExportRequest,
req: Request, req: Request,
use_streaming_export: bool = False) -> PublishedMitMResponse: use_streaming: bool = False) -> PublishedMitMResponse:
current_url = str(req.url) current_url = str(req.url)
base_url = current_url.rsplit(router.prefix + '/publish-mitm-export')[0] base_url = current_url.rsplit(router.prefix + '/publish-mitm-export')[0]
logger.info(f'Received (publish) export request from {current_url}.') logger.info(f'Received (publish) export request from {current_url}.')
...@@ -63,7 +112,7 @@ async def publish_mitm_export(session: SessionDependency, db_session: DBSessionD ...@@ -63,7 +112,7 @@ async def publish_mitm_export(session: SessionDependency, db_session: DBSessionD
export_uri = export_uri + f'/{exportable.filename}' export_uri = export_uri + f'/{exportable.filename}'
background_tasks.add_task( background_tasks.add_task(
BackgroundTask(exec_export_to_zip_file, exportable, db_session, export_folder, stream=use_streaming_export)) BackgroundTask(exec_export_to_zip_file, exportable, db_session, export_folder, stream=use_streaming))
logger.info(f'Created asynchronous export task for export_id {export_id} under link {base_url + "/" + export_uri}.') logger.info(f'Created asynchronous export task for export_id {export_id} under link {base_url + "/" + export_uri}.')
deletion_rel_path = router.url_path_for('delete_mitm_export') deletion_rel_path = router.url_path_for('delete_mitm_export')
...@@ -74,7 +123,10 @@ async def publish_mitm_export(session: SessionDependency, db_session: DBSessionD ...@@ -74,7 +123,10 @@ async def publish_mitm_export(session: SessionDependency, db_session: DBSessionD
@router.post('/delete-mitm-export') @router.post('/delete-mitm-export')
async def delete_mitm_export(session: SessionDependency, background_tasks: BackgroundTasks, export_id: int): async def delete_mitm_export(session: SessionDependency, background_tasks: BackgroundTasks, export_id: int):
background_tasks.add_task(BackgroundTask(delete_session_folder, session.session_id, folder_kind='exports', subfolder_id=export_id)) background_tasks.add_task(BackgroundTask(delete_session_folder,
session.session_id,
folder_kind='exports',
subfolder_id=export_id))
@router.post('/delete-mitm-exports') @router.post('/delete-mitm-exports')
......
...@@ -4,7 +4,7 @@ from typing import TypeVar, Callable ...@@ -4,7 +4,7 @@ from typing import TypeVar, Callable
from fastapi import HTTPException from fastapi import HTTPException
from starlette import status from starlette import status
from app.core import TableMetaInfo, TableProbe, VirtualView, TableName, ShortTableIdentifier, SchemaName from app.core import TableMetaInfo, TableProbe, VirtualView, TableName, ShortTableIdentifier, SchemaName, VirtualDB
from app.core import sql_utils from app.core import sql_utils
from app.state.db_state import DBMetadataState, DBProbeState from app.state.db_state import DBMetadataState, DBProbeState
from app.state.virtual_db_state import VirtualDBState from app.state.virtual_db_state import VirtualDBState
...@@ -49,6 +49,9 @@ async def retrieve_virtual_view(virtual_db_state: VirtualDBState, schema: Schema ...@@ -49,6 +49,9 @@ async def retrieve_virtual_view(virtual_db_state: VirtualDBState, schema: Schema
detail=f'Table {sql_utils.qualify(schema=schema, table=view)} is not present in virtual DB ({virtual_db_state.virtual_db.virtual_views}).') detail=f'Table {sql_utils.qualify(schema=schema, table=view)} is not present in virtual DB ({virtual_db_state.virtual_db.virtual_views}).')
) )
async def retrieve_virtual_db(virtual_db_state: VirtualDBState, skip_locking: bool = False) -> VirtualDB:
return await retrieve(lambda: virtual_db_state.virtual_db,
lock=(virtual_db_state.lock if not skip_locking else None))
async def retrieve_virtual_views(virtual_db_state: VirtualDBState, skip_locking: bool = False) -> dict[ async def retrieve_virtual_views(virtual_db_state: VirtualDBState, skip_locking: bool = False) -> dict[
ShortTableIdentifier, VirtualView]: ShortTableIdentifier, VirtualView]:
......
...@@ -3,7 +3,7 @@ from typing import Callable ...@@ -3,7 +3,7 @@ from typing import Callable
import sqlalchemy as sa import sqlalchemy as sa
from app.core import python_utils, DBMetaInfo, VirtualView, TableName, SchemaName, SourceDBType, test_query, make_virtual_view from app.core import python_utils, DBMetaInfo, VirtualView, TableName, SchemaName, SourceDBType, test_query
from app.dependencies.virtual_db_dependencies import VirtualDBStateDependency from app.dependencies.virtual_db_dependencies import VirtualDBStateDependency
from app.models.virtual_view import VirtualViewCreationRequest from app.models.virtual_view import VirtualViewCreationRequest
from app.state.virtual_db_state import VirtualDBState from app.state.virtual_db_state import VirtualDBState
...@@ -40,19 +40,20 @@ async def create_and_store_virtual_view(db_session: sa.orm.Session, virtual_db_s ...@@ -40,19 +40,20 @@ async def create_and_store_virtual_view(db_session: sa.orm.Session, virtual_db_s
raise VirtualViewExists( raise VirtualViewExists(
f'The Virtual View {vv_creation_request.schema_name}.{vv_creation_request.name} already exists.') f'The Virtual View {vv_creation_request.schema_name}.{vv_creation_request.name} already exists.')
queryable_verifier = lambda q: test_query(db_session, q) if verify_immediately else None queryable_verifier = lambda q: test_query(db_session, q) if verify_immediately else None
# this updates sa_meta inplace by table creation # this updates sa_meta inplace by table creation
# throws exception # throws exception
vv = make_virtual_view( vv = vv_creation_request.apply({
{SourceDBType.OriginalDB: source_db_meta, SourceDBType.VirtualDB: virtual_db.to_db_meta_info()}, SourceDBType.OriginalDB: source_db_meta,
vv_creation_request, SourceDBType.VirtualDB: virtual_db.to_db_meta_info()},
override_if_exists=override_if_exists, queryable_verifier=queryable_verifier) override_if_exists=override_if_exists,
queryable_verifier=queryable_verifier)
if vv is not None: if vv is not None:
virtual_db.put_view(vv) virtual_db.put_view(vv)
virtual_db_state.db_probe.current_probe.update_meta(virtual_db.to_db_meta_info()) virtual_db_state.db_probe.current_probe.update_meta(virtual_db.to_db_meta_info())
return vv return vv
return None
async def drop_virtual_view_from_state(virtual_db_state: VirtualDBState, schema: SchemaName, view: TableName): async def drop_virtual_view_from_state(virtual_db_state: VirtualDBState, schema: SchemaName, view: TableName):
......
Subproject commit 54c01ea771f8d31d15b96bce5ec2061d92dc2c97 Subproject commit 9d85aa338928c2a0903d3f5b1ce9aa39e2afe850
...@@ -38,6 +38,7 @@ default-groups = ["test"] ...@@ -38,6 +38,7 @@ default-groups = ["test"]
[tool.uv.sources] [tool.uv.sources]
eralchemy = { path = "forks/eralchemy", editable = true } eralchemy = { path = "forks/eralchemy", editable = true }
mitm-tooling = { git = "https://git-ce.rwth-aachen.de/machine-data/mitm-tooling.git", branch = "develop" }
[build-system] [build-system]
requires = ["hatchling"] requires = ["hatchling"]
......
...@@ -38,3 +38,6 @@ with open('openapi.json', 'w') as f: ...@@ -38,3 +38,6 @@ with open('openapi.json', 'w') as f:
description=app.description, description=app.description,
routes=app.routes routes=app.routes
), f) ), f)
with open('standalone-mapping-schema.yaml', 'w') as f:
from mitm_tooling.extraction.sql.mapping import StandaloneDBMapping
yaml.dump(StandaloneDBMapping.model_json_schema(by_alias=True), f)
\ No newline at end of file
{"openapi": "3.1.0", "info": {"title": "MitMExtractorBackend", "version": "0.1.0"}, "paths": {"/admin/clear-sessions": {"post": {"tags": ["admin"], "summary": "Clear Sessions", "operationId": "clear_sessions", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/admin/active-sessions": {"get": {"tags": ["admin"], "summary": "Get Active Sessions", "operationId": "get_active_sessions", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": {"type": "string", "format": "date-time"}, "propertyNames": {"format": "uuid"}, "type": "object", "title": "Response Get Active Sessions Admin Active Sessions Get"}}}}}}}, "/admin/clear-exports": {"post": {"tags": ["admin"], "summary": "Clear Exports", "operationId": "clear_exports", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/admin/clear-uploads": {"post": {"tags": ["admin"], "summary": "Clear Uploads", "operationId": "clear_uploads", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/definitions/mitms": {"get": {"tags": ["definitions"], "summary": "Get Mitms", "operationId": "get_mitms", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/MITM"}, "type": "array", "title": "Response Get Mitms Definitions Mitms Get"}}}}}}}, "/definitions/mitm-definition": {"get": {"tags": ["definitions"], "summary": "Get Mitm Definition", "operationId": "get_mitm_definition", "parameters": [{"name": "mitm", "in": "query", "required": true, "schema": {"$ref": "#/components/schemas/MITM"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MITMDefinition"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/definitions/mitm-data-types": {"get": {"tags": ["definitions"], "summary": "Get Mitm Data Types", "operationId": "get_mitm_data_types", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": {"$ref": "#/components/schemas/MitMDataTypeInfo"}, "propertyNames": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Response Get Mitm Data Types Definitions Mitm Data Types Get"}}}}}}}, "/session/start-session": {"post": {"tags": ["session"], "summary": "Start Session", "operationId": "start_session", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SessionIdResponse"}}}}}}}, "/session/get-session": {"get": {"tags": ["session"], "summary": "Get Session", "operationId": "get_session", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SessionIdResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/stop-session": {"post": {"tags": ["session"], "summary": "Stop Session", "operationId": "stop_session", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/upload-db": {"post": {"tags": ["session"], "summary": "Upload Db", "operationId": "upload_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_upload_db_session_upload_db_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/connect-db": {"post": {"tags": ["session"], "summary": "Connect Db", "operationId": "connect_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_connect_db_session_connect_db_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/test-db-conn": {"get": {"tags": ["session"], "summary": "Test Db Conn", "operationId": "test_db_conn", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBConnTestResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/keep-alive": {"get": {"tags": ["session"], "summary": "Keep Alive", "operationId": "keep_alive", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KeepAliveResponse"}}}}}}}, "/control/reflect-db": {"post": {"tags": ["control"], "summary": "Reflect Db", "operationId": "reflect_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/init-working-db": {"post": {"tags": ["control"], "summary": "Init Working Db", "operationId": "init_working_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/mark-foreign-key": {"post": {"tags": ["control"], "summary": "Mark Foreign Key", "operationId": "mark_foreign_key", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FKCreationRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FKCreationResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/virtual-view": {"put": {"tags": ["control"], "summary": "Create Virtual View", "operationId": "create_virtual_view", "parameters": [{"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Override If Exists"}}, {"name": "verify_immediately", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Verify Immediately"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VirtualViewCreationRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VirtualViewResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["control"], "summary": "Get Virtual View", "operationId": "get_virtual_view", "parameters": [{"name": "view", "in": "query", "required": true, "schema": {"type": "string", "title": "View"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "virtual", "title": "Schema"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VirtualViewResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["control"], "summary": "Drop Virtual View", "operationId": "drop_virtual_view", "parameters": [{"name": "view", "in": "query", "required": true, "schema": {"type": "string", "title": "View"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "virtual", "title": "Schema"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/virtual-views": {"get": {"tags": ["control"], "summary": "Get Virtual Views", "operationId": "get_virtual_views", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/VirtualViewResponse"}, "title": "Response Get Virtual Views Control Virtual Views Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/compiled-virtual-view": {"get": {"tags": ["control"], "summary": "Get Compiled Virtual View", "operationId": "get_compiled_virtual_view", "parameters": [{"name": "view", "in": "query", "required": true, "schema": {"type": "string", "title": "View"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "virtual", "title": "Schema"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompiledVirtualView"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/compiled-virtual-views": {"get": {"tags": ["control"], "summary": "Get Compiled Virtual Views", "operationId": "get_compiled_virtual_views", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CompiledVirtualView"}, "title": "Response Get Compiled Virtual Views Control Compiled Virtual Views Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/virtual-views-batch": {"put": {"tags": ["control"], "summary": "Create Virtual Views Batch", "operationId": "create_virtual_views_batch", "parameters": [{"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Override If Exists"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/VirtualViewCreationRequest"}, "title": "Requests"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/VirtualViewResponse"}, "title": "Response Create Virtual Views Batch Control Virtual Views Batch Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/raw-query": {"post": {"tags": ["data"], "summary": "Raw Query", "operationId": "raw_query", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_raw_query_data_raw_query_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "array", "items": {}}, "title": "Response Raw Query Data Raw Query Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/query-table": {"get": {"tags": ["data"], "summary": "Query Table", "operationId": "query_table", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "offset", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Offset"}}, {"name": "limit", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Limit"}}, {"name": "include_table_meta", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Table Meta"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TableQueryResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/query-unique-values": {"get": {"tags": ["data"], "summary": "Query Unique Values", "operationId": "query_unique_values", "parameters": [{"name": "table", "in": "query", "required": true, "schema": {"type": "string", "title": "Table"}}, {"name": "column", "in": "query", "required": true, "schema": {"type": "string", "title": "Column"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {}, "title": "Response Query Unique Values Data Query Unique Values Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/er-diagram": {"get": {"tags": ["data"], "summary": "Make Erd", "operationId": "make_erd", "parameters": [{"name": "version", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/ERVariant", "default": "mermaid"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/filtered-er-diagram": {"post": {"tags": ["data"], "summary": "Make Filtered Erd", "operationId": "make_filtered_erd", "parameters": [{"name": "version", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/ERVariant", "default": "mermaid"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBSchemaSelectionRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/table-schema": {"get": {"tags": ["reflection"], "summary": "Get Table Schema", "operationId": "get_table_schema", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TableMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/db-schema": {"get": {"tags": ["reflection"], "summary": "Get Db Schema", "operationId": "get_db_schema", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/filter-db-schema": {"post": {"tags": ["reflection"], "summary": "Filter Db Schema", "operationId": "filter_db_schema", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBSchemaSelectionRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/query-db-schema": {"post": {"tags": ["reflection"], "summary": "Query Db Schema", "operationId": "query_db_schema", "parameters": [{"name": "store_intermediate_table_probes", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Store Intermediate Table Probes"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBSchemaQueryRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/suggest-joins": {"get": {"tags": ["reflection"], "summary": "Suggest Joins", "operationId": "suggest_joins", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "array", "prefixItems": [{"type": "string"}, {"type": "string"}], "minItems": 2, "maxItems": 2}, "title": "Response Suggest Joins Reflection Suggest Joins Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/probe-table": {"post": {"tags": ["reflection"], "summary": "Probe Table", "operationId": "probe_table", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "default": 100, "title": "Sample Size"}}, {"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Override If Exists"}}, {"name": "store_results", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Store Results"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TableProbeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/probe-db": {"post": {"tags": ["reflection"], "summary": "Probe Db", "operationId": "probe_db", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "default": 100, "title": "Sample Size"}}, {"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Override If Exists"}}, {"name": "store_results", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Store Results"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"type": "array", "uniqueItems": true, "items": {"type": "string"}}, "title": "Table Selection"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBProbeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/validate-concept-mappings": {"post": {"tags": ["mitm"], "summary": "Validate Concept Mappings", "operationId": "validate_concept_mappings", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/ConceptMappingRequest"}, "title": "Concept Mappings"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MappingGroupValidationResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/export-mitm": {"post": {"tags": ["mitm"], "summary": "Export Mitm", "operationId": "export_mitm", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MappingExportRequest"}}}}, "responses": {"200": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/publish-mitm-export": {"post": {"tags": ["mitm"], "summary": "Publish Mitm Export", "operationId": "publish_mitm_export", "parameters": [{"name": "use_streaming_export", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Use Streaming Export"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MappingExportRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublishedMitMResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/delete-mitm-export": {"post": {"tags": ["mitm"], "summary": "Delete Mitm Export", "operationId": "delete_mitm_export", "parameters": [{"name": "export_id", "in": "query", "required": true, "schema": {"type": "integer", "title": "Export Id"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/delete-mitm-exports": {"post": {"tags": ["mitm"], "summary": "Delete Mitm Exports", "operationId": "delete_mitm_exports", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/health": {"get": {"summary": "Check Health", "operationId": "check_health", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}}, "components": {"schemas": {"AddColumn": {"properties": {"operation": {"type": "string", "const": "add_column", "title": "Operation", "default": "add_column"}, "col_name": {"type": "string", "title": "Col Name"}, "value": {"title": "Value"}, "target_type": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}], "title": "Target Type"}}, "type": "object", "required": ["col_name", "value", "target_type"], "title": "AddColumn"}, "Body_connect_db_session_connect_db_post": {"properties": {"db_url": {"type": "string", "minLength": 1, "format": "uri", "title": "Db Url"}}, "type": "object", "required": ["db_url"], "title": "Body_connect_db_session_connect_db_post"}, "Body_raw_query_data_raw_query_post": {"properties": {"query": {"type": "string", "title": "Query"}}, "type": "object", "required": ["query"], "title": "Body_raw_query_data_raw_query_post"}, "Body_upload_db_session_upload_db_post": {"properties": {"sqlite": {"type": "string", "format": "binary", "title": "Sqlite", "description": "Upload a sqlite db file here."}}, "type": "object", "required": ["sqlite"], "title": "Body_upload_db_session_upload_db_post"}, "CastColumn": {"properties": {"operation": {"type": "string", "const": "cast_column", "title": "Operation", "default": "cast_column"}, "target_type": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}], "title": "Target Type"}}, "type": "object", "required": ["target_type"], "title": "CastColumn"}, "CategoricalSummaryStatistics": {"properties": {"count": {"type": "integer", "minimum": 0.0, "title": "Count"}, "unique": {"type": "integer", "minimum": 0.0, "title": "Unique"}, "top": {"type": "string", "title": "Top"}, "freq": {"type": "integer", "minimum": 0.0, "title": "Freq"}}, "type": "object", "required": ["count", "unique", "top", "freq"], "title": "CategoricalSummaryStatistics"}, "ColumnProperties": {"properties": {"nullable": {"type": "boolean", "title": "Nullable"}, "unique": {"type": "boolean", "title": "Unique"}, "part_of_pk": {"type": "boolean", "title": "Part Of Pk"}, "part_of_fk": {"type": "boolean", "title": "Part Of Fk"}, "part_of_index": {"type": "boolean", "title": "Part Of Index"}, "mitm_data_type": {"$ref": "#/components/schemas/MITMDataType"}}, "type": "object", "required": ["nullable", "unique", "part_of_pk", "part_of_fk", "part_of_index", "mitm_data_type"], "title": "ColumnProperties"}, "CompiledVirtualView": {"properties": {"dialect": {"type": "string", "title": "Dialect"}, "compiled_sql": {"type": "string", "title": "Compiled Sql"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "column_dtypes": {"items": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}, "type": "array", "title": "Column Dtypes"}, "name": {"type": "string", "title": "Name"}, "schema_name": {"type": "string", "title": "Schema Name"}}, "type": "object", "required": ["dialect", "compiled_sql", "columns", "column_dtypes", "name", "schema_name"], "title": "CompiledVirtualView"}, "ConceptKind": {"type": "string", "enum": ["concrete", "abstract"], "title": "ConceptKind"}, "ConceptLevel": {"type": "string", "enum": ["main", "sub", "weak"], "title": "ConceptLevel"}, "ConceptMapping": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept": {"type": "string", "title": "Concept"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}, "kind_col": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kind Col"}, "type_col": {"type": "string", "title": "Type Col"}, "identity_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Identity Columns"}, "inline_relations": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Inline Relations"}, "foreign_relations": {"additionalProperties": {"$ref": "#/components/schemas/ForeignRelation"}, "type": "object", "title": "Foreign Relations"}, "attributes": {"items": {"type": "string"}, "type": "array", "title": "Attributes"}, "attribute_dtypes": {"items": {"$ref": "#/components/schemas/MITMDataType"}, "type": "array", "title": "Attribute Dtypes"}}, "type": "object", "required": ["mitm", "concept", "base_table", "type_col"], "title": "ConceptMapping"}, "ConceptMappingRequest": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept": {"type": "string", "title": "Concept"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}, "kind_col": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kind Col"}, "type_col": {"type": "string", "title": "Type Col"}, "identity_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Identity Columns"}, "inline_relations": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Inline Relations"}, "foreign_relations": {"additionalProperties": {"$ref": "#/components/schemas/ForeignRelation"}, "type": "object", "title": "Foreign Relations"}, "attributes": {"items": {"type": "string"}, "type": "array", "title": "Attributes"}, "attribute_dtypes": {"items": {"$ref": "#/components/schemas/MITMDataType"}, "type": "array", "title": "Attribute Dtypes"}}, "type": "object", "required": ["mitm", "concept", "base_table", "type_col"], "title": "ConceptMappingRequest"}, "ConceptProperties": {"properties": {"nature": {"prefixItems": [{"$ref": "#/components/schemas/ConceptLevel"}, {"$ref": "#/components/schemas/ConceptKind"}], "type": "array", "maxItems": 2, "minItems": 2, "title": "Nature"}, "key": {"type": "string", "title": "Key"}, "plural": {"type": "string", "title": "Plural"}, "typing_concept": {"type": "string", "title": "Typing Concept", "default": "type"}, "column_group_ordering": {"items": {"type": "string", "enum": ["kind", "type", "identity-relations", "inline-relations", "foreign-relations", "attributes"]}, "type": "array", "title": "Column Group Ordering", "default": ["kind", "type", "identity-relations", "inline-relations", "foreign-relations", "attributes"]}, "permit_attributes": {"type": "boolean", "title": "Permit Attributes", "default": true}}, "type": "object", "required": ["nature", "key", "plural"], "title": "ConceptProperties"}, "DBConnTestResponse": {"properties": {"db_url": {"type": "string", "minLength": 1, "format": "uri", "title": "Db Url"}, "success": {"type": "boolean", "title": "Success"}, "error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Error"}}, "type": "object", "required": ["db_url", "success"], "title": "DBConnTestResponse"}, "DBMetaInfoBase": {"properties": {"db_structure": {"additionalProperties": {"additionalProperties": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "type": "object"}, "type": "object", "title": "Db Structure"}, "tables": {"additionalProperties": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "type": "object", "title": "Tables", "readOnly": true}}, "type": "object", "required": ["db_structure", "tables"], "title": "DBMetaInfoBase"}, "DBMetaInfoResponse": {"properties": {"db_structure": {"additionalProperties": {"additionalProperties": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "type": "object"}, "type": "object", "title": "Db Structure"}, "tables": {"additionalProperties": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "type": "object", "title": "Tables", "readOnly": true}}, "type": "object", "required": ["db_structure", "tables"], "title": "DBMetaInfoResponse"}, "DBMetaQuery": {"properties": {"syntactic_table_conditions": {"items": {"$ref": "#/components/schemas/SyntacticTableCondition"}, "type": "array", "title": "Syntactic Table Conditions"}, "semantic_table_conditions": {"items": {"$ref": "#/components/schemas/SemanticTableCondition"}, "type": "array", "title": "Semantic Table Conditions"}, "syntactic_column_conditions": {"items": {"$ref": "#/components/schemas/SyntacticColumnCondition"}, "type": "array", "title": "Syntactic Column Conditions"}, "semantic_column_conditions": {"items": {"$ref": "#/components/schemas/SemanticColumnCondition"}, "type": "array", "title": "Semantic Column Conditions"}}, "type": "object", "title": "DBMetaQuery"}, "DBProbeResponse": {"properties": {"table_probes": {"additionalProperties": {"$ref": "#/components/schemas/TableProbeBase"}, "type": "object", "title": "Table Probes"}, "db_meta": {"$ref": "#/components/schemas/DBMetaInfoBase"}}, "type": "object", "required": ["db_meta"], "title": "DBProbeResponse"}, "DBSchemaQueryRequest": {"properties": {"query": {"$ref": "#/components/schemas/DBMetaQuery"}, "filter_columns": {"type": "boolean", "title": "Filter Columns", "default": false}}, "type": "object", "required": ["query"], "title": "DBSchemaQueryRequest"}, "DBSchemaSelectionRequest": {"properties": {"selection": {"anyOf": [{"additionalProperties": {"items": {"type": "string"}, "type": "array", "uniqueItems": true}, "type": "object"}, {"additionalProperties": {"additionalProperties": {"items": {"type": "string"}, "type": "array", "uniqueItems": true}, "type": "object"}, "type": "object"}], "title": "Selection"}, "filter_columns": {"type": "boolean", "title": "Filter Columns", "default": false}}, "type": "object", "required": ["selection"], "title": "DBSchemaSelectionRequest"}, "DatetimeSummaryStatistics": {"properties": {"count": {"type": "integer", "title": "Count"}, "mean": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Mean"}, "min": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Min"}, "max": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Max"}, "percentile_25": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Percentile 25"}, "percentile_50": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Percentile 50"}, "percentile_75": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Percentile 75"}}, "type": "object", "required": ["count"], "title": "DatetimeSummaryStatistics"}, "ERVariant": {"type": "string", "enum": ["image", "mermaid"], "title": "ERVariant"}, "EditColumns": {"properties": {"operation": {"type": "string", "const": "edit_columns", "title": "Operation", "default": "edit_columns"}, "transforms": {"additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/CastColumn"}], "discriminator": {"propertyName": "operation", "mapping": {"cast_column": "#/components/schemas/CastColumn"}}}, "type": "object", "title": "Transforms"}, "renames": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Renames"}, "drops": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Drops"}, "additions": {"additionalProperties": {"items": {"oneOf": [{"$ref": "#/components/schemas/AddColumn"}, {"$ref": "#/components/schemas/ExtractJson"}], "discriminator": {"propertyName": "operation", "mapping": {"add_column": "#/components/schemas/AddColumn", "extract_json": "#/components/schemas/ExtractJson"}}}, "type": "array"}, "type": "object", "title": "Additions"}}, "type": "object", "title": "EditColumns"}, "ExistingTable": {"properties": {"operation": {"type": "string", "const": "existing", "title": "Operation", "default": "existing"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}}, "type": "object", "required": ["base_table"], "title": "ExistingTable"}, "ExtractJson": {"properties": {"operation": {"type": "string", "const": "extract_json", "title": "Operation", "default": "extract_json"}, "json_col": {"type": "string", "title": "Json Col"}, "attributes": {"additionalProperties": {"items": {"type": "string"}, "type": "array"}, "type": "object", "title": "Attributes"}}, "type": "object", "required": ["json_col", "attributes"], "title": "ExtractJson"}, "FKCreationRequest": {"properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Table"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "target_table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Target Table"}, "target_columns": {"items": {"type": "string"}, "type": "array", "title": "Target Columns"}}, "type": "object", "required": ["table", "columns", "target_table", "target_columns"], "title": "FKCreationRequest"}, "FKCreationResponse": {"properties": {"status": {"type": "boolean", "title": "Status"}, "error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Error"}}, "type": "object", "required": ["status"], "title": "FKCreationResponse"}, "ForeignKeyConstraintBase": {"properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Table"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "target_table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Target Table"}, "target_columns": {"items": {"type": "string"}, "type": "array", "title": "Target Columns"}}, "type": "object", "required": ["table", "columns", "target_table", "target_columns"], "title": "ForeignKeyConstraintBase"}, "ForeignRelation": {"properties": {"fk_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Fk Columns"}, "referred_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Referred Table"}}, "type": "object", "required": ["fk_columns", "referred_table"], "title": "ForeignRelation"}, "ForeignRelationInfo": {"properties": {"target_concept": {"type": "string", "title": "Target Concept"}, "fk_relations": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Fk Relations"}}, "type": "object", "required": ["target_concept", "fk_relations"], "title": "ForeignRelationInfo"}, "GroupValidationResult": {"properties": {"individual_validations": {"additionalProperties": {"items": {"prefixItems": [{"$ref": "#/components/schemas/TableIdentifier"}, {"$ref": "#/components/schemas/IndividualValidationResult"}], "type": "array", "maxItems": 2, "minItems": 2}, "type": "array"}, "type": "object", "title": "Individual Validations"}, "is_valid": {"type": "boolean", "title": "Is Valid", "readOnly": true}}, "type": "object", "required": ["is_valid"], "title": "GroupValidationResult"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "IndividualValidationResult": {"properties": {"is_valid": {"type": "boolean", "title": "Is Valid", "default": true}, "violations": {"items": {"type": "string"}, "type": "array", "title": "Violations"}}, "type": "object", "title": "IndividualValidationResult"}, "KeepAliveResponse": {"properties": {"server_status": {"type": "string", "const": "available", "title": "Server Status", "default": "available"}, "session_status": {"type": "string", "enum": ["missing session cookie", "session invalid", "session valid"], "title": "Session Status"}}, "type": "object", "required": ["session_status"], "title": "KeepAliveResponse"}, "Limit": {"properties": {"operation": {"type": "string", "const": "limit", "title": "Operation", "default": "limit"}, "limit": {"type": "integer", "title": "Limit"}}, "type": "object", "required": ["limit"], "title": "Limit"}, "LocalTableIdentifier": {"properties": {"name": {"type": "string", "title": "Name"}, "schema": {"type": "string", "title": "Schema", "default": "main"}}, "type": "object", "required": ["name"], "title": "LocalTableIdentifier"}, "MITM": {"type": "string", "enum": ["MAED", "OCEL2"], "title": "MITM"}, "MITMDataType": {"type": "string", "enum": ["text", "json", "integer", "numeric", "boolean", "datetime", "unknown", "infer"], "title": "MITMDataType"}, "MITMDefinition": {"properties": {"main_concepts": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Main Concepts"}, "weak_concepts": {"additionalProperties": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Weak Concepts"}, "sub_concept_map": {"additionalProperties": {"items": {"type": "string"}, "type": "array", "uniqueItems": true}, "type": "object", "title": "Sub Concept Map"}, "concept_relations": {"additionalProperties": {"$ref": "#/components/schemas/OwnedRelations"}, "type": "object", "title": "Concept Relations"}, "concept_properties": {"additionalProperties": {"$ref": "#/components/schemas/ConceptProperties"}, "type": "object", "title": "Concept Properties"}, "leaf_concepts": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Leaf Concepts", "readOnly": true}, "abstract_concepts": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Abstract Concepts", "readOnly": true}, "parent_concept_map": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Parent Concept Map", "readOnly": true}}, "type": "object", "required": ["main_concepts", "weak_concepts", "sub_concept_map", "concept_relations", "concept_properties", "leaf_concepts", "abstract_concepts", "parent_concept_map"], "title": "MITMDefinition"}, "MappingExportRequest": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "mapped_concepts": {"items": {"$ref": "#/components/schemas/ConceptMapping"}, "type": "array", "title": "Mapped Concepts"}, "post_processing": {"anyOf": [{"$ref": "#/components/schemas/PostProcessing"}, {"type": "null"}]}, "filename": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Filename"}}, "type": "object", "required": ["mitm", "mapped_concepts"], "title": "MappingExportRequest"}, "MappingGroupValidationResult": {"properties": {"validation_result": {"$ref": "#/components/schemas/GroupValidationResult"}}, "type": "object", "required": ["validation_result"], "title": "MappingGroupValidationResult"}, "MitMDataTypeInfo": {"properties": {"sql_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sql Type"}}, "type": "object", "required": ["sql_type"], "title": "MitMDataTypeInfo"}, "NumericSummaryStatistics": {"properties": {"count": {"type": "integer", "title": "Count"}, "mean": {"type": "number", "title": "Mean"}, "min": {"type": "number", "title": "Min"}, "max": {"type": "number", "title": "Max"}, "std": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Std"}, "percentile_25": {"type": "number", "title": "Percentile 25"}, "percentile_50": {"type": "number", "title": "Percentile 50"}, "percentile_75": {"type": "number", "title": "Percentile 75"}}, "type": "object", "required": ["count", "mean", "min", "max", "percentile_25", "percentile_50", "percentile_75"], "title": "NumericSummaryStatistics"}, "OwnedRelations": {"properties": {"identity": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Identity"}, "inline": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Inline"}, "foreign": {"additionalProperties": {"$ref": "#/components/schemas/ForeignRelationInfo"}, "type": "object", "title": "Foreign"}}, "type": "object", "required": ["identity", "inline", "foreign"], "title": "OwnedRelations"}, "PostProcessing": {"properties": {"table_postprocessing": {"items": {"$ref": "#/components/schemas/TablePostProcessing"}, "type": "array", "title": "Table Postprocessing"}}, "type": "object", "required": ["table_postprocessing"], "title": "PostProcessing"}, "PublishedMitMResponse": {"properties": {"url": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Url"}, "relative_uri": {"type": "string", "title": "Relative Uri"}, "deletion_request_url": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Deletion Request Url"}, "export_id": {"type": "integer", "title": "Export Id"}}, "type": "object", "required": ["url", "relative_uri", "deletion_request_url", "export_id"], "title": "PublishedMitMResponse"}, "RawCompiled": {"properties": {"operation": {"type": "string", "const": "raw", "title": "Operation", "default": "raw"}, "typed_query": {"$ref": "#/components/schemas/TypedRawQuery"}}, "type": "object", "required": ["typed_query"], "title": "RawCompiled"}, "ReselectColumns": {"properties": {"operation": {"type": "string", "const": "reselect_columns", "title": "Operation", "default": "reselect_columns"}, "selection": {"items": {"type": "string"}, "type": "array", "title": "Selection"}}, "type": "object", "required": ["selection"], "title": "ReselectColumns"}, "SampleSummary": {"properties": {"sample_size": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Sample Size"}, "na_fraction": {"anyOf": [{"type": "number", "maximum": 1.0, "minimum": 0.0}, {"type": "null"}], "title": "Na Fraction"}, "unique_fraction": {"anyOf": [{"type": "number", "maximum": 1.0, "minimum": 0.0}, {"type": "null"}], "title": "Unique Fraction"}, "value_counts": {"anyOf": [{"additionalProperties": {"type": "integer"}, "type": "object"}, {"type": "null"}], "title": "Value Counts"}, "summary_statistics": {"anyOf": [{"$ref": "#/components/schemas/NumericSummaryStatistics"}, {"$ref": "#/components/schemas/CategoricalSummaryStatistics"}, {"$ref": "#/components/schemas/DatetimeSummaryStatistics"}, {"type": "null"}], "title": "Summary Statistics"}, "json_schema": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Json Schema"}}, "type": "object", "title": "SampleSummary"}, "SemanticColumnCondition": {"properties": {"inferred_data_type": {"anyOf": [{"$ref": "#/components/schemas/MITMDataType"}, {"type": "null"}]}, "max_na_fraction": {"anyOf": [{"type": "number", "maximum": 1.0, "minimum": 0.0}, {"type": "null"}], "title": "Max Na Fraction"}, "value_in_range": {"anyOf": [{}, {"type": "null"}], "title": "Value In Range"}, "contained_value": {"anyOf": [{}, {"type": "null"}], "title": "Contained Value"}, "contained_datetime": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Contained Datetime"}}, "type": "object", "title": "SemanticColumnCondition"}, "SemanticTableCondition": {"properties": {"min_row_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Min Row Count"}, "max_row_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Max Row Count"}}, "type": "object", "title": "SemanticTableCondition"}, "SessionIdResponse": {"properties": {"session_id": {"type": "string", "format": "uuid", "title": "Session Id"}}, "type": "object", "required": ["session_id"], "title": "SessionIdResponse"}, "SimpleJoin": {"properties": {"operation": {"type": "string", "const": "join", "title": "Operation", "default": "join"}, "left_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Left Table"}, "right_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Right Table"}, "on_cols_left": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "On Cols Left"}, "on_cols_right": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "On Cols Right"}, "is_outer": {"type": "boolean", "title": "Is Outer", "default": false}, "full": {"type": "boolean", "title": "Full", "default": false}, "selected_cols_left": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Selected Cols Left"}, "selected_cols_right": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Selected Cols Right"}, "left_alias": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Left Alias"}, "right_alias": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Right Alias"}}, "type": "object", "required": ["left_table", "right_table"], "title": "SimpleJoin"}, "SimpleSQLOperator": {"type": "string", "enum": ["ilike", "like", "eq", "ge", "gt", "le", "lt", "in", "notin"], "title": "SimpleSQLOperator"}, "SimpleWhere": {"properties": {"lhs": {"type": "string", "title": "Lhs"}, "operator": {"$ref": "#/components/schemas/SimpleSQLOperator"}, "rhs": {"anyOf": [{"type": "string"}, {"prefixItems": [{}, {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Rhs"}}, "type": "object", "required": ["lhs", "operator", "rhs"], "title": "SimpleWhere"}, "SourceDBType": {"type": "string", "enum": ["original", "working", "virtual"], "title": "SourceDBType"}, "SyntacticColumnCondition": {"properties": {"name_regex": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Regex"}, "sql_data_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sql Data Type"}, "mitm_data_type": {"anyOf": [{"$ref": "#/components/schemas/MITMDataType"}, {"type": "null"}]}}, "type": "object", "title": "SyntacticColumnCondition"}, "SyntacticTableCondition": {"properties": {"schema_regex": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Schema Regex"}, "name_regex": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Regex"}, "min_col_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Min Col Count"}, "max_col_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Max Col Count"}, "has_foreign_key": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Has Foreign Key"}}, "type": "object", "title": "SyntacticTableCondition"}, "TableFilter": {"properties": {"operation": {"type": "string", "const": "table_filter", "title": "Operation", "default": "table_filter"}, "wheres": {"items": {"$ref": "#/components/schemas/SimpleWhere"}, "type": "array", "title": "Wheres"}, "limit": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Limit"}}, "type": "object", "required": ["wheres"], "title": "TableFilter"}, "TableIdentifier": {"properties": {"source": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}, "schema": {"type": "string", "title": "Schema", "default": "main"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["name"], "title": "TableIdentifier"}, "TableMetaInfoBase": {"properties": {"schema_name": {"type": "string", "title": "Schema Name", "default": "main"}, "name": {"type": "string", "title": "Name"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "sql_column_types": {"items": {"type": "string"}, "type": "array", "title": "Sql Column Types"}, "primary_key": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Primary Key"}, "indexes": {"anyOf": [{"items": {"items": {"type": "string"}, "type": "array"}, "type": "array"}, {"type": "null"}], "title": "Indexes"}, "foreign_key_constraints": {"items": {"$ref": "#/components/schemas/ForeignKeyConstraintBase"}, "type": "array", "title": "Foreign Key Constraints"}, "column_properties": {"additionalProperties": {"$ref": "#/components/schemas/ColumnProperties"}, "type": "object", "title": "Column Properties"}}, "type": "object", "required": ["name", "columns", "sql_column_types"], "title": "TableMetaInfoBase"}, "TableMetaInfoResponse": {"properties": {"schema_name": {"type": "string", "title": "Schema Name", "default": "main"}, "name": {"type": "string", "title": "Name"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "sql_column_types": {"items": {"type": "string"}, "type": "array", "title": "Sql Column Types"}, "primary_key": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Primary Key"}, "indexes": {"anyOf": [{"items": {"items": {"type": "string"}, "type": "array"}, "type": "array"}, {"type": "null"}], "title": "Indexes"}, "foreign_key_constraints": {"items": {"$ref": "#/components/schemas/ForeignKeyConstraintBase"}, "type": "array", "title": "Foreign Key Constraints"}, "column_properties": {"additionalProperties": {"$ref": "#/components/schemas/ColumnProperties"}, "type": "object", "title": "Column Properties"}}, "type": "object", "required": ["name", "columns", "sql_column_types"], "title": "TableMetaInfoResponse"}, "TablePostProcessing": {"properties": {"target_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Target Table"}, "transforms": {"items": {"oneOf": [{"$ref": "#/components/schemas/EditColumns"}, {"$ref": "#/components/schemas/ReselectColumns"}, {"$ref": "#/components/schemas/TableFilter"}, {"$ref": "#/components/schemas/Limit"}], "discriminator": {"propertyName": "operation", "mapping": {"edit_columns": "#/components/schemas/EditColumns", "limit": "#/components/schemas/Limit", "reselect_columns": "#/components/schemas/ReselectColumns", "table_filter": "#/components/schemas/TableFilter"}}}, "type": "array", "title": "Transforms"}}, "type": "object", "required": ["target_table", "transforms"], "title": "TablePostProcessing"}, "TableProbeBase": {"properties": {"row_count": {"type": "integer", "minimum": 0.0, "title": "Row Count"}, "inferred_types": {"additionalProperties": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Inferred Types"}, "sample_summaries": {"additionalProperties": {"$ref": "#/components/schemas/SampleSummary"}, "type": "object", "title": "Sample Summaries"}, "table_meta": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "sampled_values": {"additionalProperties": {"items": {}, "type": "array"}, "type": "object", "title": "Sampled Values"}}, "type": "object", "required": ["row_count", "inferred_types", "sample_summaries", "table_meta", "sampled_values"], "title": "TableProbeBase"}, "TableProbeResponse": {"properties": {"row_count": {"type": "integer", "minimum": 0.0, "title": "Row Count"}, "inferred_types": {"additionalProperties": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Inferred Types"}, "sample_summaries": {"additionalProperties": {"$ref": "#/components/schemas/SampleSummary"}, "type": "object", "title": "Sample Summaries"}, "table_meta": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "sampled_values": {"additionalProperties": {"items": {}, "type": "array"}, "type": "object", "title": "Sampled Values"}}, "type": "object", "required": ["row_count", "inferred_types", "sample_summaries", "table_meta", "sampled_values"], "title": "TableProbeResponse"}, "TableQueryResult": {"properties": {"table_info": {"anyOf": [{"$ref": "#/components/schemas/TableMetaInfoResponse"}, {"type": "null"}]}, "rows": {"items": {"items": {}, "type": "array"}, "type": "array", "title": "Rows"}}, "type": "object", "required": ["table_info", "rows"], "title": "TableQueryResult"}, "TypedRawQuery": {"properties": {"dialect": {"type": "string", "title": "Dialect"}, "compiled_sql": {"type": "string", "title": "Compiled Sql"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "column_dtypes": {"items": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}, "type": "array", "title": "Column Dtypes"}}, "type": "object", "required": ["dialect", "compiled_sql", "columns", "column_dtypes"], "title": "TypedRawQuery"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "VirtualViewCreationRequest": {"properties": {"name": {"type": "string", "title": "Name"}, "table_creation": {"oneOf": [{"$ref": "#/components/schemas/SimpleJoin"}, {"$ref": "#/components/schemas/ExistingTable"}, {"$ref": "#/components/schemas/RawCompiled"}], "title": "Table Creation", "discriminator": {"propertyName": "operation", "mapping": {"existing": "#/components/schemas/ExistingTable", "join": "#/components/schemas/SimpleJoin", "raw": "#/components/schemas/RawCompiled"}}}, "transforms": {"anyOf": [{"items": {"oneOf": [{"$ref": "#/components/schemas/EditColumns"}, {"$ref": "#/components/schemas/ReselectColumns"}, {"$ref": "#/components/schemas/TableFilter"}, {"$ref": "#/components/schemas/Limit"}], "discriminator": {"propertyName": "operation", "mapping": {"edit_columns": "#/components/schemas/EditColumns", "limit": "#/components/schemas/Limit", "reselect_columns": "#/components/schemas/ReselectColumns", "table_filter": "#/components/schemas/TableFilter"}}}, "type": "array"}, {"type": "null"}], "title": "Transforms"}, "schema": {"type": "string", "title": "Schema", "default": "virtual"}}, "type": "object", "required": ["name", "table_creation"], "title": "VirtualViewCreationRequest"}, "VirtualViewResponse": {"properties": {"table_meta": {"$ref": "#/components/schemas/TableMetaInfoResponse"}}, "type": "object", "required": ["table_meta"], "title": "VirtualViewResponse"}, "WrappedMITMDataType": {"properties": {"mitm": {"$ref": "#/components/schemas/MITMDataType"}}, "type": "object", "required": ["mitm"], "title": "WrappedMITMDataType"}}}} {"openapi": "3.1.0", "info": {"title": "MitMExtractorBackend", "version": "0.1.0"}, "paths": {"/admin/clear-sessions": {"post": {"tags": ["admin"], "summary": "Clear Sessions", "operationId": "clear_sessions", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/admin/active-sessions": {"get": {"tags": ["admin"], "summary": "Get Active Sessions", "operationId": "get_active_sessions", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": {"type": "string", "format": "date-time"}, "propertyNames": {"format": "uuid"}, "type": "object", "title": "Response Get Active Sessions Admin Active Sessions Get"}}}}}}}, "/admin/clear-exports": {"post": {"tags": ["admin"], "summary": "Clear Exports", "operationId": "clear_exports", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/admin/clear-uploads": {"post": {"tags": ["admin"], "summary": "Clear Uploads", "operationId": "clear_uploads", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/definitions/mitms": {"get": {"tags": ["definitions"], "summary": "Get Mitms", "operationId": "get_mitms", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/MITM"}, "type": "array", "title": "Response Get Mitms Definitions Mitms Get"}}}}}}}, "/definitions/mitm-definition": {"get": {"tags": ["definitions"], "summary": "Get Mitm Definition", "operationId": "get_mitm_definition", "parameters": [{"name": "mitm", "in": "query", "required": true, "schema": {"$ref": "#/components/schemas/MITM"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MITMDefinition"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/definitions/mitm-data-types": {"get": {"tags": ["definitions"], "summary": "Get Mitm Data Types", "operationId": "get_mitm_data_types", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": {"$ref": "#/components/schemas/MitMDataTypeInfo"}, "propertyNames": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Response Get Mitm Data Types Definitions Mitm Data Types Get"}}}}}}}, "/session/start-session": {"post": {"tags": ["session"], "summary": "Start Session", "operationId": "start_session", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SessionIdResponse"}}}}}}}, "/session/get-session": {"get": {"tags": ["session"], "summary": "Get Session", "operationId": "get_session", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SessionIdResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/stop-session": {"post": {"tags": ["session"], "summary": "Stop Session", "operationId": "stop_session", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/upload-db": {"post": {"tags": ["session"], "summary": "Upload Db", "operationId": "upload_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_upload_db_session_upload_db_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/connect-db": {"post": {"tags": ["session"], "summary": "Connect Db", "operationId": "connect_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_connect_db_session_connect_db_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/test-db-conn": {"get": {"tags": ["session"], "summary": "Test Db Conn", "operationId": "test_db_conn", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBConnTestResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/session/keep-alive": {"get": {"tags": ["session"], "summary": "Keep Alive", "operationId": "keep_alive", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KeepAliveResponse"}}}}}}}, "/control/reflect-db": {"post": {"tags": ["control"], "summary": "Reflect Db", "operationId": "reflect_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/init-working-db": {"post": {"tags": ["control"], "summary": "Init Working Db", "operationId": "init_working_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/mark-foreign-key": {"post": {"tags": ["control"], "summary": "Mark Foreign Key", "operationId": "mark_foreign_key", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FKCreationRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FKCreationResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/virtual-view": {"put": {"tags": ["control"], "summary": "Create Virtual View", "operationId": "create_virtual_view", "parameters": [{"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Override If Exists"}}, {"name": "verify_immediately", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Verify Immediately"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VirtualViewCreationRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VirtualViewResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["control"], "summary": "Get Virtual View", "operationId": "get_virtual_view", "parameters": [{"name": "view", "in": "query", "required": true, "schema": {"type": "string", "title": "View"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "virtual", "title": "Schema"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VirtualViewResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["control"], "summary": "Drop Virtual View", "operationId": "drop_virtual_view", "parameters": [{"name": "view", "in": "query", "required": true, "schema": {"type": "string", "title": "View"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "virtual", "title": "Schema"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/virtual-views": {"get": {"tags": ["control"], "summary": "Get Virtual Views", "operationId": "get_virtual_views", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/VirtualViewResponse"}, "title": "Response Get Virtual Views Control Virtual Views Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/compiled-virtual-view": {"get": {"tags": ["control"], "summary": "Get Compiled Virtual View", "operationId": "get_compiled_virtual_view", "parameters": [{"name": "view", "in": "query", "required": true, "schema": {"type": "string", "title": "View"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "virtual", "title": "Schema"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompiledVirtualView"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/compiled-virtual-db": {"get": {"tags": ["control"], "summary": "Get Compiled Virtual Db", "operationId": "get_compiled_virtual_db", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompiledVirtualDB"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/virtual-db-creation": {"get": {"tags": ["control"], "summary": "Get Virtual Db Creation", "operationId": "get_virtual_db_creation", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VirtualDBCreation"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/control/virtual-views-batch": {"put": {"tags": ["control"], "summary": "Create Virtual Views Batch", "operationId": "create_virtual_views_batch", "parameters": [{"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Override If Exists"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/VirtualViewCreationRequest"}, "title": "Requests"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/VirtualViewResponse"}, "title": "Response Create Virtual Views Batch Control Virtual Views Batch Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/raw-query": {"post": {"tags": ["data"], "summary": "Raw Query", "operationId": "raw_query", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_raw_query_data_raw_query_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "array", "items": {}}, "title": "Response Raw Query Data Raw Query Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/query-table": {"get": {"tags": ["data"], "summary": "Query Table", "operationId": "query_table", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "offset", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Offset"}}, {"name": "limit", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Limit"}}, {"name": "include_table_meta", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Table Meta"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TableQueryResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/query-unique-values": {"get": {"tags": ["data"], "summary": "Query Unique Values", "operationId": "query_unique_values", "parameters": [{"name": "table", "in": "query", "required": true, "schema": {"type": "string", "title": "Table"}}, {"name": "column", "in": "query", "required": true, "schema": {"type": "string", "title": "Column"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {}, "title": "Response Query Unique Values Data Query Unique Values Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/er-diagram": {"get": {"tags": ["data"], "summary": "Make Erd", "operationId": "make_erd", "parameters": [{"name": "version", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/ERVariant", "default": "mermaid"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/data/filtered-er-diagram": {"post": {"tags": ["data"], "summary": "Make Filtered Erd", "operationId": "make_filtered_erd", "parameters": [{"name": "version", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/ERVariant", "default": "mermaid"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBSchemaSelectionRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/table-schema": {"get": {"tags": ["reflection"], "summary": "Get Table Schema", "operationId": "get_table_schema", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TableMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/db-schema": {"get": {"tags": ["reflection"], "summary": "Get Db Schema", "operationId": "get_db_schema", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/filter-db-schema": {"post": {"tags": ["reflection"], "summary": "Filter Db Schema", "operationId": "filter_db_schema", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBSchemaSelectionRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/query-db-schema": {"post": {"tags": ["reflection"], "summary": "Query Db Schema", "operationId": "query_db_schema", "parameters": [{"name": "store_intermediate_table_probes", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Store Intermediate Table Probes"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBSchemaQueryRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBMetaInfoResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/suggest-joins": {"get": {"tags": ["reflection"], "summary": "Suggest Joins", "operationId": "suggest_joins", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "array", "prefixItems": [{"type": "string"}, {"type": "string"}], "minItems": 2, "maxItems": 2}, "title": "Response Suggest Joins Reflection Suggest Joins Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/probe-table": {"post": {"tags": ["reflection"], "summary": "Probe Table", "operationId": "probe_table", "parameters": [{"name": "name", "in": "query", "required": true, "schema": {"type": "string", "title": "Name"}}, {"name": "schema", "in": "query", "required": false, "schema": {"type": "string", "default": "main", "title": "Schema"}}, {"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "default": 100, "title": "Sample Size"}}, {"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Override If Exists"}}, {"name": "store_results", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Store Results"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TableProbeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/reflection/probe-db": {"post": {"tags": ["reflection"], "summary": "Probe Db", "operationId": "probe_db", "parameters": [{"name": "source", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}}, {"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "default": 100, "title": "Sample Size"}}, {"name": "override_if_exists", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Override If Exists"}}, {"name": "store_results", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Store Results"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"type": "array", "uniqueItems": true, "items": {"type": "string"}}, "title": "Table Selection"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBProbeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/validate-concept-mappings": {"post": {"tags": ["mitm"], "summary": "Validate Concept Mappings", "operationId": "validate_concept_mappings", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/ConceptMappingRequest"}, "title": "Concept Mappings"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GroupValidationResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/export-standalone-db-mapping": {"post": {"tags": ["mitm"], "summary": "Export Standalone Db Mapping", "operationId": "export_standalone_db_mapping", "parameters": [{"name": "include_virtual_db", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Include Virtual Db"}}, {"name": "validate", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Validate"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DBMappingExportRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StandaloneDBMapping"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/export-mitm": {"post": {"tags": ["mitm"], "summary": "Export Mitm", "operationId": "export_mitm", "parameters": [{"name": "use_streaming", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Use Streaming"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MappingExportRequest"}}}}, "responses": {"200": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/publish-mitm-export": {"post": {"tags": ["mitm"], "summary": "Publish Mitm Export", "operationId": "publish_mitm_export", "parameters": [{"name": "use_streaming", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Use Streaming"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MappingExportRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublishedMitMResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/delete-mitm-export": {"post": {"tags": ["mitm"], "summary": "Delete Mitm Export", "operationId": "delete_mitm_export", "parameters": [{"name": "export_id", "in": "query", "required": true, "schema": {"type": "integer", "title": "Export Id"}}, {"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/mitm/delete-mitm-exports": {"post": {"tags": ["mitm"], "summary": "Delete Mitm Exports", "operationId": "delete_mitm_exports", "parameters": [{"name": "simple_session", "in": "cookie", "required": true, "schema": {"type": "string", "title": "Simple Session"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/health": {"get": {"summary": "Check Health", "operationId": "check_health", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}}, "components": {"schemas": {"AddColumn-Input": {"properties": {"operation": {"type": "string", "const": "add_column", "title": "Operation", "default": "add_column"}, "col_name": {"type": "string", "title": "Col Name"}, "value": {"title": "Value"}, "target_type": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}], "title": "Target Type"}}, "type": "object", "required": ["col_name", "value", "target_type"], "title": "AddColumn"}, "AddColumn-Output": {"properties": {"operation": {"type": "string", "const": "add_column", "title": "Operation", "default": "add_column"}, "col_name": {"type": "string", "title": "Col Name"}, "value": {"title": "Value"}, "target_type": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}], "title": "Target Type"}}, "type": "object", "required": ["col_name", "value", "target_type"], "title": "AddColumn"}, "Body_connect_db_session_connect_db_post": {"properties": {"db_url": {"type": "string", "minLength": 1, "format": "uri", "title": "Db Url"}}, "type": "object", "required": ["db_url"], "title": "Body_connect_db_session_connect_db_post"}, "Body_raw_query_data_raw_query_post": {"properties": {"query": {"type": "string", "title": "Query"}}, "type": "object", "required": ["query"], "title": "Body_raw_query_data_raw_query_post"}, "Body_upload_db_session_upload_db_post": {"properties": {"sqlite": {"type": "string", "format": "binary", "title": "Sqlite", "description": "Upload a sqlite db file here."}}, "type": "object", "required": ["sqlite"], "title": "Body_upload_db_session_upload_db_post"}, "CastColumn-Input": {"properties": {"operation": {"type": "string", "const": "cast_column", "title": "Operation", "default": "cast_column"}, "target_type": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}], "title": "Target Type"}}, "type": "object", "required": ["target_type"], "title": "CastColumn"}, "CastColumn-Output": {"properties": {"operation": {"type": "string", "const": "cast_column", "title": "Operation", "default": "cast_column"}, "target_type": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}], "title": "Target Type"}}, "type": "object", "required": ["target_type"], "title": "CastColumn"}, "CategoricalSummaryStatistics": {"properties": {"count": {"type": "integer", "minimum": 0.0, "title": "Count"}, "unique": {"type": "integer", "minimum": 0.0, "title": "Unique"}, "top": {"type": "string", "title": "Top"}, "freq": {"type": "integer", "minimum": 0.0, "title": "Freq"}}, "type": "object", "required": ["count", "unique", "top", "freq"], "title": "CategoricalSummaryStatistics"}, "ColumnProperties": {"properties": {"nullable": {"type": "boolean", "title": "Nullable"}, "unique": {"type": "boolean", "title": "Unique"}, "part_of_pk": {"type": "boolean", "title": "Part Of Pk"}, "part_of_fk": {"type": "boolean", "title": "Part Of Fk"}, "part_of_index": {"type": "boolean", "title": "Part Of Index"}, "mitm_data_type": {"$ref": "#/components/schemas/MITMDataType"}}, "type": "object", "required": ["nullable", "unique", "part_of_pk", "part_of_fk", "part_of_index", "mitm_data_type"], "title": "ColumnProperties"}, "CompiledVirtualDB": {"properties": {"compiled_virtual_views": {"items": {"$ref": "#/components/schemas/CompiledVirtualView"}, "type": "array", "title": "Compiled Virtual Views"}, "views": {"additionalProperties": {"$ref": "#/components/schemas/CompiledVirtualView"}, "type": "object", "title": "Views", "readOnly": true}}, "type": "object", "required": ["views"], "title": "CompiledVirtualDB"}, "CompiledVirtualView": {"properties": {"dialect": {"type": "string", "title": "Dialect"}, "compiled_sql": {"type": "string", "title": "Compiled Sql"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "column_dtypes": {"items": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}, "type": "array", "title": "Column Dtypes"}, "name": {"type": "string", "title": "Name"}, "schema_name": {"type": "string", "title": "Schema Name"}}, "type": "object", "required": ["dialect", "compiled_sql", "columns", "column_dtypes", "name", "schema_name"], "title": "CompiledVirtualView"}, "ConceptKind": {"type": "string", "enum": ["concrete", "abstract"], "title": "ConceptKind"}, "ConceptLevel": {"type": "string", "enum": ["main", "sub", "weak"], "title": "ConceptLevel"}, "ConceptMapping-Input": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept": {"type": "string", "title": "Concept"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}, "kind_col": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kind Col"}, "type_col": {"type": "string", "title": "Type Col"}, "identity_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Identity Columns"}, "inline_relations": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Inline Relations"}, "foreign_relations": {"additionalProperties": {"$ref": "#/components/schemas/ForeignRelation-Input"}, "type": "object", "title": "Foreign Relations"}, "attributes": {"items": {"type": "string"}, "type": "array", "title": "Attributes"}, "attribute_dtypes": {"items": {"$ref": "#/components/schemas/MITMDataType"}, "type": "array", "title": "Attribute Dtypes"}}, "type": "object", "required": ["mitm", "concept", "base_table", "type_col"], "title": "ConceptMapping"}, "ConceptMapping-Output": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept": {"type": "string", "title": "Concept"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}, "kind_col": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kind Col"}, "type_col": {"type": "string", "title": "Type Col"}, "identity_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Identity Columns"}, "inline_relations": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Inline Relations"}, "foreign_relations": {"additionalProperties": {"$ref": "#/components/schemas/ForeignRelation-Output"}, "type": "object", "title": "Foreign Relations"}, "attributes": {"items": {"type": "string"}, "type": "array", "title": "Attributes"}, "attribute_dtypes": {"items": {"$ref": "#/components/schemas/MITMDataType"}, "type": "array", "title": "Attribute Dtypes"}}, "type": "object", "required": ["mitm", "concept", "base_table", "type_col"], "title": "ConceptMapping"}, "ConceptMappingRequest": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept": {"type": "string", "title": "Concept"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}, "kind_col": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kind Col"}, "type_col": {"type": "string", "title": "Type Col"}, "identity_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Identity Columns"}, "inline_relations": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Inline Relations"}, "foreign_relations": {"additionalProperties": {"$ref": "#/components/schemas/ForeignRelation-Input"}, "type": "object", "title": "Foreign Relations"}, "attributes": {"items": {"type": "string"}, "type": "array", "title": "Attributes"}, "attribute_dtypes": {"items": {"$ref": "#/components/schemas/MITMDataType"}, "type": "array", "title": "Attribute Dtypes"}}, "type": "object", "required": ["mitm", "concept", "base_table", "type_col"], "title": "ConceptMappingRequest"}, "ConceptProperties": {"properties": {"nature": {"prefixItems": [{"$ref": "#/components/schemas/ConceptLevel"}, {"$ref": "#/components/schemas/ConceptKind"}], "type": "array", "maxItems": 2, "minItems": 2, "title": "Nature"}, "key": {"type": "string", "title": "Key"}, "plural": {"type": "string", "title": "Plural"}, "typing_concept": {"type": "string", "title": "Typing Concept", "default": "type"}, "column_group_ordering": {"items": {"type": "string", "enum": ["kind", "type", "identity-relations", "inline-relations", "foreign-relations", "attributes"]}, "type": "array", "title": "Column Group Ordering", "default": ["kind", "type", "identity-relations", "inline-relations", "foreign-relations", "attributes"]}, "permit_attributes": {"type": "boolean", "title": "Permit Attributes", "default": true}}, "type": "object", "required": ["nature", "key", "plural"], "title": "ConceptProperties"}, "DBConnTestResponse": {"properties": {"db_url": {"type": "string", "minLength": 1, "format": "uri", "title": "Db Url"}, "success": {"type": "boolean", "title": "Success"}, "error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Error"}}, "type": "object", "required": ["db_url", "success"], "title": "DBConnTestResponse"}, "DBMappingExportRequest": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept_mappings": {"items": {"$ref": "#/components/schemas/ConceptMapping-Input"}, "type": "array", "title": "Concept Mappings"}, "virtual_view_creations": {"items": {"$ref": "#/components/schemas/VirtualViewCreation-Input"}, "type": "array", "title": "Virtual View Creations"}}, "type": "object", "required": ["mitm", "concept_mappings"], "title": "DBMappingExportRequest"}, "DBMetaInfoBase": {"properties": {"db_structure": {"additionalProperties": {"additionalProperties": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "type": "object"}, "type": "object", "title": "Db Structure"}}, "type": "object", "required": ["db_structure"], "title": "DBMetaInfoBase"}, "DBMetaInfoResponse": {"properties": {"db_structure": {"additionalProperties": {"additionalProperties": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "type": "object"}, "type": "object", "title": "Db Structure"}}, "type": "object", "required": ["db_structure"], "title": "DBMetaInfoResponse"}, "DBMetaQuery": {"properties": {"syntactic_table_conditions": {"items": {"$ref": "#/components/schemas/SyntacticTableCondition"}, "type": "array", "title": "Syntactic Table Conditions"}, "semantic_table_conditions": {"items": {"$ref": "#/components/schemas/SemanticTableCondition"}, "type": "array", "title": "Semantic Table Conditions"}, "syntactic_column_conditions": {"items": {"$ref": "#/components/schemas/SyntacticColumnCondition"}, "type": "array", "title": "Syntactic Column Conditions"}, "semantic_column_conditions": {"items": {"$ref": "#/components/schemas/SemanticColumnCondition"}, "type": "array", "title": "Semantic Column Conditions"}}, "type": "object", "title": "DBMetaQuery"}, "DBProbeResponse": {"properties": {"db_table_probes": {"additionalProperties": {"additionalProperties": {"$ref": "#/components/schemas/TableProbeBase"}, "type": "object"}, "type": "object", "title": "Db Table Probes"}, "db_meta": {"$ref": "#/components/schemas/DBMetaInfoBase"}}, "type": "object", "required": ["db_meta"], "title": "DBProbeResponse"}, "DBSchemaQueryRequest": {"properties": {"query": {"$ref": "#/components/schemas/DBMetaQuery"}, "filter_columns": {"type": "boolean", "title": "Filter Columns", "default": false}}, "type": "object", "required": ["query"], "title": "DBSchemaQueryRequest"}, "DBSchemaSelectionRequest": {"properties": {"selection": {"anyOf": [{"additionalProperties": {"items": {"type": "string"}, "type": "array", "uniqueItems": true}, "type": "object"}, {"additionalProperties": {"additionalProperties": {"items": {"type": "string"}, "type": "array", "uniqueItems": true}, "type": "object"}, "type": "object"}], "title": "Selection"}, "filter_columns": {"type": "boolean", "title": "Filter Columns", "default": false}}, "type": "object", "required": ["selection"], "title": "DBSchemaSelectionRequest"}, "DatetimeSummaryStatistics": {"properties": {"count": {"type": "integer", "title": "Count"}, "mean": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Mean"}, "min": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Min"}, "max": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Max"}, "percentile_25": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Percentile 25"}, "percentile_50": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Percentile 50"}, "percentile_75": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Percentile 75"}}, "type": "object", "required": ["count"], "title": "DatetimeSummaryStatistics"}, "ERVariant": {"type": "string", "enum": ["image", "mermaid"], "title": "ERVariant"}, "EditColumns-Input": {"properties": {"operation": {"type": "string", "const": "edit_columns", "title": "Operation", "default": "edit_columns"}, "transforms": {"additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/CastColumn-Input"}], "discriminator": {"propertyName": "operation", "mapping": {"cast_column": "#/components/schemas/CastColumn-Input"}}}, "type": "object", "title": "Transforms"}, "renames": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Renames"}, "drops": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Drops"}, "additions": {"additionalProperties": {"items": {"oneOf": [{"$ref": "#/components/schemas/AddColumn-Input"}, {"$ref": "#/components/schemas/ExtractJson"}], "discriminator": {"propertyName": "operation", "mapping": {"add_column": "#/components/schemas/AddColumn-Input", "extract_json": "#/components/schemas/ExtractJson"}}}, "type": "array"}, "type": "object", "title": "Additions"}}, "type": "object", "title": "EditColumns"}, "EditColumns-Output": {"properties": {"operation": {"type": "string", "const": "edit_columns", "title": "Operation", "default": "edit_columns"}, "transforms": {"additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/CastColumn-Output"}], "discriminator": {"propertyName": "operation", "mapping": {"cast_column": "#/components/schemas/CastColumn-Output"}}}, "type": "object", "title": "Transforms"}, "renames": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Renames"}, "drops": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Drops"}, "additions": {"additionalProperties": {"items": {"oneOf": [{"$ref": "#/components/schemas/AddColumn-Output"}, {"$ref": "#/components/schemas/ExtractJson"}], "discriminator": {"propertyName": "operation", "mapping": {"add_column": "#/components/schemas/AddColumn-Output", "extract_json": "#/components/schemas/ExtractJson"}}}, "type": "array"}, "type": "object", "title": "Additions"}}, "type": "object", "title": "EditColumns"}, "ExistingTable-Input": {"properties": {"operation": {"type": "string", "const": "existing", "title": "Operation", "default": "existing"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}}, "type": "object", "required": ["base_table"], "title": "ExistingTable"}, "ExistingTable-Output": {"properties": {"operation": {"type": "string", "const": "existing", "title": "Operation", "default": "existing"}, "base_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Base Table"}}, "type": "object", "required": ["base_table"], "title": "ExistingTable"}, "ExtractJson": {"properties": {"operation": {"type": "string", "const": "extract_json", "title": "Operation", "default": "extract_json"}, "json_col": {"type": "string", "title": "Json Col"}, "attributes": {"additionalProperties": {"items": {"type": "string"}, "type": "array"}, "type": "object", "title": "Attributes"}}, "type": "object", "required": ["json_col", "attributes"], "title": "ExtractJson"}, "FKCreationRequest": {"properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Table"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "target_table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Target Table"}, "target_columns": {"items": {"type": "string"}, "type": "array", "title": "Target Columns"}}, "type": "object", "required": ["table", "columns", "target_table", "target_columns"], "title": "FKCreationRequest"}, "FKCreationResponse": {"properties": {"status": {"type": "boolean", "title": "Status"}, "error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Error"}}, "type": "object", "required": ["status"], "title": "FKCreationResponse"}, "ForeignKeyConstraintBase": {"properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Table"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "target_table": {"anyOf": [{"$ref": "#/components/schemas/LocalTableIdentifier"}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Target Table"}, "target_columns": {"items": {"type": "string"}, "type": "array", "title": "Target Columns"}}, "type": "object", "required": ["table", "columns", "target_table", "target_columns"], "title": "ForeignKeyConstraintBase"}, "ForeignRelation-Input": {"properties": {"fk_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Fk Columns"}, "referred_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Referred Table"}}, "type": "object", "required": ["fk_columns", "referred_table"], "title": "ForeignRelation"}, "ForeignRelation-Output": {"properties": {"fk_columns": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"items": {"type": "string"}, "type": "array"}], "title": "Fk Columns"}, "referred_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Referred Table"}}, "type": "object", "required": ["fk_columns", "referred_table"], "title": "ForeignRelation"}, "ForeignRelationInfo": {"properties": {"target_concept": {"type": "string", "title": "Target Concept"}, "fk_relations": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Fk Relations"}}, "type": "object", "required": ["target_concept", "fk_relations"], "title": "ForeignRelationInfo"}, "GroupValidationResult": {"properties": {"individual_validations": {"additionalProperties": {"items": {"prefixItems": [{"$ref": "#/components/schemas/TableIdentifier"}, {"$ref": "#/components/schemas/IndividualValidationResult"}], "type": "array", "maxItems": 2, "minItems": 2}, "type": "array"}, "type": "object", "title": "Individual Validations"}, "is_valid": {"type": "boolean", "title": "Is Valid", "readOnly": true}}, "type": "object", "required": ["is_valid"], "title": "GroupValidationResult"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "IndividualValidationResult": {"properties": {"is_valid": {"type": "boolean", "title": "Is Valid", "default": true}, "violations": {"items": {"type": "string"}, "type": "array", "title": "Violations"}}, "type": "object", "title": "IndividualValidationResult"}, "KeepAliveResponse": {"properties": {"server_status": {"type": "string", "const": "available", "title": "Server Status", "default": "available"}, "session_status": {"type": "string", "enum": ["missing session cookie", "session invalid", "session valid"], "title": "Session Status"}}, "type": "object", "required": ["session_status"], "title": "KeepAliveResponse"}, "Limit": {"properties": {"operation": {"type": "string", "const": "limit", "title": "Operation", "default": "limit"}, "limit": {"type": "integer", "title": "Limit"}}, "type": "object", "required": ["limit"], "title": "Limit"}, "LocalTableIdentifier": {"properties": {"name": {"type": "string", "title": "Name"}, "schema": {"type": "string", "title": "Schema", "default": "main"}}, "type": "object", "required": ["name"], "title": "LocalTableIdentifier"}, "MITM": {"type": "string", "enum": ["MAED", "OCEL2"], "title": "MITM"}, "MITMDataType": {"type": "string", "enum": ["text", "json", "integer", "numeric", "boolean", "datetime", "unknown", "infer"], "title": "MITMDataType"}, "MITMDefinition": {"properties": {"main_concepts": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Main Concepts"}, "weak_concepts": {"additionalProperties": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Weak Concepts"}, "sub_concept_map": {"additionalProperties": {"items": {"type": "string"}, "type": "array", "uniqueItems": true}, "type": "object", "title": "Sub Concept Map"}, "concept_relations": {"additionalProperties": {"$ref": "#/components/schemas/OwnedRelations"}, "type": "object", "title": "Concept Relations"}, "concept_properties": {"additionalProperties": {"$ref": "#/components/schemas/ConceptProperties"}, "type": "object", "title": "Concept Properties"}, "leaf_concepts": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Leaf Concepts", "readOnly": true}, "abstract_concepts": {"items": {"type": "string"}, "type": "array", "uniqueItems": true, "title": "Abstract Concepts", "readOnly": true}, "parent_concept_map": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Parent Concept Map", "readOnly": true}}, "type": "object", "required": ["main_concepts", "weak_concepts", "sub_concept_map", "concept_relations", "concept_properties", "leaf_concepts", "abstract_concepts", "parent_concept_map"], "title": "MITMDefinition"}, "MappingExportRequest": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept_mappings": {"items": {"$ref": "#/components/schemas/ConceptMapping-Input"}, "type": "array", "title": "Concept Mappings"}, "post_processing": {"anyOf": [{"$ref": "#/components/schemas/PostProcessing"}, {"type": "null"}]}, "filename": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Filename"}}, "type": "object", "required": ["mitm", "concept_mappings"], "title": "MappingExportRequest"}, "MitMDataTypeInfo": {"properties": {"sql_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sql Type"}}, "type": "object", "required": ["sql_type"], "title": "MitMDataTypeInfo"}, "NumericSummaryStatistics": {"properties": {"count": {"type": "integer", "title": "Count"}, "mean": {"type": "number", "title": "Mean"}, "min": {"type": "number", "title": "Min"}, "max": {"type": "number", "title": "Max"}, "std": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Std"}, "percentile_25": {"type": "number", "title": "Percentile 25"}, "percentile_50": {"type": "number", "title": "Percentile 50"}, "percentile_75": {"type": "number", "title": "Percentile 75"}}, "type": "object", "required": ["count", "mean", "min", "max", "percentile_25", "percentile_50", "percentile_75"], "title": "NumericSummaryStatistics"}, "OwnedRelations": {"properties": {"identity": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Identity"}, "inline": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Inline"}, "foreign": {"additionalProperties": {"$ref": "#/components/schemas/ForeignRelationInfo"}, "type": "object", "title": "Foreign"}}, "type": "object", "required": ["identity", "inline", "foreign"], "title": "OwnedRelations"}, "PostProcessing": {"properties": {"table_postprocessing": {"items": {"$ref": "#/components/schemas/TablePostProcessing"}, "type": "array", "title": "Table Postprocessing"}}, "type": "object", "required": ["table_postprocessing"], "title": "PostProcessing"}, "PublishedMitMResponse": {"properties": {"url": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Url"}, "relative_uri": {"type": "string", "title": "Relative Uri"}, "deletion_request_url": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Deletion Request Url"}, "export_id": {"type": "integer", "title": "Export Id"}}, "type": "object", "required": ["url", "relative_uri", "deletion_request_url", "export_id"], "title": "PublishedMitMResponse"}, "RawCompiled-Input": {"properties": {"operation": {"type": "string", "const": "compiled", "title": "Operation", "default": "compiled"}, "typed_query": {"$ref": "#/components/schemas/TypedRawQuery-Input"}}, "type": "object", "required": ["typed_query"], "title": "RawCompiled"}, "RawCompiled-Output": {"properties": {"operation": {"type": "string", "const": "compiled", "title": "Operation", "default": "compiled"}, "typed_query": {"$ref": "#/components/schemas/TypedRawQuery-Output"}}, "type": "object", "required": ["typed_query"], "title": "RawCompiled"}, "ReselectColumns": {"properties": {"operation": {"type": "string", "const": "reselect_columns", "title": "Operation", "default": "reselect_columns"}, "selection": {"items": {"type": "string"}, "type": "array", "title": "Selection"}}, "type": "object", "required": ["selection"], "title": "ReselectColumns"}, "SampleSummary": {"properties": {"sample_size": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Sample Size"}, "na_fraction": {"anyOf": [{"type": "number", "maximum": 1.0, "minimum": 0.0}, {"type": "null"}], "title": "Na Fraction"}, "unique_fraction": {"anyOf": [{"type": "number", "maximum": 1.0, "minimum": 0.0}, {"type": "null"}], "title": "Unique Fraction"}, "value_counts": {"anyOf": [{"additionalProperties": {"type": "integer"}, "type": "object"}, {"type": "null"}], "title": "Value Counts"}, "summary_statistics": {"anyOf": [{"$ref": "#/components/schemas/NumericSummaryStatistics"}, {"$ref": "#/components/schemas/CategoricalSummaryStatistics"}, {"$ref": "#/components/schemas/DatetimeSummaryStatistics"}, {"type": "null"}], "title": "Summary Statistics"}, "json_schema": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Json Schema"}}, "type": "object", "title": "SampleSummary"}, "SemanticColumnCondition": {"properties": {"inferred_data_type": {"anyOf": [{"$ref": "#/components/schemas/MITMDataType"}, {"type": "null"}]}, "max_na_fraction": {"anyOf": [{"type": "number", "maximum": 1.0, "minimum": 0.0}, {"type": "null"}], "title": "Max Na Fraction"}, "value_in_range": {"anyOf": [{}, {"type": "null"}], "title": "Value In Range"}, "contained_value": {"anyOf": [{}, {"type": "null"}], "title": "Contained Value"}, "contained_datetime": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Contained Datetime"}}, "type": "object", "title": "SemanticColumnCondition"}, "SemanticTableCondition": {"properties": {"min_row_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Min Row Count"}, "max_row_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Max Row Count"}}, "type": "object", "title": "SemanticTableCondition"}, "SessionIdResponse": {"properties": {"session_id": {"type": "string", "format": "uuid", "title": "Session Id"}}, "type": "object", "required": ["session_id"], "title": "SessionIdResponse"}, "SimpleJoin-Input": {"properties": {"operation": {"type": "string", "const": "join", "title": "Operation", "default": "join"}, "left_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Left Table"}, "right_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Right Table"}, "on_cols_left": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "On Cols Left"}, "on_cols_right": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "On Cols Right"}, "is_outer": {"type": "boolean", "title": "Is Outer", "default": false}, "full": {"type": "boolean", "title": "Full", "default": false}, "selected_cols_left": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Selected Cols Left"}, "selected_cols_right": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Selected Cols Right"}, "left_alias": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Left Alias"}, "right_alias": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Right Alias"}}, "type": "object", "required": ["left_table", "right_table"], "title": "SimpleJoin"}, "SimpleJoin-Output": {"properties": {"operation": {"type": "string", "const": "join", "title": "Operation", "default": "join"}, "left_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Left Table"}, "right_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Right Table"}, "on_cols_left": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "On Cols Left"}, "on_cols_right": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "On Cols Right"}, "is_outer": {"type": "boolean", "title": "Is Outer", "default": false}, "full": {"type": "boolean", "title": "Full", "default": false}, "selected_cols_left": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Selected Cols Left"}, "selected_cols_right": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Selected Cols Right"}, "left_alias": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Left Alias"}, "right_alias": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Right Alias"}}, "type": "object", "required": ["left_table", "right_table"], "title": "SimpleJoin"}, "SimpleSQLOperator": {"type": "string", "enum": ["ilike", "like", "eq", "ge", "gt", "le", "lt", "in", "notin"], "title": "SimpleSQLOperator"}, "SimpleWhere-Input": {"properties": {"lhs": {"type": "string", "title": "Lhs"}, "operator": {"$ref": "#/components/schemas/SimpleSQLOperator"}, "rhs": {"anyOf": [{"type": "string"}, {"prefixItems": [{}, {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Rhs"}}, "type": "object", "required": ["lhs", "operator", "rhs"], "title": "SimpleWhere"}, "SimpleWhere-Output": {"properties": {"lhs": {"type": "string", "title": "Lhs"}, "operator": {"$ref": "#/components/schemas/SimpleSQLOperator"}, "rhs": {"anyOf": [{"type": "string"}, {"prefixItems": [{}, {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Rhs"}, "rhs_is_literal": {"type": "boolean", "title": "Rhs Is Literal", "readOnly": true}}, "type": "object", "required": ["lhs", "operator", "rhs", "rhs_is_literal"], "title": "SimpleWhere"}, "SourceDBType": {"type": "string", "enum": ["original", "working", "virtual"], "title": "SourceDBType"}, "StandaloneDBMapping": {"properties": {"mitm": {"$ref": "#/components/schemas/MITM"}, "concept_mappings": {"items": {"$ref": "#/components/schemas/ConceptMapping-Output"}, "type": "array", "title": "Concept Mappings"}, "virtual_db_creation": {"$ref": "#/components/schemas/VirtualDBCreation"}}, "type": "object", "required": ["mitm", "concept_mappings", "virtual_db_creation"], "title": "StandaloneDBMapping"}, "SyntacticColumnCondition": {"properties": {"name_regex": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Regex"}, "sql_data_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sql Data Type"}, "mitm_data_type": {"anyOf": [{"$ref": "#/components/schemas/MITMDataType"}, {"type": "null"}]}}, "type": "object", "title": "SyntacticColumnCondition"}, "SyntacticTableCondition": {"properties": {"schema_regex": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Schema Regex"}, "name_regex": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Regex"}, "min_col_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Min Col Count"}, "max_col_count": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Max Col Count"}, "has_foreign_key": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Has Foreign Key"}}, "type": "object", "title": "SyntacticTableCondition"}, "TableFilter-Input": {"properties": {"operation": {"type": "string", "const": "table_filter", "title": "Operation", "default": "table_filter"}, "wheres": {"items": {"$ref": "#/components/schemas/SimpleWhere-Input"}, "type": "array", "title": "Wheres"}, "limit": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Limit"}}, "type": "object", "required": ["wheres"], "title": "TableFilter"}, "TableFilter-Output": {"properties": {"operation": {"type": "string", "const": "table_filter", "title": "Operation", "default": "table_filter"}, "wheres": {"items": {"$ref": "#/components/schemas/SimpleWhere-Output"}, "type": "array", "title": "Wheres"}, "limit": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Limit"}}, "type": "object", "required": ["wheres"], "title": "TableFilter"}, "TableIdentifier": {"properties": {"source": {"$ref": "#/components/schemas/SourceDBType", "default": "original"}, "schema": {"type": "string", "title": "Schema", "default": "main"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["name"], "title": "TableIdentifier"}, "TableMetaInfoBase": {"properties": {"schema_name": {"type": "string", "title": "Schema Name", "default": "main"}, "name": {"type": "string", "title": "Name"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "sql_column_types": {"items": {"type": "string"}, "type": "array", "title": "Sql Column Types"}, "primary_key": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Primary Key"}, "indexes": {"anyOf": [{"items": {"items": {"type": "string"}, "type": "array"}, "type": "array"}, {"type": "null"}], "title": "Indexes"}, "foreign_key_constraints": {"items": {"$ref": "#/components/schemas/ForeignKeyConstraintBase"}, "type": "array", "title": "Foreign Key Constraints"}, "column_properties": {"additionalProperties": {"$ref": "#/components/schemas/ColumnProperties"}, "type": "object", "title": "Column Properties"}}, "type": "object", "required": ["name", "columns", "sql_column_types"], "title": "TableMetaInfoBase"}, "TableMetaInfoResponse": {"properties": {"schema_name": {"type": "string", "title": "Schema Name", "default": "main"}, "name": {"type": "string", "title": "Name"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "sql_column_types": {"items": {"type": "string"}, "type": "array", "title": "Sql Column Types"}, "primary_key": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Primary Key"}, "indexes": {"anyOf": [{"items": {"items": {"type": "string"}, "type": "array"}, "type": "array"}, {"type": "null"}], "title": "Indexes"}, "foreign_key_constraints": {"items": {"$ref": "#/components/schemas/ForeignKeyConstraintBase"}, "type": "array", "title": "Foreign Key Constraints"}, "column_properties": {"additionalProperties": {"$ref": "#/components/schemas/ColumnProperties"}, "type": "object", "title": "Column Properties"}}, "type": "object", "required": ["name", "columns", "sql_column_types"], "title": "TableMetaInfoResponse"}, "TablePostProcessing": {"properties": {"target_table": {"anyOf": [{"$ref": "#/components/schemas/TableIdentifier"}, {"prefixItems": [{"$ref": "#/components/schemas/SourceDBType"}, {"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 3, "minItems": 3}, {"prefixItems": [{"type": "string"}, {"type": "string"}], "type": "array", "maxItems": 2, "minItems": 2}], "title": "Target Table"}, "transforms": {"items": {"oneOf": [{"$ref": "#/components/schemas/EditColumns-Input"}, {"$ref": "#/components/schemas/ReselectColumns"}, {"$ref": "#/components/schemas/TableFilter-Input"}, {"$ref": "#/components/schemas/Limit"}], "discriminator": {"propertyName": "operation", "mapping": {"edit_columns": "#/components/schemas/EditColumns-Input", "limit": "#/components/schemas/Limit", "reselect_columns": "#/components/schemas/ReselectColumns", "table_filter": "#/components/schemas/TableFilter-Input"}}}, "type": "array", "title": "Transforms"}}, "type": "object", "required": ["target_table", "transforms"], "title": "TablePostProcessing"}, "TableProbeBase": {"properties": {"row_count": {"type": "integer", "minimum": 0.0, "title": "Row Count"}, "inferred_types": {"additionalProperties": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Inferred Types"}, "sample_summaries": {"additionalProperties": {"$ref": "#/components/schemas/SampleSummary"}, "type": "object", "title": "Sample Summaries"}, "table_meta": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "sampled_values": {"additionalProperties": {"items": {}, "type": "array"}, "type": "object", "title": "Sampled Values"}}, "type": "object", "required": ["row_count", "inferred_types", "sample_summaries", "table_meta", "sampled_values"], "title": "TableProbeBase"}, "TableProbeResponse": {"properties": {"row_count": {"type": "integer", "minimum": 0.0, "title": "Row Count"}, "inferred_types": {"additionalProperties": {"$ref": "#/components/schemas/MITMDataType"}, "type": "object", "title": "Inferred Types"}, "sample_summaries": {"additionalProperties": {"$ref": "#/components/schemas/SampleSummary"}, "type": "object", "title": "Sample Summaries"}, "table_meta": {"$ref": "#/components/schemas/TableMetaInfoBase"}, "sampled_values": {"additionalProperties": {"items": {}, "type": "array"}, "type": "object", "title": "Sampled Values"}}, "type": "object", "required": ["row_count", "inferred_types", "sample_summaries", "table_meta", "sampled_values"], "title": "TableProbeResponse"}, "TableQueryResult": {"properties": {"table_info": {"anyOf": [{"$ref": "#/components/schemas/TableMetaInfoResponse"}, {"type": "null"}]}, "rows": {"items": {"items": {}, "type": "array"}, "type": "array", "title": "Rows"}}, "type": "object", "required": ["table_info", "rows"], "title": "TableQueryResult"}, "TypedRawQuery-Input": {"properties": {"dialect": {"type": "string", "title": "Dialect"}, "compiled_sql": {"type": "string", "title": "Compiled Sql"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "column_dtypes": {"items": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}, "type": "array", "title": "Column Dtypes"}}, "type": "object", "required": ["dialect", "compiled_sql", "columns", "column_dtypes"], "title": "TypedRawQuery"}, "TypedRawQuery-Output": {"properties": {"dialect": {"type": "string", "title": "Dialect"}, "compiled_sql": {"type": "string", "title": "Compiled Sql"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "column_dtypes": {"items": {"anyOf": [{"$ref": "#/components/schemas/WrappedMITMDataType"}, {"type": "string"}]}, "type": "array", "title": "Column Dtypes"}}, "type": "object", "required": ["dialect", "compiled_sql", "columns", "column_dtypes"], "title": "TypedRawQuery"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "VirtualDBCreation": {"properties": {"virtual_view_creations": {"items": {"$ref": "#/components/schemas/VirtualViewCreation-Output"}, "type": "array", "title": "Virtual View Creations"}}, "type": "object", "title": "VirtualDBCreation"}, "VirtualViewCreation-Input": {"properties": {"name": {"type": "string", "title": "Name"}, "schema": {"type": "string", "title": "Schema", "default": "virtual"}, "table_creation": {"oneOf": [{"$ref": "#/components/schemas/SimpleJoin-Input"}, {"$ref": "#/components/schemas/ExistingTable-Input"}, {"$ref": "#/components/schemas/RawCompiled-Input"}], "title": "Table Creation", "discriminator": {"propertyName": "operation", "mapping": {"compiled": "#/components/schemas/RawCompiled-Input", "existing": "#/components/schemas/ExistingTable-Input", "join": "#/components/schemas/SimpleJoin-Input"}}}, "transforms": {"anyOf": [{"items": {"oneOf": [{"$ref": "#/components/schemas/EditColumns-Input"}, {"$ref": "#/components/schemas/ReselectColumns"}, {"$ref": "#/components/schemas/TableFilter-Input"}, {"$ref": "#/components/schemas/Limit"}], "discriminator": {"propertyName": "operation", "mapping": {"edit_columns": "#/components/schemas/EditColumns-Input", "limit": "#/components/schemas/Limit", "reselect_columns": "#/components/schemas/ReselectColumns", "table_filter": "#/components/schemas/TableFilter-Input"}}}, "type": "array"}, {"type": "null"}], "title": "Transforms"}}, "type": "object", "required": ["name", "table_creation"], "title": "VirtualViewCreation"}, "VirtualViewCreation-Output": {"properties": {"name": {"type": "string", "title": "Name"}, "schema": {"type": "string", "title": "Schema", "default": "virtual"}, "table_creation": {"oneOf": [{"$ref": "#/components/schemas/SimpleJoin-Output"}, {"$ref": "#/components/schemas/ExistingTable-Output"}, {"$ref": "#/components/schemas/RawCompiled-Output"}], "title": "Table Creation", "discriminator": {"propertyName": "operation", "mapping": {"compiled": "#/components/schemas/RawCompiled-Output", "existing": "#/components/schemas/ExistingTable-Output", "join": "#/components/schemas/SimpleJoin-Output"}}}, "transforms": {"anyOf": [{"items": {"oneOf": [{"$ref": "#/components/schemas/EditColumns-Output"}, {"$ref": "#/components/schemas/ReselectColumns"}, {"$ref": "#/components/schemas/TableFilter-Output"}, {"$ref": "#/components/schemas/Limit"}], "discriminator": {"propertyName": "operation", "mapping": {"edit_columns": "#/components/schemas/EditColumns-Output", "limit": "#/components/schemas/Limit", "reselect_columns": "#/components/schemas/ReselectColumns", "table_filter": "#/components/schemas/TableFilter-Output"}}}, "type": "array"}, {"type": "null"}], "title": "Transforms"}}, "type": "object", "required": ["name", "table_creation"], "title": "VirtualViewCreation"}, "VirtualViewCreationRequest": {"properties": {"name": {"type": "string", "title": "Name"}, "schema": {"type": "string", "title": "Schema", "default": "virtual"}, "table_creation": {"oneOf": [{"$ref": "#/components/schemas/SimpleJoin-Input"}, {"$ref": "#/components/schemas/ExistingTable-Input"}, {"$ref": "#/components/schemas/RawCompiled-Input"}], "title": "Table Creation", "discriminator": {"propertyName": "operation", "mapping": {"compiled": "#/components/schemas/RawCompiled-Input", "existing": "#/components/schemas/ExistingTable-Input", "join": "#/components/schemas/SimpleJoin-Input"}}}, "transforms": {"anyOf": [{"items": {"oneOf": [{"$ref": "#/components/schemas/EditColumns-Input"}, {"$ref": "#/components/schemas/ReselectColumns"}, {"$ref": "#/components/schemas/TableFilter-Input"}, {"$ref": "#/components/schemas/Limit"}], "discriminator": {"propertyName": "operation", "mapping": {"edit_columns": "#/components/schemas/EditColumns-Input", "limit": "#/components/schemas/Limit", "reselect_columns": "#/components/schemas/ReselectColumns", "table_filter": "#/components/schemas/TableFilter-Input"}}}, "type": "array"}, {"type": "null"}], "title": "Transforms"}}, "type": "object", "required": ["name", "table_creation"], "title": "VirtualViewCreationRequest"}, "VirtualViewResponse": {"properties": {"table_meta": {"$ref": "#/components/schemas/TableMetaInfoResponse"}}, "type": "object", "required": ["table_meta"], "title": "VirtualViewResponse"}, "WrappedMITMDataType": {"properties": {"mitm": {"$ref": "#/components/schemas/MITMDataType"}}, "type": "object", "required": ["mitm"], "title": "WrappedMITMDataType"}}}}
\ No newline at end of file \ No newline at end of file
components: components:
schemas: schemas:
AddColumn: AddColumn-Input:
properties:
col_name:
title: Col Name
type: string
operation:
const: add_column
default: add_column
title: Operation
type: string
target_type:
anyOf:
- $ref: '#/components/schemas/WrappedMITMDataType'
- type: string
title: Target Type
value:
title: Value
required:
- col_name
- value
- target_type
title: AddColumn
type: object
AddColumn-Output:
properties: properties:
col_name: col_name:
title: Col Name title: Col Name
...@@ -54,7 +77,23 @@ components: ...@@ -54,7 +77,23 @@ components:
- sqlite - sqlite
title: Body_upload_db_session_upload_db_post title: Body_upload_db_session_upload_db_post
type: object type: object
CastColumn: CastColumn-Input:
properties:
operation:
const: cast_column
default: cast_column
title: Operation
type: string
target_type:
anyOf:
- $ref: '#/components/schemas/WrappedMITMDataType'
- type: string
title: Target Type
required:
- target_type
title: CastColumn
type: object
CastColumn-Output:
properties: properties:
operation: operation:
const: cast_column const: cast_column
...@@ -122,6 +161,23 @@ components: ...@@ -122,6 +161,23 @@ components:
- mitm_data_type - mitm_data_type
title: ColumnProperties title: ColumnProperties
type: object type: object
CompiledVirtualDB:
properties:
compiled_virtual_views:
items:
$ref: '#/components/schemas/CompiledVirtualView'
title: Compiled Virtual Views
type: array
views:
additionalProperties:
$ref: '#/components/schemas/CompiledVirtualView'
readOnly: true
title: Views
type: object
required:
- views
title: CompiledVirtualDB
type: object
CompiledVirtualView: CompiledVirtualView:
properties: properties:
column_dtypes: column_dtypes:
...@@ -170,7 +226,7 @@ components: ...@@ -170,7 +226,7 @@ components:
- weak - weak
title: ConceptLevel title: ConceptLevel
type: string type: string
ConceptMapping: ConceptMapping-Input:
properties: properties:
attribute_dtypes: attribute_dtypes:
items: items:
...@@ -204,7 +260,79 @@ components: ...@@ -204,7 +260,79 @@ components:
type: string type: string
foreign_relations: foreign_relations:
additionalProperties: additionalProperties:
$ref: '#/components/schemas/ForeignRelation' $ref: '#/components/schemas/ForeignRelation-Input'
title: Foreign Relations
type: object
identity_columns:
anyOf:
- additionalProperties:
type: string
type: object
- items:
type: string
type: array
title: Identity Columns
inline_relations:
anyOf:
- additionalProperties:
type: string
type: object
- items:
type: string
type: array
title: Inline Relations
kind_col:
anyOf:
- type: string
- type: 'null'
title: Kind Col
mitm:
$ref: '#/components/schemas/MITM'
type_col:
title: Type Col
type: string
required:
- mitm
- concept
- base_table
- type_col
title: ConceptMapping
type: object
ConceptMapping-Output:
properties:
attribute_dtypes:
items:
$ref: '#/components/schemas/MITMDataType'
title: Attribute Dtypes
type: array
attributes:
items:
type: string
title: Attributes
type: array
base_table:
anyOf:
- $ref: '#/components/schemas/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/components/schemas/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Base Table
concept:
title: Concept
type: string
foreign_relations:
additionalProperties:
$ref: '#/components/schemas/ForeignRelation-Output'
title: Foreign Relations title: Foreign Relations
type: object type: object
identity_columns: identity_columns:
...@@ -276,7 +404,7 @@ components: ...@@ -276,7 +404,7 @@ components:
type: string type: string
foreign_relations: foreign_relations:
additionalProperties: additionalProperties:
$ref: '#/components/schemas/ForeignRelation' $ref: '#/components/schemas/ForeignRelation-Input'
title: Foreign Relations title: Foreign Relations
type: object type: object
identity_columns: identity_columns:
...@@ -383,6 +511,25 @@ components: ...@@ -383,6 +511,25 @@ components:
- success - success
title: DBConnTestResponse title: DBConnTestResponse
type: object type: object
DBMappingExportRequest:
properties:
concept_mappings:
items:
$ref: '#/components/schemas/ConceptMapping-Input'
title: Concept Mappings
type: array
mitm:
$ref: '#/components/schemas/MITM'
virtual_view_creations:
items:
$ref: '#/components/schemas/VirtualViewCreation-Input'
title: Virtual View Creations
type: array
required:
- mitm
- concept_mappings
title: DBMappingExportRequest
type: object
DBMetaInfoBase: DBMetaInfoBase:
properties: properties:
db_structure: db_structure:
...@@ -392,15 +539,8 @@ components: ...@@ -392,15 +539,8 @@ components:
type: object type: object
title: Db Structure title: Db Structure
type: object type: object
tables:
additionalProperties:
$ref: '#/components/schemas/TableMetaInfoBase'
readOnly: true
title: Tables
type: object
required: required:
- db_structure - db_structure
- tables
title: DBMetaInfoBase title: DBMetaInfoBase
type: object type: object
DBMetaInfoResponse: DBMetaInfoResponse:
...@@ -412,15 +552,8 @@ components: ...@@ -412,15 +552,8 @@ components:
type: object type: object
title: Db Structure title: Db Structure
type: object type: object
tables:
additionalProperties:
$ref: '#/components/schemas/TableMetaInfoBase'
readOnly: true
title: Tables
type: object
required: required:
- db_structure - db_structure
- tables
title: DBMetaInfoResponse title: DBMetaInfoResponse
type: object type: object
DBMetaQuery: DBMetaQuery:
...@@ -451,10 +584,12 @@ components: ...@@ -451,10 +584,12 @@ components:
properties: properties:
db_meta: db_meta:
$ref: '#/components/schemas/DBMetaInfoBase' $ref: '#/components/schemas/DBMetaInfoBase'
table_probes: db_table_probes:
additionalProperties:
additionalProperties: additionalProperties:
$ref: '#/components/schemas/TableProbeBase' $ref: '#/components/schemas/TableProbeBase'
title: Table Probes type: object
title: Db Table Probes
type: object type: object
required: required:
- db_meta - db_meta
...@@ -550,18 +685,18 @@ components: ...@@ -550,18 +685,18 @@ components:
- mermaid - mermaid
title: ERVariant title: ERVariant
type: string type: string
EditColumns: EditColumns-Input:
properties: properties:
additions: additions:
additionalProperties: additionalProperties:
items: items:
discriminator: discriminator:
mapping: mapping:
add_column: '#/components/schemas/AddColumn' add_column: '#/components/schemas/AddColumn-Input'
extract_json: '#/components/schemas/ExtractJson' extract_json: '#/components/schemas/ExtractJson'
propertyName: operation propertyName: operation
oneOf: oneOf:
- $ref: '#/components/schemas/AddColumn' - $ref: '#/components/schemas/AddColumn-Input'
- $ref: '#/components/schemas/ExtractJson' - $ref: '#/components/schemas/ExtractJson'
type: array type: array
title: Additions title: Additions
...@@ -586,15 +721,87 @@ components: ...@@ -586,15 +721,87 @@ components:
additionalProperties: additionalProperties:
discriminator: discriminator:
mapping: mapping:
cast_column: '#/components/schemas/CastColumn' cast_column: '#/components/schemas/CastColumn-Input'
propertyName: operation propertyName: operation
oneOf: oneOf:
- $ref: '#/components/schemas/CastColumn' - $ref: '#/components/schemas/CastColumn-Input'
title: Transforms title: Transforms
type: object type: object
title: EditColumns title: EditColumns
type: object type: object
ExistingTable: EditColumns-Output:
properties:
additions:
additionalProperties:
items:
discriminator:
mapping:
add_column: '#/components/schemas/AddColumn-Output'
extract_json: '#/components/schemas/ExtractJson'
propertyName: operation
oneOf:
- $ref: '#/components/schemas/AddColumn-Output'
- $ref: '#/components/schemas/ExtractJson'
type: array
title: Additions
type: object
drops:
items:
type: string
title: Drops
type: array
uniqueItems: true
operation:
const: edit_columns
default: edit_columns
title: Operation
type: string
renames:
additionalProperties:
type: string
title: Renames
type: object
transforms:
additionalProperties:
discriminator:
mapping:
cast_column: '#/components/schemas/CastColumn-Output'
propertyName: operation
oneOf:
- $ref: '#/components/schemas/CastColumn-Output'
title: Transforms
type: object
title: EditColumns
type: object
ExistingTable-Input:
properties:
base_table:
anyOf:
- $ref: '#/components/schemas/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/components/schemas/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Base Table
operation:
const: existing
default: existing
title: Operation
type: string
required:
- base_table
title: ExistingTable
type: object
ExistingTable-Output:
properties: properties:
base_table: base_table:
anyOf: anyOf:
...@@ -746,7 +953,40 @@ components: ...@@ -746,7 +953,40 @@ components:
- target_columns - target_columns
title: ForeignKeyConstraintBase title: ForeignKeyConstraintBase
type: object type: object
ForeignRelation: ForeignRelation-Input:
properties:
fk_columns:
anyOf:
- additionalProperties:
type: string
type: object
- items:
type: string
type: array
title: Fk Columns
referred_table:
anyOf:
- $ref: '#/components/schemas/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/components/schemas/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Referred Table
required:
- fk_columns
- referred_table
title: ForeignRelation
type: object
ForeignRelation-Output:
properties: properties:
fk_columns: fk_columns:
anyOf: anyOf:
...@@ -965,16 +1205,16 @@ components: ...@@ -965,16 +1205,16 @@ components:
type: object type: object
MappingExportRequest: MappingExportRequest:
properties: properties:
concept_mappings:
items:
$ref: '#/components/schemas/ConceptMapping-Input'
title: Concept Mappings
type: array
filename: filename:
anyOf: anyOf:
- type: string - type: string
- type: 'null' - type: 'null'
title: Filename title: Filename
mapped_concepts:
items:
$ref: '#/components/schemas/ConceptMapping'
title: Mapped Concepts
type: array
mitm: mitm:
$ref: '#/components/schemas/MITM' $ref: '#/components/schemas/MITM'
post_processing: post_processing:
...@@ -983,17 +1223,9 @@ components: ...@@ -983,17 +1223,9 @@ components:
- type: 'null' - type: 'null'
required: required:
- mitm - mitm
- mapped_concepts - concept_mappings
title: MappingExportRequest title: MappingExportRequest
type: object type: object
MappingGroupValidationResult:
properties:
validation_result:
$ref: '#/components/schemas/GroupValidationResult'
required:
- validation_result
title: MappingGroupValidationResult
type: object
MitMDataTypeInfo: MitMDataTypeInfo:
properties: properties:
sql_type: sql_type:
...@@ -1104,15 +1336,28 @@ components: ...@@ -1104,15 +1336,28 @@ components:
- export_id - export_id
title: PublishedMitMResponse title: PublishedMitMResponse
type: object type: object
RawCompiled: RawCompiled-Input:
properties: properties:
operation: operation:
const: raw const: compiled
default: raw default: compiled
title: Operation title: Operation
type: string type: string
typed_query: typed_query:
$ref: '#/components/schemas/TypedRawQuery' $ref: '#/components/schemas/TypedRawQuery-Input'
required:
- typed_query
title: RawCompiled
type: object
RawCompiled-Output:
properties:
operation:
const: compiled
default: compiled
title: Operation
type: string
typed_query:
$ref: '#/components/schemas/TypedRawQuery-Output'
required: required:
- typed_query - typed_query
title: RawCompiled title: RawCompiled
...@@ -1231,10 +1476,102 @@ components: ...@@ -1231,10 +1476,102 @@ components:
title: Session Id title: Session Id
type: string type: string
required: required:
- session_id - session_id
title: SessionIdResponse title: SessionIdResponse
type: object
SimpleJoin-Input:
properties:
full:
default: false
title: Full
type: boolean
is_outer:
default: false
title: Is Outer
type: boolean
left_alias:
anyOf:
- type: string
- type: 'null'
title: Left Alias
left_table:
anyOf:
- $ref: '#/components/schemas/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/components/schemas/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Left Table
on_cols_left:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: On Cols Left
on_cols_right:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: On Cols Right
operation:
const: join
default: join
title: Operation
type: string
right_alias:
anyOf:
- type: string
- type: 'null'
title: Right Alias
right_table:
anyOf:
- $ref: '#/components/schemas/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/components/schemas/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Right Table
selected_cols_left:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Selected Cols Left
selected_cols_right:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Selected Cols Right
required:
- left_table
- right_table
title: SimpleJoin
type: object type: object
SimpleJoin: SimpleJoin-Output:
properties: properties:
full: full:
default: false default: false
...@@ -1339,7 +1676,32 @@ components: ...@@ -1339,7 +1676,32 @@ components:
- notin - notin
title: SimpleSQLOperator title: SimpleSQLOperator
type: string type: string
SimpleWhere: SimpleWhere-Input:
properties:
lhs:
title: Lhs
type: string
operator:
$ref: '#/components/schemas/SimpleSQLOperator'
rhs:
anyOf:
- type: string
- maxItems: 2
minItems: 2
prefixItems:
- {}
- anyOf:
- $ref: '#/components/schemas/WrappedMITMDataType'
- type: string
type: array
title: Rhs
required:
- lhs
- operator
- rhs
title: SimpleWhere
type: object
SimpleWhere-Output:
properties: properties:
lhs: lhs:
title: Lhs title: Lhs
...@@ -1358,10 +1720,15 @@ components: ...@@ -1358,10 +1720,15 @@ components:
- type: string - type: string
type: array type: array
title: Rhs title: Rhs
rhs_is_literal:
readOnly: true
title: Rhs Is Literal
type: boolean
required: required:
- lhs - lhs
- operator - operator
- rhs - rhs
- rhs_is_literal
title: SimpleWhere title: SimpleWhere
type: object type: object
SourceDBType: SourceDBType:
...@@ -1371,6 +1738,23 @@ components: ...@@ -1371,6 +1738,23 @@ components:
- virtual - virtual
title: SourceDBType title: SourceDBType
type: string type: string
StandaloneDBMapping:
properties:
concept_mappings:
items:
$ref: '#/components/schemas/ConceptMapping-Output'
title: Concept Mappings
type: array
mitm:
$ref: '#/components/schemas/MITM'
virtual_db_creation:
$ref: '#/components/schemas/VirtualDBCreation'
required:
- mitm
- concept_mappings
- virtual_db_creation
title: StandaloneDBMapping
type: object
SyntacticColumnCondition: SyntacticColumnCondition:
properties: properties:
mitm_data_type: mitm_data_type:
...@@ -1420,7 +1804,28 @@ components: ...@@ -1420,7 +1804,28 @@ components:
title: Schema Regex title: Schema Regex
title: SyntacticTableCondition title: SyntacticTableCondition
type: object type: object
TableFilter: TableFilter-Input:
properties:
limit:
anyOf:
- type: integer
- type: 'null'
title: Limit
operation:
const: table_filter
default: table_filter
title: Operation
type: string
wheres:
items:
$ref: '#/components/schemas/SimpleWhere-Input'
title: Wheres
type: array
required:
- wheres
title: TableFilter
type: object
TableFilter-Output:
properties: properties:
limit: limit:
anyOf: anyOf:
...@@ -1434,7 +1839,7 @@ components: ...@@ -1434,7 +1839,7 @@ components:
type: string type: string
wheres: wheres:
items: items:
$ref: '#/components/schemas/SimpleWhere' $ref: '#/components/schemas/SimpleWhere-Output'
title: Wheres title: Wheres
type: array type: array
required: required:
...@@ -1582,15 +1987,15 @@ components: ...@@ -1582,15 +1987,15 @@ components:
items: items:
discriminator: discriminator:
mapping: mapping:
edit_columns: '#/components/schemas/EditColumns' edit_columns: '#/components/schemas/EditColumns-Input'
limit: '#/components/schemas/Limit' limit: '#/components/schemas/Limit'
reselect_columns: '#/components/schemas/ReselectColumns' reselect_columns: '#/components/schemas/ReselectColumns'
table_filter: '#/components/schemas/TableFilter' table_filter: '#/components/schemas/TableFilter-Input'
propertyName: operation propertyName: operation
oneOf: oneOf:
- $ref: '#/components/schemas/EditColumns' - $ref: '#/components/schemas/EditColumns-Input'
- $ref: '#/components/schemas/ReselectColumns' - $ref: '#/components/schemas/ReselectColumns'
- $ref: '#/components/schemas/TableFilter' - $ref: '#/components/schemas/TableFilter-Input'
- $ref: '#/components/schemas/Limit' - $ref: '#/components/schemas/Limit'
title: Transforms title: Transforms
type: array type: array
...@@ -1680,7 +2085,34 @@ components: ...@@ -1680,7 +2085,34 @@ components:
- rows - rows
title: TableQueryResult title: TableQueryResult
type: object type: object
TypedRawQuery: TypedRawQuery-Input:
properties:
column_dtypes:
items:
anyOf:
- $ref: '#/components/schemas/WrappedMITMDataType'
- type: string
title: Column Dtypes
type: array
columns:
items:
type: string
title: Columns
type: array
compiled_sql:
title: Compiled Sql
type: string
dialect:
title: Dialect
type: string
required:
- dialect
- compiled_sql
- columns
- column_dtypes
title: TypedRawQuery
type: object
TypedRawQuery-Output:
properties: properties:
column_dtypes: column_dtypes:
items: items:
...@@ -1728,6 +2160,103 @@ components: ...@@ -1728,6 +2160,103 @@ components:
- type - type
title: ValidationError title: ValidationError
type: object type: object
VirtualDBCreation:
properties:
virtual_view_creations:
items:
$ref: '#/components/schemas/VirtualViewCreation-Output'
title: Virtual View Creations
type: array
title: VirtualDBCreation
type: object
VirtualViewCreation-Input:
properties:
name:
title: Name
type: string
schema:
default: virtual
title: Schema
type: string
table_creation:
discriminator:
mapping:
compiled: '#/components/schemas/RawCompiled-Input'
existing: '#/components/schemas/ExistingTable-Input'
join: '#/components/schemas/SimpleJoin-Input'
propertyName: operation
oneOf:
- $ref: '#/components/schemas/SimpleJoin-Input'
- $ref: '#/components/schemas/ExistingTable-Input'
- $ref: '#/components/schemas/RawCompiled-Input'
title: Table Creation
transforms:
anyOf:
- items:
discriminator:
mapping:
edit_columns: '#/components/schemas/EditColumns-Input'
limit: '#/components/schemas/Limit'
reselect_columns: '#/components/schemas/ReselectColumns'
table_filter: '#/components/schemas/TableFilter-Input'
propertyName: operation
oneOf:
- $ref: '#/components/schemas/EditColumns-Input'
- $ref: '#/components/schemas/ReselectColumns'
- $ref: '#/components/schemas/TableFilter-Input'
- $ref: '#/components/schemas/Limit'
type: array
- type: 'null'
title: Transforms
required:
- name
- table_creation
title: VirtualViewCreation
type: object
VirtualViewCreation-Output:
properties:
name:
title: Name
type: string
schema:
default: virtual
title: Schema
type: string
table_creation:
discriminator:
mapping:
compiled: '#/components/schemas/RawCompiled-Output'
existing: '#/components/schemas/ExistingTable-Output'
join: '#/components/schemas/SimpleJoin-Output'
propertyName: operation
oneOf:
- $ref: '#/components/schemas/SimpleJoin-Output'
- $ref: '#/components/schemas/ExistingTable-Output'
- $ref: '#/components/schemas/RawCompiled-Output'
title: Table Creation
transforms:
anyOf:
- items:
discriminator:
mapping:
edit_columns: '#/components/schemas/EditColumns-Output'
limit: '#/components/schemas/Limit'
reselect_columns: '#/components/schemas/ReselectColumns'
table_filter: '#/components/schemas/TableFilter-Output'
propertyName: operation
oneOf:
- $ref: '#/components/schemas/EditColumns-Output'
- $ref: '#/components/schemas/ReselectColumns'
- $ref: '#/components/schemas/TableFilter-Output'
- $ref: '#/components/schemas/Limit'
type: array
- type: 'null'
title: Transforms
required:
- name
- table_creation
title: VirtualViewCreation
type: object
VirtualViewCreationRequest: VirtualViewCreationRequest:
properties: properties:
name: name:
...@@ -1740,29 +2269,29 @@ components: ...@@ -1740,29 +2269,29 @@ components:
table_creation: table_creation:
discriminator: discriminator:
mapping: mapping:
existing: '#/components/schemas/ExistingTable' compiled: '#/components/schemas/RawCompiled-Input'
join: '#/components/schemas/SimpleJoin' existing: '#/components/schemas/ExistingTable-Input'
raw: '#/components/schemas/RawCompiled' join: '#/components/schemas/SimpleJoin-Input'
propertyName: operation propertyName: operation
oneOf: oneOf:
- $ref: '#/components/schemas/SimpleJoin' - $ref: '#/components/schemas/SimpleJoin-Input'
- $ref: '#/components/schemas/ExistingTable' - $ref: '#/components/schemas/ExistingTable-Input'
- $ref: '#/components/schemas/RawCompiled' - $ref: '#/components/schemas/RawCompiled-Input'
title: Table Creation title: Table Creation
transforms: transforms:
anyOf: anyOf:
- items: - items:
discriminator: discriminator:
mapping: mapping:
edit_columns: '#/components/schemas/EditColumns' edit_columns: '#/components/schemas/EditColumns-Input'
limit: '#/components/schemas/Limit' limit: '#/components/schemas/Limit'
reselect_columns: '#/components/schemas/ReselectColumns' reselect_columns: '#/components/schemas/ReselectColumns'
table_filter: '#/components/schemas/TableFilter' table_filter: '#/components/schemas/TableFilter-Input'
propertyName: operation propertyName: operation
oneOf: oneOf:
- $ref: '#/components/schemas/EditColumns' - $ref: '#/components/schemas/EditColumns-Input'
- $ref: '#/components/schemas/ReselectColumns' - $ref: '#/components/schemas/ReselectColumns'
- $ref: '#/components/schemas/TableFilter' - $ref: '#/components/schemas/TableFilter-Input'
- $ref: '#/components/schemas/Limit' - $ref: '#/components/schemas/Limit'
type: array type: array
- type: 'null' - type: 'null'
...@@ -1848,23 +2377,10 @@ paths: ...@@ -1848,23 +2377,10 @@ paths:
summary: Clear Uploads summary: Clear Uploads
tags: tags:
- admin - admin
/control/compiled-virtual-view: /control/compiled-virtual-db:
get: get:
operationId: get_compiled_virtual_view operationId: get_compiled_virtual_db
parameters: parameters:
- in: query
name: view
required: true
schema:
title: View
type: string
- in: query
name: schema
required: false
schema:
default: virtual
title: Schema
type: string
- in: cookie - in: cookie
name: simple_session name: simple_session
required: true required: true
...@@ -1876,7 +2392,7 @@ paths: ...@@ -1876,7 +2392,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/CompiledVirtualView' $ref: '#/components/schemas/CompiledVirtualDB'
description: Successful Response description: Successful Response
'422': '422':
content: content:
...@@ -1884,13 +2400,26 @@ paths: ...@@ -1884,13 +2400,26 @@ paths:
schema: schema:
$ref: '#/components/schemas/HTTPValidationError' $ref: '#/components/schemas/HTTPValidationError'
description: Validation Error description: Validation Error
summary: Get Compiled Virtual View summary: Get Compiled Virtual Db
tags: tags:
- control - control
/control/compiled-virtual-views: /control/compiled-virtual-view:
get: get:
operationId: get_compiled_virtual_views operationId: get_compiled_virtual_view
parameters: parameters:
- in: query
name: view
required: true
schema:
title: View
type: string
- in: query
name: schema
required: false
schema:
default: virtual
title: Schema
type: string
- in: cookie - in: cookie
name: simple_session name: simple_session
required: true required: true
...@@ -1902,11 +2431,7 @@ paths: ...@@ -1902,11 +2431,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
items:
$ref: '#/components/schemas/CompiledVirtualView' $ref: '#/components/schemas/CompiledVirtualView'
title: Response Get Compiled Virtual Views Control Compiled Virtual
Views Get
type: array
description: Successful Response description: Successful Response
'422': '422':
content: content:
...@@ -1914,7 +2439,7 @@ paths: ...@@ -1914,7 +2439,7 @@ paths:
schema: schema:
$ref: '#/components/schemas/HTTPValidationError' $ref: '#/components/schemas/HTTPValidationError'
description: Validation Error description: Validation Error
summary: Get Compiled Virtual Views summary: Get Compiled Virtual View
tags: tags:
- control - control
/control/init-working-db: /control/init-working-db:
...@@ -2005,6 +2530,32 @@ paths: ...@@ -2005,6 +2530,32 @@ paths:
summary: Reflect Db summary: Reflect Db
tags: tags:
- control - control
/control/virtual-db-creation:
get:
operationId: get_virtual_db_creation
parameters:
- in: cookie
name: simple_session
required: true
schema:
title: Simple Session
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualDBCreation'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Get Virtual Db Creation
tags:
- control
/control/virtual-view: /control/virtual-view:
delete: delete:
operationId: drop_virtual_view operationId: drop_virtual_view
...@@ -2567,6 +3118,13 @@ paths: ...@@ -2567,6 +3118,13 @@ paths:
post: post:
operationId: export_mitm operationId: export_mitm
parameters: parameters:
- in: query
name: use_streaming
required: false
schema:
default: false
title: Use Streaming
type: boolean
- in: cookie - in: cookie
name: simple_session name: simple_session
required: true required: true
...@@ -2591,16 +3149,62 @@ paths: ...@@ -2591,16 +3149,62 @@ paths:
summary: Export Mitm summary: Export Mitm
tags: tags:
- mitm - mitm
/mitm/export-standalone-db-mapping:
post:
operationId: export_standalone_db_mapping
parameters:
- in: query
name: include_virtual_db
required: false
schema:
default: true
title: Include Virtual Db
type: boolean
- in: query
name: validate
required: false
schema:
default: true
title: Validate
type: boolean
- in: cookie
name: simple_session
required: true
schema:
title: Simple Session
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DBMappingExportRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/StandaloneDBMapping'
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Export Standalone Db Mapping
tags:
- mitm
/mitm/publish-mitm-export: /mitm/publish-mitm-export:
post: post:
operationId: publish_mitm_export operationId: publish_mitm_export
parameters: parameters:
- in: query - in: query
name: use_streaming_export name: use_streaming
required: false required: false
schema: schema:
default: false default: false
title: Use Streaming Export title: Use Streaming
type: boolean type: boolean
- in: cookie - in: cookie
name: simple_session name: simple_session
...@@ -2654,7 +3258,7 @@ paths: ...@@ -2654,7 +3258,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/MappingGroupValidationResult' $ref: '#/components/schemas/GroupValidationResult'
description: Successful Response description: Successful Response
'422': '422':
content: content:
......
$defs:
AddColumn:
properties:
col_name:
title: Col Name
type: string
operation:
const: add_column
default: add_column
title: Operation
type: string
target_type:
anyOf:
- $ref: '#/$defs/WrappedMITMDataType'
- type: string
title: Target Type
value:
title: Value
required:
- col_name
- value
- target_type
title: AddColumn
type: object
CastColumn:
properties:
operation:
const: cast_column
default: cast_column
title: Operation
type: string
target_type:
anyOf:
- $ref: '#/$defs/WrappedMITMDataType'
- type: string
title: Target Type
required:
- target_type
title: CastColumn
type: object
ConceptMapping:
properties:
attribute_dtypes:
items:
$ref: '#/$defs/MITMDataType'
title: Attribute Dtypes
type: array
attributes:
items:
type: string
title: Attributes
type: array
base_table:
anyOf:
- $ref: '#/$defs/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/$defs/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Base Table
concept:
title: Concept
type: string
foreign_relations:
additionalProperties:
$ref: '#/$defs/ForeignRelation'
title: Foreign Relations
type: object
identity_columns:
anyOf:
- additionalProperties:
type: string
type: object
- items:
type: string
type: array
title: Identity Columns
inline_relations:
anyOf:
- additionalProperties:
type: string
type: object
- items:
type: string
type: array
title: Inline Relations
kind_col:
anyOf:
- type: string
- type: 'null'
default: null
title: Kind Col
mitm:
$ref: '#/$defs/MITM'
type_col:
title: Type Col
type: string
required:
- mitm
- concept
- base_table
- type_col
title: ConceptMapping
type: object
EditColumns:
properties:
additions:
additionalProperties:
items:
discriminator:
mapping:
add_column: '#/$defs/AddColumn'
extract_json: '#/$defs/ExtractJson'
propertyName: operation
oneOf:
- $ref: '#/$defs/AddColumn'
- $ref: '#/$defs/ExtractJson'
type: array
title: Additions
type: object
drops:
items:
type: string
title: Drops
type: array
uniqueItems: true
operation:
const: edit_columns
default: edit_columns
title: Operation
type: string
renames:
additionalProperties:
type: string
title: Renames
type: object
transforms:
additionalProperties:
discriminator:
mapping:
cast_column: '#/$defs/CastColumn'
propertyName: operation
oneOf:
- $ref: '#/$defs/CastColumn'
title: Transforms
type: object
title: EditColumns
type: object
ExistingTable:
properties:
base_table:
anyOf:
- $ref: '#/$defs/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/$defs/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Base Table
operation:
const: existing
default: existing
title: Operation
type: string
required:
- base_table
title: ExistingTable
type: object
ExtractJson:
properties:
attributes:
additionalProperties:
items:
type: string
type: array
title: Attributes
type: object
json_col:
title: Json Col
type: string
operation:
const: extract_json
default: extract_json
title: Operation
type: string
required:
- json_col
- attributes
title: ExtractJson
type: object
ForeignRelation:
properties:
fk_columns:
anyOf:
- additionalProperties:
type: string
type: object
- items:
type: string
type: array
title: Fk Columns
referred_table:
anyOf:
- $ref: '#/$defs/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/$defs/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Referred Table
required:
- fk_columns
- referred_table
title: ForeignRelation
type: object
Limit:
properties:
limit:
title: Limit
type: integer
operation:
const: limit
default: limit
title: Operation
type: string
required:
- limit
title: Limit
type: object
MITM:
enum:
- MAED
- OCEL2
title: MITM
type: string
MITMDataType:
enum:
- text
- json
- integer
- numeric
- boolean
- datetime
- unknown
- infer
title: MITMDataType
type: string
RawCompiled:
properties:
operation:
const: compiled
default: compiled
title: Operation
type: string
typed_query:
$ref: '#/$defs/TypedRawQuery'
required:
- typed_query
title: RawCompiled
type: object
ReselectColumns:
properties:
operation:
const: reselect_columns
default: reselect_columns
title: Operation
type: string
selection:
items:
type: string
title: Selection
type: array
required:
- selection
title: ReselectColumns
type: object
SimpleJoin:
properties:
full:
default: false
title: Full
type: boolean
is_outer:
default: false
title: Is Outer
type: boolean
left_alias:
anyOf:
- type: string
- type: 'null'
default: null
title: Left Alias
left_table:
anyOf:
- $ref: '#/$defs/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/$defs/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Left Table
on_cols_left:
anyOf:
- items:
type: string
type: array
- type: 'null'
default: null
title: On Cols Left
on_cols_right:
anyOf:
- items:
type: string
type: array
- type: 'null'
default: null
title: On Cols Right
operation:
const: join
default: join
title: Operation
type: string
right_alias:
anyOf:
- type: string
- type: 'null'
default: null
title: Right Alias
right_table:
anyOf:
- $ref: '#/$defs/TableIdentifier'
- maxItems: 3
minItems: 3
prefixItems:
- $ref: '#/$defs/SourceDBType'
- type: string
- type: string
type: array
- maxItems: 2
minItems: 2
prefixItems:
- type: string
- type: string
type: array
title: Right Table
selected_cols_left:
anyOf:
- items:
type: string
type: array
- type: 'null'
default: null
title: Selected Cols Left
selected_cols_right:
anyOf:
- items:
type: string
type: array
- type: 'null'
default: null
title: Selected Cols Right
required:
- left_table
- right_table
title: SimpleJoin
type: object
SimpleSQLOperator:
enum:
- ilike
- like
- eq
- ge
- gt
- le
- lt
- in
- notin
title: SimpleSQLOperator
type: string
SimpleWhere:
properties:
lhs:
title: Lhs
type: string
operator:
$ref: '#/$defs/SimpleSQLOperator'
rhs:
anyOf:
- type: string
- maxItems: 2
minItems: 2
prefixItems:
- {}
- anyOf:
- $ref: '#/$defs/WrappedMITMDataType'
- type: string
type: array
title: Rhs
required:
- lhs
- operator
- rhs
title: SimpleWhere
type: object
SourceDBType:
enum:
- original
- working
- virtual
title: SourceDBType
type: string
TableFilter:
properties:
limit:
anyOf:
- type: integer
- type: 'null'
default: null
title: Limit
operation:
const: table_filter
default: table_filter
title: Operation
type: string
wheres:
items:
$ref: '#/$defs/SimpleWhere'
title: Wheres
type: array
required:
- wheres
title: TableFilter
type: object
TableIdentifier:
properties:
name:
title: Name
type: string
schema:
default: main
title: Schema
type: string
source:
$ref: '#/$defs/SourceDBType'
default: original
required:
- name
title: TableIdentifier
type: object
TypedRawQuery:
properties:
column_dtypes:
items:
anyOf:
- $ref: '#/$defs/WrappedMITMDataType'
- type: string
title: Column Dtypes
type: array
columns:
items:
type: string
title: Columns
type: array
compiled_sql:
title: Compiled Sql
type: string
dialect:
title: Dialect
type: string
required:
- dialect
- compiled_sql
- columns
- column_dtypes
title: TypedRawQuery
type: object
VirtualDBCreation:
properties:
virtual_view_creations:
items:
$ref: '#/$defs/VirtualViewCreation'
title: Virtual View Creations
type: array
title: VirtualDBCreation
type: object
VirtualViewCreation:
properties:
name:
title: Name
type: string
schema:
default: virtual
title: Schema
type: string
table_creation:
discriminator:
mapping:
compiled: '#/$defs/RawCompiled'
existing: '#/$defs/ExistingTable'
join: '#/$defs/SimpleJoin'
propertyName: operation
oneOf:
- $ref: '#/$defs/SimpleJoin'
- $ref: '#/$defs/ExistingTable'
- $ref: '#/$defs/RawCompiled'
title: Table Creation
transforms:
anyOf:
- items:
discriminator:
mapping:
edit_columns: '#/$defs/EditColumns'
limit: '#/$defs/Limit'
reselect_columns: '#/$defs/ReselectColumns'
table_filter: '#/$defs/TableFilter'
propertyName: operation
oneOf:
- $ref: '#/$defs/EditColumns'
- $ref: '#/$defs/ReselectColumns'
- $ref: '#/$defs/TableFilter'
- $ref: '#/$defs/Limit'
type: array
- type: 'null'
default: null
title: Transforms
required:
- name
- table_creation
title: VirtualViewCreation
type: object
WrappedMITMDataType:
properties:
mitm:
$ref: '#/$defs/MITMDataType'
required:
- mitm
title: WrappedMITMDataType
type: object
properties:
concept_mappings:
items:
$ref: '#/$defs/ConceptMapping'
title: Concept Mappings
type: array
mitm:
$ref: '#/$defs/MITM'
virtual_db_creation:
$ref: '#/$defs/VirtualDBCreation'
required:
- mitm
- concept_mappings
- virtual_db_creation
title: StandaloneDBMapping
type: object
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment