MCPcopy Create free account
hub / github.com/NobleMajo/al-sql / postgresTypeToJsType

Function postgresTypeToJsType

src/index.ts:666–680  ·  view source on GitHub ↗
(type: string, length: number = -1)

Source from the content-addressed store, hash-verified

664}
665
666export function postgresTypeToJsType(type: string, length: number = -1): [string, number] {
667 type = type.toLowerCase()
668 switch (type) {
669 case "text":
670 case "varchar":
671 return ["string", length]
672 case "long":
673 case "int":
674 return ["number", length]
675 case "bool":
676 return ["boolean", length]
677 default:
678 return [type, length]
679 }
680}
681
682export function getPostgresType(type: string): [string, number] {
683 type = type.toLowerCase()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected