feat(desktop): drop tree schema objects
This commit is contained in:
1 parent
17504be027
commit
ac7a5b7576
15 files changed
+466
-13
No files matched your search
@@ -106,6 +106,7 @@ export const buildCreateDatabaseSql = forward("buildCreateDatabaseSql");
|
||||
export const buildDuckDbAttachDatabaseSql = forward("buildDuckDbAttachDatabaseSql");
|
||||
export const buildDropObjectSql = forward("buildDropObjectSql");
|
||||
export const buildDropTableSql = forward("buildDropTableSql");
|
||||
export const buildDropTableChildObjectSql = forward("buildDropTableChildObjectSql");
|
||||
export const buildEmptyTableSql = forward("buildEmptyTableSql");
|
||||
export const buildTruncateTableSql = forward("buildTruncateTableSql");
|
||||
export const buildDropDatabaseSql = forward("buildDropDatabaseSql");
|
||||
|
||||
@@ -14,6 +14,16 @@ export interface TableAdminSqlOptions {
|
||||
tableName: string;
|
||||
}
|
||||
|
||||
export type TableChildObjectType = "COLUMN" | "INDEX" | "FOREIGN_KEY" | "TRIGGER";
|
||||
|
||||
export interface DropTableChildObjectSqlOptions {
|
||||
databaseType?: DatabaseType;
|
||||
objectType: TableChildObjectType;
|
||||
schema?: string | null;
|
||||
tableName: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface DatabaseNameSqlOptions {
|
||||
databaseType?: DatabaseType;
|
||||
name: string;
|
||||
@@ -39,6 +49,10 @@ export function buildDropTableSql(options: TableAdminSqlOptions): Promise<string
|
||||
return api.buildDropTableSql(options);
|
||||
}
|
||||
|
||||
export function buildDropTableChildObjectSql(options: DropTableChildObjectSqlOptions): Promise<string> {
|
||||
return api.buildDropTableChildObjectSql(options);
|
||||
}
|
||||
|
||||
export function buildEmptyTableSql(options: TableAdminSqlOptions): Promise<string> {
|
||||
return api.buildEmptyTableSql(options);
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ import type { BuildRenameObjectSqlOptions } from "@/lib/objectRenameSql";
|
||||
import type { CreateDatabaseSqlOptions } from "@/lib/createDatabaseSql";
|
||||
import type {
|
||||
DatabaseNameSqlOptions,
|
||||
DropTableChildObjectSqlOptions,
|
||||
DropObjectSqlOptions,
|
||||
DuplicateTableStructureSqlOptions,
|
||||
SchemaNameSqlOptions,
|
||||
@@ -588,6 +589,10 @@ export async function buildDropTableSql(options: TableAdminSqlOptions): Promise<
|
||||
return post("/api/query/build-drop-table-sql", { options });
|
||||
}
|
||||
|
||||
export async function buildDropTableChildObjectSql(options: DropTableChildObjectSqlOptions): Promise<string> {
|
||||
return post("/api/query/build-drop-table-child-object-sql", { options });
|
||||
}
|
||||
|
||||
export async function buildEmptyTableSql(options: TableAdminSqlOptions): Promise<string> {
|
||||
return post("/api/query/build-empty-table-sql", { options });
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ import type { BuildRenameObjectSqlOptions } from "@/lib/objectRenameSql";
|
||||
import type { CreateDatabaseSqlOptions } from "@/lib/createDatabaseSql";
|
||||
import type {
|
||||
DatabaseNameSqlOptions,
|
||||
DropTableChildObjectSqlOptions,
|
||||
DropObjectSqlOptions,
|
||||
DuplicateTableStructureSqlOptions,
|
||||
SchemaNameSqlOptions,
|
||||
@@ -580,6 +581,10 @@ export async function buildDropTableSql(options: TableAdminSqlOptions): Promise<
|
||||
return invoke("build_drop_table_sql", { options });
|
||||
}
|
||||
|
||||
export async function buildDropTableChildObjectSql(options: DropTableChildObjectSqlOptions): Promise<string> {
|
||||
return invoke("build_drop_table_child_object_sql", { options });
|
||||
}
|
||||
|
||||
export async function buildEmptyTableSql(options: TableAdminSqlOptions): Promise<string> {
|
||||
return invoke("build_empty_table_sql", { options });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user