feat(formatter): add custom default SQL layout engine
This commit is contained in:
20 files changed
+1588
-175
No files matched your search
Vendored
+5
-1
@@ -14,7 +14,11 @@ import { DEFAULT_SQL_FORMATTER_SETTINGS } from "@/lib/sql/sqlFormatterConfig";
|
||||
// QueryEditor.vue survives across the editor mounts in this file, so every test
|
||||
// must advance its ids monotonically (never reuse a smaller id) to mirror the
|
||||
// production counter.
|
||||
const ORIGINAL_SQL = "select id, name\nfrom users\nwhere id = 1";
|
||||
//
|
||||
// The sample is long enough that formatting cannot collapse it onto one line:
|
||||
// the default style joins a statement that fits onto one line, and the replay
|
||||
// assertions below need a multi-line result.
|
||||
const ORIGINAL_SQL = "select id, name, email, status, created_at, updated_at, tenant_id\nfrom users\nwhere status = 'active'\nand tenant_id = 42\nand deleted_at is null";
|
||||
const COMPRESSED_SQL = compressSqlText(ORIGINAL_SQL, "mysql");
|
||||
const FORMATTED_SQL = await formatSqlForEditing(COMPRESSED_SQL, "mysql", DEFAULT_SQL_FORMATTER_SETTINGS);
|
||||
|
||||
|
||||
Reference in new issue
Block a user