( schema: AnySchema )
| 1 | import type { AnySchema, NameVariants } from "./create"; |
| 2 | |
| 3 | export function exportNameVariants( |
| 4 | schema: AnySchema |
| 5 | ): Record<string, NameVariants> { |
| 6 | const out: Record<string, NameVariants> = {}; |
| 7 | |
| 8 | for (const table of Object.values(schema.tables)) { |
| 9 | out[table.ormName] = table.names; |
| 10 | |
| 11 | for (const col of Object.values(table.columns)) { |
| 12 | out[`${table.ormName}.${col.ormName}`] = col.names; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | return out; |
| 17 | } |
no test coverage detected