0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 12:29:41 +08:00

Extend match expression for table names in ddl2cpp

Using pg_dump, if the table is named after a special keyword (e.g. character),
is dumped as public."character".
This commit extends the names expression to match those cases.
This commit is contained in:
Gonzalo Fernandez Yaique 2023-01-18 12:35:53 -03:00 committed by Roland Bock
parent a77d8009bb
commit 5b0eee1c4c

View File

@ -43,7 +43,7 @@ ddlString = (
pp.QuotedString("'") | pp.QuotedString('"', escQuote='""') | pp.QuotedString("`")
)
ddlTerm = pp.Word(pp.alphas + "_", pp.alphanums + "_.$")
ddlName = pp.Or([ddlTerm, ddlString, pp.Combine(ddlString + "." + ddlString)])
ddlName = pp.Or([ddlTerm, ddlString, pp.Combine(ddlString + "." + ddlString), pp.Combine(ddlTerm + ddlString)])
ddlOperator = pp.Or(
map(pp.CaselessLiteral, ["+", "-", "*", "/", "<", "<=", ">", ">=", "=", "%", "DIV"])
)