MCPcopy Create free account
hub / github.com/GooGee/Entity-Builder / createColumnTypeFormat

Function createColumnTypeFormat

src/Factory/createColumnTypeFormat.ts:8–53  ·  view source on GitHub ↗
(
    entityId: number,
    name: string,
    type: string,
    value: string = "",
    length: number = 0,
    style: string = "",
    comment: string = "",
    inTable = true,
    tf?: OmitId<LB.TypeFormat>,
    nullable = false,
    scale = 0,
)

Source from the content-addressed store, hash-verified

6import useDoctrineColumnTypezzStore from "@/Store/useDoctrineColumnTypezzStore"
7
8export default function createColumnTypeFormat(
9 entityId: number,
10 name: string,
11 type: string,
12 value: string = "",
13 length: number = 0,
14 style: string = "",
15 comment: string = "",
16 inTable = true,
17 tf?: OmitId<LB.TypeFormat>,
18 nullable = false,
19 scale = 0,
20): Promise<LB.Column> {
21 const rozz = getCollectionItemzz("ReadOnlyColumn")
22 const dct = useDoctrineColumnTypezzStore.getState().findByName(type)
23 return makeColumnCRUD()
24 .create(
25 makeColumn(
26 entityId,
27 name,
28 type,
29 value,
30 length,
31 rozz,
32 dct,
33 style,
34 comment,
35 inTable,
36 nullable,
37 scale,
38 ),
39 )
40 .then((item) => {
41 if (tf) {
42 tf.ownerColumnId = item.id
43 return makeTypeFormatCRUD()
44 .create(tf)
45 .then(() => item)
46 }
47
48 tf = makeTypeFormat(dct?.oapiType as any, 1, null, null, null, null, item.id, dct?.oapiFormat)
49 return makeTypeFormatCRUD()
50 .create(tf)
51 .then(() => item)
52 })
53}

Callers 6

makeFunction · 0.85
addFunction · 0.85
RelationFunction · 0.85
makeParameterFilterFunction · 0.85
buildRelationFunction · 0.85
makeEntityWithIdFunction · 0.85

Calls 7

makeColumnCRUDFunction · 0.90
makeTypeFormatCRUDFunction · 0.90
getCollectionItemzzFunction · 0.85
makeColumnFunction · 0.85
makeTypeFormatFunction · 0.85
findByNameMethod · 0.65
createMethod · 0.65

Tested by

no test coverage detected