From 997f6465b9733f1c6d666cdfbd4dcd804b86aed7 Mon Sep 17 00:00:00 2001 From: Carlitxxx86 <104036996+Carlitxxx86@users.noreply.github.com> Date: Sat, 23 Apr 2022 10:47:48 -0400 Subject: [PATCH 1/2] Added instructions to ignore OR REPLACE clause --- scripts/ddl2cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ddl2cpp b/scripts/ddl2cpp index 503721f6e..bc47ecc5b 100755 --- a/scripts/ddl2cpp +++ b/scripts/ddl2cpp @@ -254,8 +254,12 @@ ddlConstraint = pp.Group( ddlIfNotExists = pp.Group( pp.CaselessLiteral("IF") + pp.CaselessLiteral("NOT") + pp.CaselessLiteral("EXISTS") ).setResultsName("ifNotExists") +ddlOrReplace = pp.Group( + pp.CaselessLiteral("OR") + pp.CaselessLiteral("REPLACE") +).setResultsName("orReplace") ddlCreateTable = pp.Group( pp.CaselessLiteral("CREATE") + + pp.Suppress(pp.Optional(ddlOrReplace)) + pp.CaselessLiteral("TABLE") + pp.Suppress(pp.Optional(ddlIfNotExists)) + ddlName.setResultsName("tableName") From 6072c9b01ab7d6246d6200a4742d0072c928fdf8 Mon Sep 17 00:00:00 2001 From: Carlitxxx86 <104036996+Carlitxxx86@users.noreply.github.com> Date: Sun, 24 Apr 2022 09:15:05 -0400 Subject: [PATCH 2/2] Added OR REPLACE clause --- tests/scripts/ddl2cpp_sample_good.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/ddl2cpp_sample_good.sql b/tests/scripts/ddl2cpp_sample_good.sql index cf96ca2ee..8eeda9237 100644 --- a/tests/scripts/ddl2cpp_sample_good.sql +++ b/tests/scripts/ddl2cpp_sample_good.sql @@ -33,7 +33,7 @@ CREATE TABLE tab_foo CONSTRAINT uc_delta UNIQUE (delta, _epsilon) ); -CREATE TABLE tab_bar +CREATE OR REPLACE TABLE tab_bar ( alpha bigint AUTO_INCREMENT RRIMARY_KEY, beta varchar(255) NULL DEFAULT "",