Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

670 B
Raw Blame
import type { DatabaseType } from "@/types/database";

/**
 * Joins generated DDL statements into a script for display/copy. SQL Server statements
 * are separated with GO so tools that execute the copied script (SSMS, sqlcmd, DBX's
 * GO-aware runner) treat each statement as an independent batch. GO only defines batch
 * boundaries; whether execution continues after an error depends on the client policy.
 */
export function joinSqlStatementsForScript(statements: readonly string[], databaseType?: DatabaseType): string {
  if (databaseType !== "sqlserver") return statements.join("\n");
  return statements.map((statement) => statement.trimEnd()).join("\nGO\n");
}