(table: string)
| 83 | } |
| 84 | } |
| 85 | private createFile(table: string) { |
| 86 | // FIXME: schema is not used to write the file name and there could be collisions. For now it |
| 87 | // is up to the developer to pick the right schema, and potentially chose different output |
| 88 | // folders for each different schema. |
| 89 | const [schemaName, tableName] = qNameSplit(table); |
| 90 | const fileName = recase(this.options.caseFile, tableName, this.options.singularize); |
| 91 | const filePath = path.join(this.options.directory, fileName + (this.options.lang === 'ts' ? '.ts' : '.js')); |
| 92 | |
| 93 | const writeFile = util.promisify(fs.writeFile); |
| 94 | return writeFile(path.resolve(filePath), this.tableText[table]); |
| 95 | } |
| 96 | |
| 97 | /** Create the belongsToMany/belongsTo/hasMany/hasOne association strings */ |
| 98 | private createAssociations(typeScript: boolean) { |
no test coverage detected