一、安装库
1、查看数据库是否按安装
1.1 DatabaseLibrary
pip3 install mysqlclient-2.0.1-cp37-cp37m-win_amd64.whl
dos 下安装
关键字:
1、connect to database #连接数据库的配置信息
connect to database pymysql dcs root 123456 192.168.153.131 3306
2、table must exist
table must exist test # 判断表存在 #有则ok没有则NO
2。1不存在的表,报错
2.2存在的表,运行成功
3、Check If Exists In Database
3.1判断数据库中已经存在的数据
3.2 判断数据库中不存存在的数据
4、check if not exists in database
4.1
4.2
5\ Delete All Rows From Table 删除表中所有数据
Delete All Rows From Table sc #删除表中所有数据 Disconnect From Database
6\Execute Sql Script D:\sql.txt #执行脚本
6、Execute Sql String #执行sql语句
Execute Sql String insert into test values (12,23); #执行sql语句
7、Query
${vael} Query select * from test
log ${vael} #查询当前表中所有的数据
8、ROW COUNT
${count} ROW COUNT select * from test
log ${count} #统计当前数据库中的行数
9. ROW COUNT IS 0 #判断当前数据库中没有的数据
ROW COUNT IS 0
select * from s ; #判断当前数据库中没有的数据
10、ROW COUNT IS equal to x #行数等于 多少行
10.1
ROW COUNT IS equal to x select * from test 13 #行数等于10
10.2
ROW COUNT IS equal to x select * from test 10 #行数等于10
11. Row Count Is Greater Than X #行数大于多少行
Row Count Is Greater Than X select * from test 11 #行数大于11 `
10.2
11.Row Count Is Less Than X # #行数小于
Row Count Is Less Than X
select * from test; 20 #行数小于20
Row Count Is Less Than X
select * from test; 9 #行数小于20
11、 Disconnect From Database #断开数据库连接 #断开数据库连接
Disconnect From Database #断开数据库连接 #断开数据库连接