MCPcopy Index your code
hub / github.com/outerbase/studio / createTableSchemaDraft

Function createTableSchemaDraft

src/lib/sql/sql-generate.schema.ts:26–48  ·  view source on GitHub ↗
(
  schemaName: string,
  schema: DatabaseTableSchema
)

Source from the content-addressed store, hash-verified

24}
25
26export function createTableSchemaDraft(
27 schemaName: string,
28 schema: DatabaseTableSchema
29): DatabaseTableSchemaChange {
30 return {
31 schemaName,
32 name: {
33 old: schema.tableName,
34 new: schema.tableName,
35 },
36 columns: schema.columns.map((col) => ({
37 key: generateId(),
38 old: col,
39 new: cloneDeep(col),
40 })),
41 constraints: (schema.constraints ?? []).map((con) => ({
42 id: generateId(),
43 old: con,
44 new: cloneDeep(con),
45 })),
46 createScript: schema.createScript,
47 };
48}

Callers 2

SchemaEditorTabFunction · 0.90
cFunction · 0.90

Calls 1

generateIdFunction · 0.90

Tested by 1

cFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…