rider连接mysql数据库_Rider: Rider 文件数据库 用SQL解析文件(1)完全支持MySql协议(2)完全支持Mybatis-Generator(3)支持Schema和Table(4...

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;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值