Skip to content

Commit

Permalink
[新增]loadfile dumpfile log
Browse files Browse the repository at this point in the history
  • Loading branch information
longfengpili committed Mar 10, 2021
1 parent c9577be commit f8d92b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pydbapi/api/mysql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @Author: chunyang.xu
# @Email: [email protected]
# @Date: 2020-06-10 14:40:50
# @Last Modified time: 2021-03-08 15:10:02
# @Last Modified time: 2021-03-10 17:37:02
# @github: https://github.com/longfengpili

# !/usr/bin/env python3
Expand Down Expand Up @@ -96,10 +96,12 @@ def dumpdata(self, tablename, columns, dumpfile, condition=None, verbose=0):
sqlcompile = SqlMysqlCompile(tablename)
sql_for_dump = sqlcompile.dumpsql(columns, dumpfile, condition=condition)
rows, action, result = self.execute(sql_for_dump, verbose=verbose)
mysqllogger.info("【{action}】{tablename} dumpdata {rows} rows succeed, outfile: {dumpfile} !")
return rows, action, result

def loaddata(self, tablename, columns, loadfile, verbose=0):
sqlcompile = SqlMysqlCompile(tablename)
sql_for_load = sqlcompile.loadsql(columns, loadfile)
rows, action, result = self.execute(sql_for_load, verbose=verbose)
mysqllogger.info("【{action}】{tablename} loaddata {rows} rows succeed, loadfile: {loadfile} !")
return rows, action, result
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @Author: chunyang.xu
# @Email: [email protected]
# @Date: 2020-06-09 16:46:54
# @Last Modified time: 2021-03-10 17:13:31
# @Last Modified time: 2021-03-10 17:37:18
# @github: https://github.com/longfengpili

# !/usr/bin/env python3
Expand All @@ -12,7 +12,7 @@
import shutil
import setuptools

VERSION = '0.0.48'
VERSION = '0.0.49'
PROJECT_NAME = 'pydbapi'

with open('README.md', 'r', encoding='utf-8') as f:
Expand Down

0 comments on commit f8d92b5

Please sign in to comment.