(type: string, length: number = -1)
| 664 | } |
| 665 | |
| 666 | export 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 | |
| 682 | export function getPostgresType(type: string): [string, number] { |
| 683 | type = type.toLowerCase() |
nothing calls this directly
no outgoing calls
no test coverage detected