xml2db 0.9.0__py3-none-any.whl
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.
- debug.py +34 -0
- xml2db/__init__.py +21 -0
- xml2db/document.py +650 -0
- xml2db/exceptions.py +4 -0
- xml2db/model.py +619 -0
- xml2db/table/__init__.py +5 -0
- xml2db/table/column.py +190 -0
- xml2db/table/duplicated_table.py +180 -0
- xml2db/table/relations.py +243 -0
- xml2db/table/reused_table.py +152 -0
- xml2db/table/table.py +356 -0
- xml2db/table/transformed_table.py +314 -0
- xml2db/xml_converter.py +258 -0
- xml2db-0.9.0.dist-info/LICENSE +19 -0
- xml2db-0.9.0.dist-info/METADATA +100 -0
- xml2db-0.9.0.dist-info/RECORD +18 -0
- xml2db-0.9.0.dist-info/WHEEL +5 -0
- xml2db-0.9.0.dist-info/top_level.txt +2 -0
debug.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from xml2db import DataModel
|
|
3
|
+
from sqlalchemy import inspect
|
|
4
|
+
|
|
5
|
+
from tests.sample_models.models import models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def setup():
|
|
9
|
+
model_config = models[2]
|
|
10
|
+
|
|
11
|
+
model = DataModel(
|
|
12
|
+
os.path.join("../", model_config["xsd_path"]),
|
|
13
|
+
short_name="junit",
|
|
14
|
+
model_config=model_config["versions"][0]["config"],
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
return model
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main():
|
|
21
|
+
from sqlalchemy import create_engine
|
|
22
|
+
|
|
23
|
+
connection_string = "mssql+pyodbc://DATACRE\DEV_BASECRE/BaseCRE?driver=ODBC+Driver+17+for+SQL+Server&trusted_connection=yes"
|
|
24
|
+
|
|
25
|
+
engine = create_engine(
|
|
26
|
+
"postgresql+psycopg2://testuser:testuser@localhost:5432/testdb"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
inspector = inspect(engine)
|
|
30
|
+
print("ok")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
main()
|
xml2db/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from xml2db.model import DataModel
|
|
2
|
+
from xml2db.document import Document
|
|
3
|
+
from xml2db.table import (
|
|
4
|
+
DataModelTable,
|
|
5
|
+
DataModelTableReused,
|
|
6
|
+
DataModelTableDuplicated,
|
|
7
|
+
DataModelColumn,
|
|
8
|
+
DataModelRelationN,
|
|
9
|
+
DataModelRelation1,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"DataModel",
|
|
14
|
+
"Document",
|
|
15
|
+
"DataModelTable",
|
|
16
|
+
"DataModelTableReused",
|
|
17
|
+
"DataModelTableDuplicated",
|
|
18
|
+
"DataModelColumn",
|
|
19
|
+
"DataModelRelation1",
|
|
20
|
+
"DataModelRelationN",
|
|
21
|
+
]
|