pydpm_xl 0.2.6__py3-none-any.whl → 0.2.7__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.
- py_dpm/__init__.py +1 -1
- py_dpm/api/dpm/data_dictionary.py +11 -2
- py_dpm/api/dpm_xl/ast_generator.py +8 -1
- py_dpm/api/dpm_xl/operation_scopes.py +8 -2
- py_dpm/api/dpm_xl/semantic.py +8 -2
- py_dpm/dpm/utils.py +26 -7
- {pydpm_xl-0.2.6.dist-info → pydpm_xl-0.2.7.dist-info}/METADATA +1 -1
- {pydpm_xl-0.2.6.dist-info → pydpm_xl-0.2.7.dist-info}/RECORD +12 -12
- {pydpm_xl-0.2.6.dist-info → pydpm_xl-0.2.7.dist-info}/WHEEL +0 -0
- {pydpm_xl-0.2.6.dist-info → pydpm_xl-0.2.7.dist-info}/entry_points.txt +0 -0
- {pydpm_xl-0.2.6.dist-info → pydpm_xl-0.2.7.dist-info}/licenses/LICENSE +0 -0
- {pydpm_xl-0.2.6.dist-info → pydpm_xl-0.2.7.dist-info}/top_level.txt +0 -0
py_dpm/__init__.py
CHANGED
|
@@ -41,7 +41,7 @@ Available packages:
|
|
|
41
41
|
- pydpm.api: Main APIs for migration, syntax, and semantic analysis
|
|
42
42
|
"""
|
|
43
43
|
|
|
44
|
-
__version__ = "0.2.
|
|
44
|
+
__version__ = "0.2.7"
|
|
45
45
|
__author__ = "MeaningfulData S.L."
|
|
46
46
|
__email__ = "info@meaningfuldata.eu"
|
|
47
47
|
__license__ = "GPL-3.0-or-later"
|
|
@@ -50,7 +50,10 @@ class DataDictionaryAPI:
|
|
|
50
50
|
"""
|
|
51
51
|
|
|
52
52
|
def __init__(
|
|
53
|
-
self,
|
|
53
|
+
self,
|
|
54
|
+
database_path: Optional[str] = None,
|
|
55
|
+
connection_url: Optional[str] = None,
|
|
56
|
+
pool_config: Optional[Dict[str, Any]] = None,
|
|
54
57
|
):
|
|
55
58
|
"""
|
|
56
59
|
Initialize the Data Dictionary API.
|
|
@@ -58,8 +61,14 @@ class DataDictionaryAPI:
|
|
|
58
61
|
Args:
|
|
59
62
|
database_path: Path to SQLite database (optional)
|
|
60
63
|
connection_url: SQLAlchemy connection URL for PostgreSQL (optional)
|
|
64
|
+
pool_config: Connection pool configuration for PostgreSQL/MySQL (optional)
|
|
65
|
+
Supported keys: pool_size, max_overflow, pool_timeout, pool_recycle, pool_pre_ping.
|
|
61
66
|
"""
|
|
62
|
-
engine = get_engine(
|
|
67
|
+
engine = get_engine(
|
|
68
|
+
database_path=database_path,
|
|
69
|
+
connection_url=connection_url,
|
|
70
|
+
pool_config=pool_config
|
|
71
|
+
)
|
|
63
72
|
self.session = get_session()
|
|
64
73
|
|
|
65
74
|
# ==================== Release Query Methods ====================
|
|
@@ -48,6 +48,7 @@ class ASTGeneratorAPI:
|
|
|
48
48
|
|
|
49
49
|
def __init__(self, database_path: Optional[str] = None,
|
|
50
50
|
connection_url: Optional[str] = None,
|
|
51
|
+
pool_config: Optional[Dict[str, Any]] = None,
|
|
51
52
|
compatibility_mode: str = "auto",
|
|
52
53
|
enable_semantic_validation: bool = False):
|
|
53
54
|
"""
|
|
@@ -56,13 +57,19 @@ class ASTGeneratorAPI:
|
|
|
56
57
|
Args:
|
|
57
58
|
database_path: Optional path to SQLite data dictionary database
|
|
58
59
|
connection_url: Optional SQLAlchemy connection URL for PostgreSQL
|
|
60
|
+
pool_config: Connection pool configuration for PostgreSQL/MySQL
|
|
59
61
|
compatibility_mode: "auto", "3.1.0", "4.0.0", or "current"
|
|
60
62
|
enable_semantic_validation: Enable semantic validation (requires database)
|
|
61
63
|
"""
|
|
62
64
|
self.syntax_api = SyntaxAPI()
|
|
63
|
-
self.semantic_api = SemanticAPI(
|
|
65
|
+
self.semantic_api = SemanticAPI(
|
|
66
|
+
database_path=database_path,
|
|
67
|
+
connection_url=connection_url,
|
|
68
|
+
pool_config=pool_config
|
|
69
|
+
) if enable_semantic_validation else None
|
|
64
70
|
self.database_path = database_path
|
|
65
71
|
self.connection_url = connection_url
|
|
72
|
+
self.pool_config = pool_config
|
|
66
73
|
self.compatibility_mode = compatibility_mode
|
|
67
74
|
self.enable_semantic = enable_semantic_validation
|
|
68
75
|
|
|
@@ -100,7 +100,10 @@ class OperationScopesAPI:
|
|
|
100
100
|
"""
|
|
101
101
|
|
|
102
102
|
def __init__(
|
|
103
|
-
self,
|
|
103
|
+
self,
|
|
104
|
+
database_path: Optional[str] = None,
|
|
105
|
+
connection_url: Optional[str] = None,
|
|
106
|
+
pool_config: Optional[Dict[str, Any]] = None,
|
|
104
107
|
):
|
|
105
108
|
"""
|
|
106
109
|
Initialize the Operation Scopes API.
|
|
@@ -109,9 +112,12 @@ class OperationScopesAPI:
|
|
|
109
112
|
database_path (Optional[str]): Path to SQLite database. If None, uses default from environment.
|
|
110
113
|
connection_url (Optional[str]): Full SQLAlchemy connection URL (e.g., postgresql://user:pass@host:port/db).
|
|
111
114
|
Takes precedence over database_path.
|
|
115
|
+
pool_config (Optional[Dict[str, Any]]): Connection pool configuration for PostgreSQL/MySQL.
|
|
116
|
+
Supported keys: pool_size, max_overflow, pool_timeout, pool_recycle, pool_pre_ping.
|
|
112
117
|
"""
|
|
113
118
|
self.database_path = database_path
|
|
114
119
|
self.connection_url = connection_url
|
|
120
|
+
self.pool_config = pool_config
|
|
115
121
|
|
|
116
122
|
if connection_url:
|
|
117
123
|
# Create isolated engine and session for the provided connection URL
|
|
@@ -119,7 +125,7 @@ class OperationScopesAPI:
|
|
|
119
125
|
from py_dpm.dpm.utils import create_engine_from_url
|
|
120
126
|
|
|
121
127
|
# Create engine for the connection URL (supports SQLite, PostgreSQL, MySQL, etc.)
|
|
122
|
-
self.engine = create_engine_from_url(connection_url)
|
|
128
|
+
self.engine = create_engine_from_url(connection_url, pool_config=pool_config)
|
|
123
129
|
session_maker = sessionmaker(bind=self.engine)
|
|
124
130
|
self.session = session_maker()
|
|
125
131
|
|
py_dpm/api/dpm_xl/semantic.py
CHANGED
|
@@ -44,7 +44,10 @@ class SemanticAPI:
|
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
46
|
def __init__(
|
|
47
|
-
self,
|
|
47
|
+
self,
|
|
48
|
+
database_path: Optional[str] = None,
|
|
49
|
+
connection_url: Optional[str] = None,
|
|
50
|
+
pool_config: Optional[Dict[str, Any]] = None,
|
|
48
51
|
):
|
|
49
52
|
"""
|
|
50
53
|
Initialize the Semantic API.
|
|
@@ -53,9 +56,12 @@ class SemanticAPI:
|
|
|
53
56
|
database_path (Optional[str]): Path to SQLite database. If None, uses default from environment.
|
|
54
57
|
connection_url (Optional[str]): Full SQLAlchemy connection URL (e.g., postgresql://user:pass@host:port/db).
|
|
55
58
|
Takes precedence over database_path.
|
|
59
|
+
pool_config (Optional[Dict[str, Any]]): Connection pool configuration for PostgreSQL/MySQL.
|
|
60
|
+
Supported keys: pool_size, max_overflow, pool_timeout, pool_recycle, pool_pre_ping.
|
|
56
61
|
"""
|
|
57
62
|
self.database_path = database_path
|
|
58
63
|
self.connection_url = connection_url
|
|
64
|
+
self.pool_config = pool_config
|
|
59
65
|
# Store last parsed AST for consumers that need it (e.g. complete AST generation)
|
|
60
66
|
self.ast = None
|
|
61
67
|
|
|
@@ -65,7 +71,7 @@ class SemanticAPI:
|
|
|
65
71
|
from py_dpm.dpm.utils import create_engine_from_url
|
|
66
72
|
|
|
67
73
|
# Create engine for the connection URL (supports SQLite, PostgreSQL, MySQL, etc.)
|
|
68
|
-
self.engine = create_engine_from_url(connection_url)
|
|
74
|
+
self.engine = create_engine_from_url(connection_url, pool_config=pool_config)
|
|
69
75
|
session_maker = sessionmaker(bind=self.engine)
|
|
70
76
|
self.session = session_maker()
|
|
71
77
|
|
py_dpm/dpm/utils.py
CHANGED
|
@@ -84,7 +84,7 @@ sessionMakerObject = None
|
|
|
84
84
|
_current_engine_url = None
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
def create_engine_from_url(connection_url):
|
|
87
|
+
def create_engine_from_url(connection_url, pool_config=None):
|
|
88
88
|
"""
|
|
89
89
|
Create SQLAlchemy engine from a connection URL with appropriate pooling parameters.
|
|
90
90
|
|
|
@@ -96,6 +96,12 @@ def create_engine_from_url(connection_url):
|
|
|
96
96
|
|
|
97
97
|
Args:
|
|
98
98
|
connection_url (str): SQLAlchemy connection URL (e.g., 'sqlite:///path.db', 'postgresql://user:pass@host/db')
|
|
99
|
+
pool_config (dict, optional): Custom pool configuration. Supported keys:
|
|
100
|
+
- pool_size (int): Maximum number of connections to maintain in the pool (default: 20)
|
|
101
|
+
- max_overflow (int): Maximum overflow connections beyond pool_size (default: 10)
|
|
102
|
+
- pool_timeout (int): Seconds to wait before giving up on getting a connection (default: 30)
|
|
103
|
+
- pool_recycle (int): Seconds before recycling connections (default: 180)
|
|
104
|
+
- pool_pre_ping (bool): Health check connections before using from pool (default: True)
|
|
99
105
|
|
|
100
106
|
Returns:
|
|
101
107
|
sqlalchemy.engine.Engine: Configured database engine
|
|
@@ -103,6 +109,8 @@ def create_engine_from_url(connection_url):
|
|
|
103
109
|
Examples:
|
|
104
110
|
>>> engine = create_engine_from_url('sqlite:///database.db')
|
|
105
111
|
>>> engine = create_engine_from_url('postgresql://user:pass@localhost/mydb')
|
|
112
|
+
>>> engine = create_engine_from_url('postgresql://user:pass@localhost/mydb',
|
|
113
|
+
... pool_config={'pool_size': 5, 'max_overflow': 10})
|
|
106
114
|
"""
|
|
107
115
|
global engine, sessionMakerObject, _current_engine_url
|
|
108
116
|
|
|
@@ -123,12 +131,22 @@ def create_engine_from_url(connection_url):
|
|
|
123
131
|
engine = create_engine(connection_url, pool_pre_ping=True)
|
|
124
132
|
else:
|
|
125
133
|
# Server-based databases (PostgreSQL, MySQL, etc.) with connection pooling
|
|
134
|
+
# Default pool configuration
|
|
135
|
+
default_pool_config = {
|
|
136
|
+
'pool_size': 20,
|
|
137
|
+
'max_overflow': 10,
|
|
138
|
+
'pool_timeout': 30,
|
|
139
|
+
'pool_recycle': 180,
|
|
140
|
+
'pool_pre_ping': True,
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
# Merge custom pool_config with defaults
|
|
144
|
+
if pool_config:
|
|
145
|
+
default_pool_config.update(pool_config)
|
|
146
|
+
|
|
126
147
|
engine = create_engine(
|
|
127
148
|
connection_url,
|
|
128
|
-
|
|
129
|
-
max_overflow=10,
|
|
130
|
-
pool_recycle=180,
|
|
131
|
-
pool_pre_ping=True,
|
|
149
|
+
**default_pool_config
|
|
132
150
|
)
|
|
133
151
|
|
|
134
152
|
# Initialize global sessionMakerObject
|
|
@@ -170,7 +188,7 @@ def create_engine_object(url):
|
|
|
170
188
|
return engine
|
|
171
189
|
|
|
172
190
|
|
|
173
|
-
def get_engine(owner=None, database_path=None, connection_url=None):
|
|
191
|
+
def get_engine(owner=None, database_path=None, connection_url=None, pool_config=None):
|
|
174
192
|
"""
|
|
175
193
|
Get database engine based on configuration or explicit parameters.
|
|
176
194
|
|
|
@@ -184,13 +202,14 @@ def get_engine(owner=None, database_path=None, connection_url=None):
|
|
|
184
202
|
owner: Owner for SQL Server databases (EBA/EIOPA) - legacy support
|
|
185
203
|
database_path: Explicit SQLite database path
|
|
186
204
|
connection_url: Explicit SQLAlchemy connection URL (e.g., for PostgreSQL)
|
|
205
|
+
pool_config: Connection pool configuration dict (for PostgreSQL/MySQL)
|
|
187
206
|
|
|
188
207
|
Returns:
|
|
189
208
|
SQLAlchemy Engine
|
|
190
209
|
"""
|
|
191
210
|
# Priority 1: If explicit connection URL is provided, use it directly
|
|
192
211
|
if connection_url:
|
|
193
|
-
return create_engine_from_url(connection_url)
|
|
212
|
+
return create_engine_from_url(connection_url, pool_config=pool_config)
|
|
194
213
|
|
|
195
214
|
# Priority 2: If explicit database_path is provided, use SQLite with that path
|
|
196
215
|
if database_path:
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
py_dpm/__init__.py,sha256=
|
|
1
|
+
py_dpm/__init__.py,sha256=a2pLEJ-WUNGj-wIL9gxgvcBpavgpyCKq-DbzJMC2dbA,1858
|
|
2
2
|
py_dpm/api/__init__.py,sha256=6ElO0NKEjuqiHNxK7pxkzLNlaUOrYKnY3N0fUDDobik,1021
|
|
3
3
|
py_dpm/api/dpm/__init__.py,sha256=HQflgiRbs1eDi3KTadNhxS1NoaG6PGQDVMvFnuIEfXo,506
|
|
4
|
-
py_dpm/api/dpm/data_dictionary.py,sha256=
|
|
4
|
+
py_dpm/api/dpm/data_dictionary.py,sha256=q6w_5bFdc6WPd5Z601PpDaCcnIw39CnI4wdby3GJmFU,29893
|
|
5
5
|
py_dpm/api/dpm/explorer.py,sha256=xgrSdh2D83RivypF26WWo20rbQifYBEH7PXvINoi07Y,10861
|
|
6
6
|
py_dpm/api/dpm/hierarchical_queries.py,sha256=X4AbpsWy3iItOTVIdVbtaTmRgOHPf0Y64Ig-_377uns,4054
|
|
7
7
|
py_dpm/api/dpm/instance.py,sha256=v3DWzdaM5gPCecLjwjZ49FGfqZzUR3dPC0U8zGwdttk,3795
|
|
8
8
|
py_dpm/api/dpm/migration.py,sha256=9FT7zzz4QdUIRR6MD01gMODBtfq9HH_RF4hRgZqMcZc,2404
|
|
9
9
|
py_dpm/api/dpm_xl/__init__.py,sha256=cwqeYgmowGH6MK8kQMQkjQaTL9qKEnC8-M5rueqhrPI,850
|
|
10
|
-
py_dpm/api/dpm_xl/ast_generator.py,sha256=
|
|
10
|
+
py_dpm/api/dpm_xl/ast_generator.py,sha256=7EEUEmXMwck7obL3rnBjHeDnsM0F-LHnpUZNd3rVjHI,94929
|
|
11
11
|
py_dpm/api/dpm_xl/complete_ast.py,sha256=_FSxA0FmNXuW0OLS3c8yzp14yjkmdR0rTebBAs1pg-E,8141
|
|
12
|
-
py_dpm/api/dpm_xl/operation_scopes.py,sha256=
|
|
13
|
-
py_dpm/api/dpm_xl/semantic.py,sha256=
|
|
12
|
+
py_dpm/api/dpm_xl/operation_scopes.py,sha256=v2t3f2-AiF39hspNtpf_PA94T69JqbymFK9a5hpckRs,48831
|
|
13
|
+
py_dpm/api/dpm_xl/semantic.py,sha256=Ddmh2Wj_iXIpQZ4jCjqOI-6ddFCquaO9RTu6W9i1Rts,13968
|
|
14
14
|
py_dpm/api/dpm_xl/syntax.py,sha256=Ke_kKd9ModoJ6siL3GPT9j9QClmopryCRcdDAT3M5-E,5954
|
|
15
15
|
py_dpm/cli/__init__.py,sha256=UrfGHoQ0sZLjWfA0hoOoI4iTrn-bjr2f9Q8wDWd5nMo,133
|
|
16
16
|
py_dpm/cli/main.py,sha256=LJ7JBk7lyWXe7ZYxnbxmohM1Dbha4sIdQzSTYKd9ZNo,22457
|
|
@@ -18,7 +18,7 @@ py_dpm/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
18
18
|
py_dpm/dpm/__init__.py,sha256=moagUo5Gxf24-Tl9FL_3n2wmVoD_oXtpC-YIGktH_rc,212
|
|
19
19
|
py_dpm/dpm/migration.py,sha256=ivO_ObvKzVomTns6qfo-o5FuciWxkXbMd_gJ4_tu7Xc,14110
|
|
20
20
|
py_dpm/dpm/models.py,sha256=Rt1b8zOSayXd9KhwyfkGJVhCai3YxUakmLYgwaiICWA,135660
|
|
21
|
-
py_dpm/dpm/utils.py,sha256=
|
|
21
|
+
py_dpm/dpm/utils.py,sha256=lyAZjMVrvVXXNw4e-3J0W6Q6o4YeZTgBtgn6BkPFTfI,13953
|
|
22
22
|
py_dpm/dpm/queries/base.py,sha256=EddMeJMwtp63DyyIFO7_XxGvdlCtJQWWpeOVImlKp4I,3648
|
|
23
23
|
py_dpm/dpm/queries/basic_objects.py,sha256=JOXC235lMDfVENrFAhZAl7_nqePJ4RrwJhFF0WDyk0M,955
|
|
24
24
|
py_dpm/dpm/queries/explorer_queries.py,sha256=HcLfwpdGWX-q-i1L-7W0nwTxL_0OiDliqPUeoZ9zHZ4,17453
|
|
@@ -76,9 +76,9 @@ py_dpm/exceptions/exceptions.py,sha256=6S3p-_i5O1oStvSMixt_JQG0xwTeSfBcdzrwL8yBy
|
|
|
76
76
|
py_dpm/exceptions/messages.py,sha256=UwY6QIK8c-POcDCc9HYbZFGArCIYAanUGNh2LNKPx3U,7534
|
|
77
77
|
py_dpm/instance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
78
|
py_dpm/instance/instance.py,sha256=gRSg2dh1nEa0Srx9yKcN3bxiYidvZyRU_jsTNaKkP5I,10882
|
|
79
|
-
pydpm_xl-0.2.
|
|
80
|
-
pydpm_xl-0.2.
|
|
81
|
-
pydpm_xl-0.2.
|
|
82
|
-
pydpm_xl-0.2.
|
|
83
|
-
pydpm_xl-0.2.
|
|
84
|
-
pydpm_xl-0.2.
|
|
79
|
+
pydpm_xl-0.2.7.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
80
|
+
pydpm_xl-0.2.7.dist-info/METADATA,sha256=Tg3xyWRxhUd3w1pKuv5iNBYTRq_VkZzIH533JzyaBYQ,9302
|
|
81
|
+
pydpm_xl-0.2.7.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
82
|
+
pydpm_xl-0.2.7.dist-info/entry_points.txt,sha256=6DDmBfw-AjtgvMHgq_I730i_LAAs_7-N3C95HD_bRr4,47
|
|
83
|
+
pydpm_xl-0.2.7.dist-info/top_level.txt,sha256=495PvWZRoKl2NvbQU25W7dqWIBHqY-mFMPt83uxPpcM,7
|
|
84
|
+
pydpm_xl-0.2.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|