fix build

This commit is contained in:
Guy Ben-Aharon
2024-08-25 01:00:19 +03:00
parent 010ba2e58d
commit ee4f3e8819

View File

@@ -203,8 +203,7 @@ const generateSQLPrompt = (databaseType: DatabaseType, sqlScript: string) => {
- **Column Name Conflicts**: When a column name conflicts with a data type or reserved keyword (e.g., fulltext), escape the column name by enclosing it.
`;
const dialectInstructionMap: Record<DatabaseType, string> =
{
const dialectInstructionMap: Record<DatabaseType, string> = {
generic: '',
postgresql: `
- **Sequence Creation**: Use \`CREATE SEQUENCE IF NOT EXISTS\` for sequence creation.
@@ -212,7 +211,7 @@ const generateSQLPrompt = (databaseType: DatabaseType, sqlScript: string) => {
- **Serial and Identity Columns**: For auto-increment columns, use \`SERIAL\` or \`GENERATED BY DEFAULT AS IDENTITY\`.
- **Conditional Statements**: Utilize PostgreSQLs support for \`IF NOT EXISTS\` in relevant \`CREATE\` statements.
`,
 mysql: `
mysql: `
- **Table Creation**: Use \`CREATE TABLE IF NOT EXISTS\` for creating tables. While creating the table structure, ensure that all foreign key columns use the correct data types as determined in the foreign key review.
- **Auto-Increment**: Use \`AUTO_INCREMENT\` for auto-incrementing primary key columns.
- **Index Creation**: Place all \`CREATE INDEX\` statements separately after the \`CREATE TABLE\` statement. Avoid using \`IF NOT EXISTS\` in \`CREATE INDEX\` statements.
@@ -259,7 +258,7 @@ const generateSQLPrompt = (databaseType: DatabaseType, sqlScript: string) => {
`,
};
const dialectInstruction:string = dialectInstructionMap[databaseType] ?? '';
const dialectInstruction = dialectInstructionMap[databaseType] ?? '';
const additionalInstructions = `
**Provide just the SQL commands without markdown tags.**