feat(CockroachDB): Add CockroachDB support (#472)

* feat(add CockroachDB): Add support in CockroachDB

* remove toggle from toolbar

* fix key

---------

Co-authored-by: Guy Ben-Aharon <baguy3@gmail.com>
This commit is contained in:
Jonathan Fishner
2024-12-09 21:46:34 +02:00
committed by GitHub
parent 2309306ef5
commit 5409288388
15 changed files with 297 additions and 12 deletions

View File

@@ -383,6 +383,12 @@ const generateSQLPrompt = (databaseType: DatabaseType, sqlScript: string) => {
- **Conditional Logic**: Ensure the script uses SQLite-compatible syntax and does not include unsupported features.
`,
clickhouse: '',
cockroachdb: `
- **Sequence Creation**: Use \`CREATE SEQUENCE IF NOT EXISTS\` for sequence creation.
- **Table and Index Creation**: Use \`CREATE TABLE IF NOT EXISTS\` and \`CREATE INDEX IF NOT EXISTS\` to avoid errors if the object already exists.
- **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.
`,
};
const dialectInstruction = dialectInstructionMap[databaseType] ?? '';