Rider 文档解析中间件

用SQL解析文件

(1)完全支持MySql协议

(2)完全支持Mybatis-Generator

(3)支持Schema和Table

(4)支持客户端创建Schema和Table

(5)支持常用select语句where,condition,行运算等

(6)支持视图功能,即用旧表的SQL定义新表

(7)支持各种文件格式(各种分隔符分割,Xlsx)

QQ群

608733920

##启动

git clone https://github.com/alchemystar/Rider.git

mvn clean package

cd target && tar zxvf rider.tar.gz

cd ./bin

sh start.sh

配置文件,在./conf中

8090

pay

123123123

test

create table if not exists t_view (id BIGINT comment 'id view',nameExtension VARCHAR comment 'name extension')Engine='archer',Charset='gbk'

select a.id*1000,a.name||b.extension,a.id from t_archer as a join t_archer as b where a.id=b.id

create table if not exists t_archer( id BIGINT comment 'id test ', name VARCHAR comment 'name

test',

extension VARCHAR comment 'extension' )Engine='archer' SEP=',' SKIPWRONG='false' comment='just for test'

3

/Users/alchemystar/tmp/rider/rider_%d{yyyy-MM-dd}.txt

使用

直接连接 mysql -upa12312y -p123123123 -P8090 -h127.0.0.1

jdbc连接 jdbc:mysql://127.0.0.1/test?user=pay&password=3123r1254213

创建表

create table if not exists t_archer(

id BIGINT comment 'id test ',

name VARCHAR comment 'name test',

extension VARCHAR comment 'extension' )

Engine='archer' SEP=',' Charset='gbk' SkipWrong='false' comment='just for test'

Engine=archer 默认引擎,即默认以换行符和分隔符来组织文件的结构

SEP=',',可以指定当前文件用哪种分隔符来分隔

Charset='gbk',指定当前文件的编码格式

SkipWrong='false' false:文件某一行列数和定义列数不匹配,则报error|true,忽略当前行

配置表对应的文件路径

session内配置:

set table_path="t_archer:/home/work/archer.txt"

配置文件内配置:

/Users/alchemystar/tmp/rider/rider_%d{yyyy-MM-dd}.txt

视图配置,viewSql可以是任意sql(可以用视图再次创建视图):

select a.id*1000,a.name||b.extension,a.id from t_archer as a join t_archer as b where a.id=b.id

查询表

(1)支持*符

select * from t_archer;

(2)支持行运算

select (id+1)*6,name||extesion,extension from t_archer;

(3)支持where condition

select * from t_archer where (id >1 and extension='rider') or (extension='archer')

(4)支持设置字符集

set names gbk;

(5)支持两表join

select a.id,b.id from t_rider as a join t_archer as b on a.id=b.id where id>1;

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐