# -*- encoding: UTF-8 -*- #!/usr/bin/env python3 # filename crawl.py import rocdb # rocdb.RocDb(host,user,password,database) dbo = rocdb.RocDb('localhost','root','root','test') # insert(table_name,data) 新增数据 dbo.insert('employee',('Macsa3465', 'Mohan', 40, 'M', 2000)) # batch insert 批量新增 dbo.insert('employee',[ ('Macsa3465', 'Mohan', 40, 'M', 2000), ('Macsa3465', 'Mohan', 40, 'M', 2000) ]) # update(table_name,data,where) 更新数据 dbo.update('employee',{'AGE':40,'SEX':"F"},{'LAST_NAME':'Wong','FIRST_NAME':'Macsa3468'}) # find(table_name,where) 单条查询 dbo.find('employee',{'LAST_NAME':'Wong','FIRST_NAME':'Macsa3468'}) # select(table_name,where) 多条查询 dbo.select('employee',{'LAST_NAME':'Wong','FIRST_NAME':'Macsa3468'}) # delete(table_name,where) dbo.delete('employee',{'LAST_NAME':'Wong','FIRST_NAME':'Macsa3468'})
操作类下载地址:RocDb下载
热门文章