Add dependency to views based on view definition (#236)

* init dependency

* add dependency api support

* add 'dependency-edge' type

* add dependencies to sidebar

* ast in multi database types

* double click on dependency to view it + fix vizualize adding dependency

* set view to always be the dependent table on creating dependency

* set dependency edge color

* find the shortest path on dependencies

* add handle id diff

* fix for parsing + add dependencies to diagaram

* hide or show dependencies from view menu

* fix for MATERIALIZED VIEWS

* rebase + fix

* fix build

---------

Co-authored-by: Guy Ben-Aharon <baguy3@gmail.com>
This commit is contained in:
Jonathan Fishner
2024-10-06 00:00:10 +03:00
committed by GitHub
parent 9219b821ab
commit ea93e394af
38 changed files with 8222 additions and 9308 deletions

View File

@@ -1,7 +1,7 @@
import { emptyFn } from '@/lib/utils';
import { createContext } from 'react';
export type SidebarSection = 'tables' | 'relationships';
export type SidebarSection = 'tables' | 'relationships' | 'dependencies';
export interface LayoutContext {
openedTableInSidebar: string | undefined;
@@ -12,6 +12,10 @@ export interface LayoutContext {
openRelationshipFromSidebar: (relationshipId: string) => void;
closeAllRelationshipsInSidebar: () => void;
openedDependencyInSidebar: string | undefined;
openDependencyFromSidebar: (dependencyId: string) => void;
closeAllDependenciesInSidebar: () => void;
selectedSidebarSection: SidebarSection;
selectSidebarSection: (section: SidebarSection) => void;
@@ -32,6 +36,10 @@ export const layoutContext = createContext<LayoutContext>({
openRelationshipFromSidebar: emptyFn,
closeAllRelationshipsInSidebar: emptyFn,
openedDependencyInSidebar: undefined,
openDependencyFromSidebar: emptyFn,
closeAllDependenciesInSidebar: emptyFn,
selectSidebarSection: emptyFn,
openTableFromSidebar: emptyFn,
closeAllTablesInSidebar: emptyFn,