This commit is contained in:
1 parent
8efd032cc6
commit
df38dccbf1
735 files changed
+128321
-120870
No files matched your search
@@ -2,17 +2,17 @@ import { describe, expect, it } from "vitest";
|
||||
import { splitSqlStatements } from "./sql-statements";
|
||||
|
||||
describe("splitSqlStatements", () => {
|
||||
it("ignores semicolons inside line comments", () => {
|
||||
const sql = [
|
||||
"-- Existing installs have this; new installs need it.",
|
||||
"ALTER TABLE users ADD COLUMN IF NOT EXISTS example TEXT NULL;",
|
||||
"-- next statement",
|
||||
"CREATE TABLE IF NOT EXISTS example_table (id INT PRIMARY KEY);",
|
||||
].join("\n");
|
||||
it("ignores semicolons inside line comments", () => {
|
||||
const sql = [
|
||||
"-- Existing installs have this; new installs need it.",
|
||||
"ALTER TABLE users ADD COLUMN IF NOT EXISTS example TEXT NULL;",
|
||||
"-- next statement",
|
||||
"CREATE TABLE IF NOT EXISTS example_table (id INT PRIMARY KEY);",
|
||||
].join("\n");
|
||||
|
||||
expect(splitSqlStatements(sql)).toEqual([
|
||||
"ALTER TABLE users ADD COLUMN IF NOT EXISTS example TEXT NULL",
|
||||
"CREATE TABLE IF NOT EXISTS example_table (id INT PRIMARY KEY)",
|
||||
]);
|
||||
});
|
||||
expect(splitSqlStatements(sql)).toEqual([
|
||||
"ALTER TABLE users ADD COLUMN IF NOT EXISTS example TEXT NULL",
|
||||
"CREATE TABLE IF NOT EXISTS example_table (id INT PRIMARY KEY)",
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user