dirigent-block-sql 0.17.3__tar.gz → 0.18.1__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.
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dirigent-block-sql
3
- Version: 0.17.3
3
+ Version: 0.18.1
4
4
  Summary: The SQL block family for dirigent: sql.query, sql.execute, and the sql connection kind.
5
5
  License-Expression: LicenseRef-Proprietary
6
6
  License-File: LICENSE
7
7
  Classifier: Programming Language :: Python :: 3
8
8
  Classifier: Programming Language :: Python :: 3.13
9
- Requires-Dist: dirigent-common==0.17.3
10
- Requires-Dist: dirigent-plugin==0.17.3
9
+ Requires-Dist: dirigent-common==0.18.1
10
+ Requires-Dist: dirigent-plugin==0.18.1
11
11
  Requires-Dist: sqlalchemy[asyncio]>=2.0.52
12
12
  Requires-Python: >=3.13
13
13
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dirigent-block-sql"
3
- version = "0.17.3"
3
+ version = "0.18.1"
4
4
  description = "The SQL block family for dirigent: sql.query, sql.execute, and the sql connection kind."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -11,8 +11,8 @@ classifiers = [
11
11
  "Programming Language :: Python :: 3.13",
12
12
  ]
13
13
  dependencies = [
14
- "dirigent-common==0.17.3",
15
- "dirigent-plugin==0.17.3",
14
+ "dirigent-common==0.18.1",
15
+ "dirigent-plugin==0.18.1",
16
16
  "sqlalchemy[asyncio]>=2.0.52",
17
17
  ]
18
18
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dirigent-block-sql"
3
- version = "0.17.3"
3
+ version = "0.18.1"
4
4
  description = "The SQL block family for dirigent: sql.query, sql.execute, and the sql connection kind."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -11,8 +11,8 @@ classifiers = [
11
11
  "Programming Language :: Python :: 3.13",
12
12
  ]
13
13
  dependencies = [
14
- "dirigent-common==0.17.3",
15
- "dirigent-plugin==0.17.3",
14
+ "dirigent-common==0.18.1",
15
+ "dirigent-plugin==0.18.1",
16
16
  "sqlalchemy[asyncio]>=2.0.52",
17
17
  ]
18
18
 
@@ -301,7 +301,7 @@ class _Session:
301
301
  """Open the connection and put it in the mode the connection kind asked for."""
302
302
  try:
303
303
  async with asyncio.timeout(self.settings.connect_timeout.total_seconds()):
304
- self.connection = await self.engine.connect()
304
+ opened = await self.engine.connect()
305
305
  except TimeoutError as error:
306
306
  await self.engine.dispose()
307
307
  raise BlockFailure(
@@ -310,8 +310,14 @@ class _Session:
310
310
  except BaseException:
311
311
  await self.engine.dispose()
312
312
  raise
313
- if self.settings.read_only:
314
- await self.connection.execute(sqlalchemy.text(READ_ONLY[self.url.get_backend_name()]))
313
+ try:
314
+ if self.settings.read_only:
315
+ await opened.execute(sqlalchemy.text(READ_ONLY[self.url.get_backend_name()]))
316
+ except BaseException:
317
+ await opened.close()
318
+ await self.engine.dispose()
319
+ raise
320
+ self.connection = opened
315
321
  return self.connection
316
322
 
317
323
  async def __aexit__(self, *_error: object) -> None:
@@ -188,6 +188,7 @@ class SqlQueryOutput(BlockModel):
188
188
  """The column names, in the order the query selected them."""
189
189
 
190
190
  duration_ms: int
191
+ """How long the query took."""
191
192
 
192
193
 
193
194
  class SqlQueryOperator(Operator[SqlQueryConfig, SqlQueryOutput]):
@@ -275,6 +276,7 @@ class SqlExecuteOutput(BlockModel):
275
276
  """Rows affected by each statement, in order; ``-1`` where the driver does not say."""
276
277
 
277
278
  duration_ms: int
279
+ """How long the transaction took."""
278
280
 
279
281
 
280
282
  class SqlExecuteOperator(Operator[SqlExecuteConfig, SqlExecuteOutput]):