mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-05 22:43:30 +00:00
fix build
This commit is contained in:
@@ -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 PostgreSQL’s 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.**
|
||||
|
||||
Reference in New Issue
Block a user