rider连接mysql数据库_GitHub - alchemystar/Rider: 文件数据库
Rider 文件數(shù)據(jù)庫(kù)
用SQL解析文件
(1)完全支持MySql協(xié)議
(2)完全支持Mybatis-Generator
(3)完全支持Mybatis
(4)支持Schema和Table
(5)支持客戶端創(chuàng)建Schema和Table
(6)支持常用select語(yǔ)句where,condition,行運(yùn)算等
(7)支持視圖功能,即用舊表的SQL定義新表
(8)支持各種文件格式(各種分隔符分割,Xlsx)
(9)支持按時(shí)間動(dòng)態(tài)切換表
QQ群
608733920
##啟動(dòng)
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
user
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 -uuser -p123123123 -P8090 -h127.0.0.1
jdbc連接 jdbc:mysql://127.0.0.1/test?user=user&password=123123123
創(chuàng)建表
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 默認(rèn)引擎,即默認(rèn)以換行符和分隔符來(lái)組織文件的結(jié)構(gòu)
SEP=',',可以指定當(dāng)前文件用哪種分隔符來(lái)分隔
Charset='gbk',指定當(dāng)前文件的編碼格式
SkipWrong='false' false:文件某一行列數(shù)和定義列數(shù)不匹配,則報(bào)error|true,忽略當(dāng)前行
配置表對(duì)應(yīng)的文件路徑
session內(nèi)配置:
set table_path="t_archer:/home/work/archer.txt"
配置文件內(nèi)配置:
/Users/alchemystar/tmp/rider/rider_%d{yyyy-MM-dd}.txt
視圖配置,viewSql可以是任意sql(可以用視圖再次創(chuàng)建視圖):
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)支持行運(yùn)算
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)支持設(shè)置字符集
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;
總結(jié)
以上是生活随笔為你收集整理的rider连接mysql数据库_GitHub - alchemystar/Rider: 文件数据库的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 英国用欧元吗,不用
- 下一篇: linux cmake编译源码,linu