Documentation
    Preparing search index...
    discovery: {
        discover_tables: (
            tableNames: string[],
            schema0?: string,
            dbModule?: DbExportsType,
        ) => Promise<{ tables: TablePack[] }>;
        discoverable_tables: (
            schema0?: string,
            allTables?: boolean,
            dbModule?: DbExportsType,
        ) => Promise<Row[]>;
        findType: (sql_name: string) => string | undefined;
        get_existing_views: (schema0?: string) => Promise<Row[]>;
        implement_discovery: (pack: { tables: TablePack[] }) => Promise<void>;
        make_field: (c: Row) => Promise<FieldCfg | undefined>;
        reconcile_table: (
            table: Table,
        ) => Promise<
            {
                fields: {
                    name: string;
                    status: "match"
                    | "ghost"
                    | "orphan";
                    type?: string;
                }[];
                ghost_count: number;
                match_count: number;
                orphan_count: number;
                table_name: string;
            },
        >;
    }

    Type Declaration

    • discover_tables: (
          tableNames: string[],
          schema0?: string,
          dbModule?: DbExportsType,
      ) => Promise<{ tables: TablePack[] }>

      Discover tables definitions

    • discoverable_tables: (
          schema0?: string,
          allTables?: boolean,
          dbModule?: DbExportsType,
      ) => Promise<Row[]>

      List of discoverable tables. Returns all tables that can be imported to Saltcorn from current tenant database schema. The tables with name started with "sc" and tables imported to Saltcorn are ignored.

    • findType: (sql_name: string) => string | undefined

      Mapping SQL Type to Saltcorn type (For Discovery)

    • get_existing_views: (schema0?: string) => Promise<Row[]>

      List all views in current tenant db schema

    • implement_discovery: (pack: { tables: TablePack[] }) => Promise<void>

      Add discovered tables to Saltcorn

    • make_field: (c: Row) => Promise<FieldCfg | undefined>
    • reconcile_table: (
          table: Table,
      ) => Promise<
          {
              fields: {
                  name: string;
                  status: "match"
                  | "ghost"
                  | "orphan";
                  type?: string;
              }[];
              ghost_count: number;
              match_count: number;
              orphan_count: number;
              table_name: string;
          },
      >

      Reconcile Saltcorn field metadata against physical DB columns. Returns a report of matches, ghosts (in Saltcorn but not in DB), and orphans (in DB but not in Saltcorn). This is a read-only operation — nothing is modified.