@standardbeagle/edit-db 0.4.458 → 0.4.477

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ import { Column } from '../types/schema';
2
+ /**
3
+ * Anchors a pattern the same way the HTML5 `pattern` attribute and the server
4
+ * validator do: wrap as ^(?:...)$ unless the author already anchored it with ^.
5
+ */
6
+ export declare function anchorPattern(pattern: string): string;
7
+ /**
8
+ * Validates a single value against a column's schema constraints. Returns an
9
+ * error message, or undefined when valid. `isRequired` is passed explicitly so
10
+ * callers keep their own required policy (forms use !isNullable).
11
+ */
12
+ export declare function validateFieldValue(column: Column, value: unknown, isRequired: boolean): string | undefined;
@@ -0,0 +1 @@
1
+ export {};
package/dist/lib/m2m.d.ts CHANGED
@@ -52,5 +52,10 @@ export declare function targetDisplay(junctionRow: Record<string, unknown>, m2m:
52
52
  * The insert detail for a new link: the parent key on the junction source FK and
53
53
  * the chosen target key on the junction target FK. Any payload columns are left
54
54
  * unset so the database applies its defaults; the user edits them afterwards.
55
+ *
56
+ * Single-column junction FKs only. `parentId`/`targetId` are route-encoded
57
+ * strings; for a composite FK they carry multiple values joined by "::", which
58
+ * would be written verbatim into one column — silent data corruption. Rather
59
+ * than guess a decomposition, fail loudly until composite-FK support is built.
55
60
  */
56
61
  export declare function attachJunctionDetail(m2m: ManyToManyJoin, parentId: string, targetId: string): Record<string, unknown>;
@@ -6,6 +6,13 @@ export interface PkEqFilterResult {
6
6
  params: string[];
7
7
  }
8
8
  type TableLike = Pick<Table, 'primaryKeys'> & Partial<Pick<Table, 'columns'>>;
9
+ /**
10
+ * Encodes an ordered list of key values into a route string. The single source
11
+ * of truth for composite-key route encoding — every producer (row lists) and
12
+ * consumer (composite-FK selects) must funnel through this so the two sides can
13
+ * never drift apart and silently fail to match.
14
+ */
15
+ export declare function encodeRouteParts(values: readonly unknown[]): string;
9
16
  export declare function rowIdOf(row: Record<string, unknown> | null | undefined, table: TableLike, index: number): string;
10
17
  export declare function pkFilterFor(row: Record<string, unknown> | null | undefined, table: TableLike): PkFilter | null;
11
18
  export declare function buildPkEqFilter(row: Record<string, unknown> | null | undefined, table: Pick<Table, 'primaryKeys' | 'columns'>): PkEqFilterResult | null;
@@ -1,16 +1,12 @@
1
1
  /**
2
- * TableList component that displays database tables in a sidebar.
2
+ * TableList — searchable, paged, schema-grouped sidebar of database tables.
3
3
  *
4
- * Features:
5
- * - Lists all tables from the schema
6
- * - Shows loading and error states
7
- * - Displays table statistics (columns, rows, FKs) as sparklines
8
- * - Responsive layout with visual hierarchy
4
+ * Scales to several hundred tables:
5
+ * - Search filters by label, raw db name, and schema.
6
+ * - Tables group under collapsible schema headers (only when >1 schema exists).
7
+ * - The visible rows (headers + tables) are paged at {@link PAGE_SIZE} so the DOM
8
+ * stays small regardless of total table count.
9
9
  *
10
10
  * @component
11
- * @example
12
- * ```tsx
13
- * <TableList />
14
- * ```
15
11
  */
16
12
  export declare function TableList(): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@standardbeagle/edit-db",
3
3
  "private": false,
4
- "version": "0.4.458",
4
+ "version": "0.4.477",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@radix-ui/react-slot": "^1.2.4",