IDEA database tools and sql extractors 自定义数据提取器

根据自带的提取脚本,写了两个比较实用的提取器

分别为

  • 单列 in 条件生成(只处理单列,自动处理是否加引号) IN-CONDITION.sql.groovy
  • 驼峰命名的json导出(可单列,可多列) JSON-Camel-Groovy.json.groovy

使用步骤:

  • 下载文件解压到 ~/Library/Preferences/IntelliJIdea2018.3/extensions/com.intellij.database/data/extractors
  • 选中相应的提取器后,执行查询语句
  • 然后command + c 复制相应列 或者 使用导出到文件

下载地址

https://download.csdn.net/download/zhanggang807/11424224

举个粟子:

在这里插入图片描述
在这里插入图片描述

in 条件生成 为
id in (101556, 101557, 101558) 
create_time in ('2019-07-14 21:50:35', '2019-07-14 21:50:35', '2019-07-14 21:50:35') 
json导出为
[
  {
    "id": 101556
  },
  {
    "id": 101557
  },
  {
    "id": 101558
  }
]
[
  {
    "createTime": "2019-07-14 21:50:35"
  },
  {
    "createTime": "2019-07-14 21:50:35"
  },
  {
    "createTime": "2019-07-14 21:50:35"
  }
]

你可能感兴趣的:(Other,Java,groovy,extractors,idea,database,tool)