SqliteAlterTableDeleteCompositePrimaryKeyConvertor Class — drizzle-orm Architecture
Architecture documentation for the SqliteAlterTableDeleteCompositePrimaryKeyConvertor class in sqlgenerator.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD 3fad0c3d_f947_1855_2ce8_2683d33326e4["SqliteAlterTableDeleteCompositePrimaryKeyConvertor"] fe4174c7_3b9c_5b26_98a0_b2395ca21939["sqlgenerator.ts"] 3fad0c3d_f947_1855_2ce8_2683d33326e4 -->|defined in| fe4174c7_3b9c_5b26_98a0_b2395ca21939 e3e9f150_6314_59f4_b27b_39e3f5802ed7["can()"] 3fad0c3d_f947_1855_2ce8_2683d33326e4 -->|method| e3e9f150_6314_59f4_b27b_39e3f5802ed7 91fafd8c_7377_ee91_fe23_c844fa1f63fb["convert()"] 3fad0c3d_f947_1855_2ce8_2683d33326e4 -->|method| 91fafd8c_7377_ee91_fe23_c844fa1f63fb
Relationship Graph
Source Code
drizzle-kit/src/sqlgenerator.ts lines 3190–3216
class SqliteAlterTableDeleteCompositePrimaryKeyConvertor extends Convertor {
can(statement: JsonStatement, dialect: Dialect): boolean {
return statement.type === 'delete_composite_pk' && dialect === 'sqlite';
}
convert(statement: JsonDeleteCompositePK) {
let msg = '/*\n';
msg += `You're trying to delete PRIMARY KEY(${statement.data}) from '${statement.tableName}' table\n`;
msg += 'SQLite does not supportprimary key deletion from existing table\n';
msg += 'You can do it in 3 steps with drizzle orm:\n';
msg += ' - create new mirror table table without pk, rename current table to old_table, generate SQL\n';
msg += ' - migrate old data from one table to another\n';
msg += ' - delete old_table in schema, generate sql\n\n';
msg += 'or create manual migration like below:\n\n';
msg += 'ALTER TABLE table_name RENAME TO old_table;\n';
msg += 'CREATE TABLE table_name (\n';
msg += '\tcolumn1 datatype [ NULL | NOT NULL ],\n';
msg += '\tcolumn2 datatype [ NULL | NOT NULL ],\n';
msg += '\t...\n';
msg += '\tPRIMARY KEY (pk_col1, pk_col2, ... pk_col_n)\n';
msg += ' );\n';
msg += 'INSERT INTO table_name SELECT * FROM old_table;\n\n';
msg += "Due to that we don't generate migration automatically and it has to be done manually\n";
msg += '*/\n';
return msg;
}
}
Domain
Defined In
Source
Frequently Asked Questions
What is the SqliteAlterTableDeleteCompositePrimaryKeyConvertor class?
SqliteAlterTableDeleteCompositePrimaryKeyConvertor is a class in the drizzle-orm codebase, defined in drizzle-kit/src/sqlgenerator.ts.
Where is SqliteAlterTableDeleteCompositePrimaryKeyConvertor defined?
SqliteAlterTableDeleteCompositePrimaryKeyConvertor is defined in drizzle-kit/src/sqlgenerator.ts at line 3190.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free