Skip to content

Commit

Permalink
Fix cvas serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubknejzlik committed Feb 8, 2024
1 parent 1218bcf commit a3661f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/CreateViewAsSelect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ describe("CreateViewAsSelect", () => {
});

it("should serialize and deserialize correctly", () => {
const cvas = Q.createTableAs(viewName, initialSelectQuery);
const cvas = Q.createViewAs(viewName, initialSelectQuery);
const cvasReplace = Q.createOrReplaceViewAs(viewName, initialSelectQuery);
const serialized = cvas.serialize();
const deserialized = Q.deserialize(serialized);

expect(deserialized.toSQL(new MySQLFlavor())).toEqual(
cvas.toSQL(new MySQLFlavor())
);
expect(
Q.deserialize(cvasReplace.serialize()).toSQL(new MySQLFlavor())
).toEqual(cvasReplace.toSQL(new MySQLFlavor()));
});

it("should fetch table names correctly", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export enum MetadataOperationType {
UPDATE = "Update",
DELETE = "Delete",
CREATE_TABLE_AS = "CTAS",
CREATE_VIEW_AS = "CTAS",
CREATE_VIEW_AS = "CVAS",
}

export interface IMetadata {
Expand Down

0 comments on commit a3661f2

Please sign in to comment.