0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Fix part of issue #418 (#419)

The first problem in https://github.com/rbock/sqlpp11/issues/418

Match table name ```"public"."dk"``` to ```_literal[] = public.dk``` and ```struct PublicDK```
This commit is contained in:
vrqq 2022-01-31 14:00:58 +08:00 committed by GitHub
parent d8f841121b
commit d8a76fa282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,10 +59,12 @@ def repl_camel_case_func(m):
def class_name_naming_func(s):
s = s.replace('.', '_')
return re.sub("(^|\s|[_0-9])(\S)", repl_camel_case_func, s)
def member_name_naming_func(s):
s = s.replace('.', '_')
return re.sub("(\s|_|[0-9])(\S)", repl_camel_case_func, s)
toClassName = class_name_naming_func
@ -199,7 +201,7 @@ ddlString = Or([QuotedString("'"), QuotedString("\"", escQuote='""'), QuotedStri
negativeSign = Literal('-')
ddlNum = Combine(Optional(negativeSign) + Word(nums + "."))
ddlTerm = Word(alphanums + "_$")
ddlName = Or([ddlTerm, ddlString])
ddlName = Or([ddlTerm, ddlString, Combine(ddlString + "." + ddlString)])
ddlMathOp = Word("+><=-")
ddlBoolean = Or([ddlWord("AND"), ddlWord("OR"), ddlWord("NOT")])
ddlArguments = "(" + delimitedList(Or([ddlString, ddlTerm, ddlNum])) + ")"