schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

Name Generation Functionality Error (cleanname) #1179

Closed Lee-WonJun closed 1 year ago

Lee-WonJun commented 1 year ago

Description

code

# Mermaid only allows alphanumeric identifiers
def cleanname(name):
    namepattern = r'[^0-9a-zA-Z]'
    cleanedname = re.sub(namepattern, '', name)
    if not cleanedname:
        cleanedname = "UNKNOWN"
    return cleanedname

cleanname function is filter via regex in mermaid.py

But as I see, Mermaid supports dashes (-) and underscores (_) as well, and specifically, underscores are commonly used in DB schema.

image link

so IMHO, we can modify regex in mermaid.py

How to Reproduce

No response

Relevant log output

No response

SchemaCrawler Version

SchemaCrawler 16.19.11

Java Version

Eclipse Adoptium OpenJDK 64-Bit Server VM 17.0.7+7

Operating System and Version

Windows 11 10.0

Relational Database System and Version

Postgres

JDBC Driver and Version

-

Lee-WonJun commented 1 year ago

I have noticed that this repository does not accept PRs. Therefore, I would like to share example commit

sualeh commented 1 year ago

@Lee-WonJun Thanks for the detailed issue description, and example commit. This will be released in the next release. Is this blocking you, or can you wait for the next release?

Lee-WonJun commented 1 year ago

that's find, i already printed my own mermaid code by my commit script