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.
- {db2text-0.2.1/db2text.egg-info → db2text-0.2.2}/PKG-INFO +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/dbtmanual.md +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/dot.mb +6 -4
- {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/oracle/all.txt +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/database2text/mssql.py +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/database2text/mysql.py +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/database2text/opengauss.py +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/database2text/oracle11.py +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/database2text/tool.py +12 -8
- {db2text-0.2.1 → db2text-0.2.2/db2text.egg-info}/PKG-INFO +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/setup.py +1 -1
- {db2text-0.2.1 → db2text-0.2.2}/LICENSE +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/MANIFEST.in +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/README.md +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/database2text/__init__.py +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/dbt_dot_mssql.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/mysql/all.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/opengauss/all.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/database2text/datafile/sample/sqlserver/all.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/database2text/dbt.py +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/SOURCES.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/dependency_links.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/entry_points.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/not-zip-safe +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/requires.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/db2text.egg-info/top_level.txt +0 -0
- {db2text-0.2.1 → db2text-0.2.2}/setup.cfg +0 -0
|
@@ -115,7 +115,7 @@ pdfdir=指定pdf文件放在哪个目录,未指定则放在dotdir目录下
|
|
|
115
115
|
|
|
116
116
|
filename=dot和pdf文件名,不带扩展名
|
|
117
117
|
|
|
118
|
-
dotcmd=neato 指定graphviz布局算法,可以选择
|
|
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
|
-
|
|
2
|
+
size = "8.5,11";
|
|
3
|
+
margin=0;
|
|
4
|
+
pad=0.1;
|
|
5
|
+
page="8.5,11";
|
|
4
6
|
# charset=utf8;
|
|
5
|
-
|
|
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"]
|
|
@@ -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
|
-
分页数据=
|
|
121
|
+
分页数据=[]
|
|
122
122
|
for page in arg.get("page","如果没有设置page就搞一个默认的").split():
|
|
123
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|