(1)完全支持MySql协议
(2)完全支持Mybatis-Generator
(3)支持Schema和Table
(4)支持客户端创建Schema和Table
(5)支持常用select语句where,condition,行运算等
(6)支持视图功能,即用旧表的SQL定义新表
(7)支持各种文件格式(各种分隔符分割,Xlsx)
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中
<database>
<port>8090</port> <!--server 端口号-->
<user>pay</user> <!--server 用户名-->
<pass>123123123</pass> <!--server 密码-->
<schema> <!--schema定义-->
<name>test</name> <!--schema名称-->
<table>
<sql> create table if not exists t_view (id BIGINT comment 'id view',nameExtension VARCHAR comment 'name extension')Engine='archer',Charset='gbk'
</sql>
<!--这是一个视图表,其表内容为下面的viewSql的执行结果-->
<viewSql> 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 </viewSql>
</table>
<table> <!--表定义-->
<sql> <!--表定义sql-->
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'
</sql>
<skipRows>3</skipRows> <!--忽略掉前skipRows行-->
<pathPattern>/Users/alchemystar/tmp/rider/rider_%d{yyyy-MM-dd}.txt</pathPattern> <!--当前表对应的文件地址,可用时间格式渲染-->
</table>
</schema>
</database>
直接连接 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"
配置文件内配置:
<pathPattern>/Users/alchemystar/tmp/rider/rider_%d{yyyy-MM-dd}.txt</pathPattern> <!--当前表对应的文件地址,可用时间格式渲染-->
视图配置,viewSql可以是任意sql(可以用视图再次创建视图):
<viewSql> 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 </viewSql>
(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;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.