db2text 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {db2text-0.2.1/db2text.egg-info → db2text-0.2.2}/PKG-INFO +1 -1
  2. {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/dbtmanual.md +1 -1
  3. {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/dot.mb +6 -4
  4. {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/oracle/all.txt +1 -1
  5. {db2text-0.2.1 → db2text-0.2.2}/database2text/mssql.py +1 -1
  6. {db2text-0.2.1 → db2text-0.2.2}/database2text/mysql.py +1 -1
  7. {db2text-0.2.1 → db2text-0.2.2}/database2text/opengauss.py +1 -1
  8. {db2text-0.2.1 → db2text-0.2.2}/database2text/oracle11.py +1 -1
  9. {db2text-0.2.1 → db2text-0.2.2}/database2text/tool.py +12 -8
  10. {db2text-0.2.1 → db2text-0.2.2/db2text.egg-info}/PKG-INFO +1 -1
  11. {db2text-0.2.1 → db2text-0.2.2}/setup.py +1 -1
  12. {db2text-0.2.1 → db2text-0.2.2}/LICENSE +0 -0
  13. {db2text-0.2.1 → db2text-0.2.2}/MANIFEST.in +0 -0
  14. {db2text-0.2.1 → db2text-0.2.2}/README.md +0 -0
  15. {db2text-0.2.1 → db2text-0.2.2}/database2text/__init__.py +0 -0
  16. {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/dbt_dot_mssql.txt +0 -0
  17. {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/mysql/all.txt +0 -0
  18. {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/opengauss/all.txt +0 -0
  19. {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/sqlserver/all.txt +0 -0
  20. {db2text-0.2.1 → db2text-0.2.2}/database2text/dbt.py +0 -0
  21. {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/SOURCES.txt +0 -0
  22. {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/dependency_links.txt +0 -0
  23. {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/entry_points.txt +0 -0
  24. {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/not-zip-safe +0 -0
  25. {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/requires.txt +0 -0
  26. {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/top_level.txt +0 -0
  27. {db2text-0.2.1 → db2text-0.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: db2text
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: database to text
5
5
  Home-page: https://gitee.com/chenc224/dbt
6
6
  Author: Chen chuan
@@ -115,7 +115,7 @@ pdfdir=指定pdf文件放在哪个目录,未指定则放在dotdir目录下
115
115
 
116
116
  filename=dot和pdf文件名,不带扩展名
117
117
 
118
- dotcmd=neato 指定graphviz布局算法,可以选择dot,neato,twopi,circo,fdp,sfdp,patchwork和osage这些,未指定使用neato
118
+ dotcmd=neato 指定graphviz布局算法,可以选择twopi、circo、fdp和osage这些,未指定使用fdp。不建议使用dot,patchwork,布局严重有问题,也不建议使用neato、sfdp,生成的pdf尺寸有点问题。
119
119
 
120
120
  page= 页名称列表,用空格隔开,如 用户类 权限相关 交易 流程控制等 other/其它
121
121
 
@@ -1,9 +1,11 @@
1
1
  graph 表结构 {
2
- size = "8,11"
3
- # page="8.5,11";
2
+ size = "8.5,11";
3
+ margin=0;
4
+ pad=0.1;
5
+ page="8.5,11";
4
6
  # charset=utf8;
5
- # ratio="auto"
6
- dpi = 300
7
+ ratio="fill"
8
+ # dpi = 300
7
9
  # rankdir = "TR"
8
10
  # node[shape=record fontname="wqy-zenhei" size="30,30"]
9
11
  node[shape=plaintext fontname="wqy-zenhei"]
@@ -48,7 +48,7 @@ table=ts.*
48
48
  dotdir=test/oracle
49
49
  pdfdir=local/oracle
50
50
  filename=lofta
51
- dotcmd=osage
51
+ #dotcmd=fdp
52
52
  page=份额类 other
53
53
 
54
54
  份额类=ts[a-f].*
@@ -11,7 +11,7 @@ class mssql(object):
11
11
  def ana_TABLE(otype):
12
12
  dbdata["sql"]["TABLE"]={}
13
13
  dbdata["exp"]["TABLE"]=[]
14
- sql="SELECT table_catalog,table_schema,table_name FROM INFORMATION_SCHEMA.TABLES where table_type='BASE TABLE'"
14
+ sql="SELECT table_catalog,table_schema,table_name FROM INFORMATION_SCHEMA.TABLES where table_type='BASE TABLE' order by 3"
15
15
  if 目录:
16
16
  sql=f"{sql} and table_catalog='{目录}'"
17
17
  if 集合:
@@ -7,7 +7,7 @@ from database2text.tool import *
7
7
 
8
8
  class mysql(object):
9
9
  def ana_TABLE(otype):
10
- for oname, in db.exec(f"select table_name from information_schema.tables where table_schema='{database}' and table_type='BASE TABLE'"):
10
+ for oname, in db.exec(f"select table_name from information_schema.tables where table_schema='{database}' and table_type='BASE TABLE' order by 1"):
11
11
  if 检查匹配(otype,oname):
12
12
  continue
13
13
  res=db.res1("show create table %s" %(oname))
@@ -9,7 +9,7 @@ from database2text.tool import *
9
9
 
10
10
  class opengauss(object):
11
11
  def ana_TABLE(otype):
12
- for 表id,表名 in db.exec(f"select oid,relname from pg_class where relkind='r' and relnamespace=(select oid from pg_namespace where nspname='{stdata['schema']}')"):
12
+ for 表id,表名 in db.exec(f"select oid,relname from pg_class where relkind='r' and relnamespace=(select oid from pg_namespace where nspname='{stdata['schema']}') order by oid"):
13
13
  odata=db.res1(f"select pg_get_tabledef({表id})")
14
14
  oridata=[]
15
15
  coldata=[]
@@ -7,7 +7,7 @@ from database2text.tool import *
7
7
 
8
8
  class oracle(object):
9
9
  def ana_TABLE(otype):
10
- for oname, in db.exec("select object_name from all_objects where object_type=:ot and owner=:owner",ot=otype,owner=owner):
10
+ for oname, in db.exec("select object_name from all_objects where object_type=:ot and owner=:owner order by 1",ot=otype,owner=owner):
11
11
  if 检查匹配(otype,oname):
12
12
  continue
13
13
  if oname.startswith("SYS_EXPORT_TABLE"):
@@ -118,9 +118,14 @@ class dot(object):
118
118
  def __init__(self,arg):
119
119
  模板文件=pathlib.Path.joinpath(pathlib.Path(__file__).parent,"datafile","dot.mb")
120
120
  模板=open(模板文件,encoding="utf8").read()
121
- 分页数据=set()
121
+ 分页数据=[]
122
122
  for page in arg.get("page","如果没有设置page就搞一个默认的").split():
123
- 分页数据.add(arg.get(page,"输出剩下的所有表"))
123
+ if page in ["other","其它","其他"]:
124
+ if arg.get(page,"输出剩下的所有表") not in 分页数据:
125
+ 分页数据.append(arg.get(page,"输出剩下的所有表"))
126
+ elif page in arg:
127
+ if arg[page] not in 分页数据:
128
+ 分页数据.append(arg[page])
124
129
  文件序号=0
125
130
  已经使用=set()
126
131
  dot列表=[]
@@ -142,12 +147,11 @@ class dot(object):
142
147
  fdot.write(jinja2.Template(模板).render(data))
143
148
  fdot.close()
144
149
  dot列表.append(dotname)
145
- if "dotcmd" in arg:
146
- pdfname=os.path.join(arg.get("pdfdir","."),f"{arg['filename']}_{文件序号}.pdf")
147
- pdf列表.append(pdfname)
148
- cmd="%s -Tpdf %s -o %s" %(arg["dotcmd"],dotname,pdfname)
149
- print(cmd)
150
- os.system(cmd)
150
+ pdfname=os.path.join(arg.get("pdfdir","."),f"{arg['filename']}_{文件序号}.pdf")
151
+ pdf列表.append(pdfname)
152
+ cmd='%s -Tpdf %s -o %s' %(arg.get("dotcmd","fdp"),dotname,pdfname)
153
+ print(cmd)
154
+ os.system(cmd)
151
155
  if len(pdf列表)>0:
152
156
  import PyPDF3
153
157
  pdfout=PyPDF3.PdfFileMerger()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: db2text
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: database to text
5
5
  Home-page: https://gitee.com/chenc224/dbt
6
6
  Author: Chen chuan
@@ -8,7 +8,7 @@ with open("README.md", "r",encoding='utf-8') as fh:
8
8
 
9
9
  setuptools.setup(
10
10
  name="db2text",
11
- version="0.2.1",
11
+ version="0.2.2",
12
12
  author="Chen chuan",
13
13
  author_email="kcchen@139.com",
14
14
  description="database to text",
File without changes
File without changes
File without changes
File without changes
File without changes