How pingfangushi/screw works
Project type and purpose
• This is a multi-module Java open-source tool (not a web or full-stack app).
• Modules:
• screw-core: the engine that introspects JDBC data sources, builds metadata models, processes them, and renders documentation via templates (HTML/Markdown/Word).
• screw-extension: an optional POJO-generation extension built on top of screw-core to create Java entity classes from database tables.
• screw-maven-plugin: a Maven Mojo wrapper that allows running the documentation generator directly during a Maven build.
• Purpose: generate database schema documentation (and optionally POJOs) automatically from live databases.
File structure
• Top-level pom.xml with three child modules.
• lib/: JDBC driver JARs for CacheDB, DM.
• screw-core:
• src/main/java/cn/smallbun/screw/core: core packages: configuration, version, constants.
• core/query/*: DatabaseQueryFactory → dialect-specific DatabaseQuery implementations → metadata models.
• core/process: transforms metadata models into DataModel.
• core/execute: DocumentationExecute orchestrates query → process → template engine.
• core/engine: AbstractTemplateEngine + Freemarker/Velocity implementations.
• core/util & core/mapping: shared helpers and mapping abstractions.
• src/main/resources/template: FTL/VM templates for html/md/word.
• src/main/resources/properties: per-dialect SQL properties.
• screw-extension: parallels core but for PojoExecute, PojoEngine, TypeDialect, HumpNameStrategy.
• screw-maven-plugin: Mojo class (RunDocMojo) that builds a Configuration and invokes DocumentationExecute (and could be extended to Pojo).
README insights
• Core library is intended to be embedded or invoked by user code or via the Maven plugin.
• EngineConfig, ProcessConfig, Configuration (cn.smallbun.screw.core.Configuration) form the user API.
• Data flow: DataSource → Configuration → DocumentationExecute → Query → Process → TemplateEngine → filesystem output.