Code Monkey home page Code Monkey logo

maotai's Introduction

Maotai

1 环境

1.1 Project JDK 设置为 17

project_jdk

1.2 Gradle JDK 设置为 17

gradle_jdk

1.3 如果需要预览 SQL 语法树,可以安装 IDEA ANTLR v4 插件

antlr4

1.4 如果需要预览 compose 组件,可以安装 IDEA compose 插件

compose

1.5 打包运行 gradle packageDistributionForCurrentOS

2 模块

  • core SQL 处理的核心逻辑
  • desktop 客户端界面

2.1 core 模块包目录

  • generate 脚本生成
  • lang 第三方语法解析
  • model 模型 & 数据结构
  • parser 抽象、简化的解析适配
  • type 数据类型

2.2 core 模块开发

  • 参考 com.enhe.sql.MySQLTransferTest 单元测试
  • 运行测试读取脚本请修改 com.enhe.sql.util.ScriptReader 的读取目录
  • 使用 ANTLR 插件调试:打开左侧工具栏的 ANTLR Preview 窗口,然后鼠标选中 src/test/resources/MySQL/lang/MySqlParser.g4 文件,即可在工具窗口左侧写入 SQL,右侧会展示出他的语法树
  • 主要的解析语法的逻辑在 lang.mysql.visitor 包下
  • 整体运行逻辑是 SQLTransfer 转换器入口 -> SQLParseAdapter 解析适配 -> LangParserVisitor 目标语法解析 -> Model 抽象出模型 -> Generate 生成新的脚本 -> Script 脚本

2.3 desktop 模块开发

maotai's People

Contributors

dingshichen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.