(dbml: string)
| 702 | |
| 703 | // Fix table names that have been broken across multiple lines |
| 704 | const fixMultilineTableNames = (dbml: string): string => { |
| 705 | // Match Table declarations that might have line breaks in the table name |
| 706 | // This regex captures: |
| 707 | // - Table keyword |
| 708 | // - Optional quoted schema with dot |
| 709 | // - Table name that might be broken across lines (until the opening brace) |
| 710 | return dbml.replace( |
| 711 | /Table\s+((?:"[^"]*"\.)?"[^"]*(?:\n[^"]*)*")\s*\{/g, |
| 712 | (_, tableName) => { |
| 713 | // Remove line breaks within the table name |
| 714 | const fixedTableName = tableName.replace(/\n\s*/g, ''); |
| 715 | return `Table ${fixedTableName} {`; |
| 716 | } |
| 717 | ); |
| 718 | }; |
| 719 | |
| 720 | // Restore increment attribute for auto-incrementing fields |
| 721 | const restoreIncrementAttribute = (dbml: string, tables: DBTable[]): string => { |
no outgoing calls
no test coverage detected