Git Product home page Git Product logo

dbtools's Introduction

使用说明:

同公司的小伙伴如有不明白可询问作者:王新驰 (说明文档最近更新一次时间:2021-02-12 16:20)

一、维护好文件夹下的相应的sql脚本即可,主要有【主库/租户库建表脚本】+【索引脚本】,其他的非必须,

其中sql语句格式要求如下:

  1. 每句完整sql结束时以分号结尾并换行
  2. 所有表名,列名,索引名需全部为大写(大写兼容性最强)
  3. 索引部分,为了只维护一份脚本就达到多个环境均通用的效果,索引需单独提取并写成一份【通用形式】的创建语句,当前主要提取的是【非主键】索引

二、特别备注:

暂时没有

三、关于sql解析规则

校验器初衷是:navicat一键导出的mysql语句,可以直接复制粘贴。这样方便维护。 不过navicat导出的语句中,可能包含了类似【CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI】等字符,且mysql,oracle,sqlServer三者导出的数据各有不同。 为了sql显得干净清晰统一,建议手动去除,就像当前在模板里包含的那样子。 当然,如果你想偷懒,也可以不去管他们,直接一键导出一键复制粘贴使用。

四、使用说明

如果你是【单租户环境】部署/更新/升级,则只需要改一改jdbc.properties文件里头得到地址即可使用,然后执行App类的main函数即可 如果你是【多租户环境】部署/更新/升级,则需要自己实现DbToolsConfig接口里的方法,保证每次调用校验器的validateTables方法时,该实现类的getJdbcTemplate方法已经完成租户库的切库即可。 多租户环境新建校验器的时候,使用自己的那个DbToolsConfig实现类,而不再使用StandaloneDbToolsConfig。

dbtools's People

Contributors

tianzhihen121 avatar

Forkers

glpyh jameszgw

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.