database-wrapper-pgsql 0.2.17__tar.gz → 0.2.23__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 (17) hide show
  1. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/PKG-INFO +2 -2
  2. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/__init__.py +25 -21
  3. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/connector.py +17 -17
  4. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/db_wrapper_pgsql.py +3 -5
  5. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/db_wrapper_pgsql_async.py +2 -2
  6. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/db_wrapper_pgsql_mixin.py +2 -2
  7. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql.egg-info/PKG-INFO +2 -2
  8. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql.egg-info/requires.txt +1 -1
  9. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/pyproject.toml +5 -7
  10. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/README.md +0 -0
  11. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/pg_introspector.py +0 -0
  12. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/py.typed +0 -0
  13. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql/type_mapping.py +0 -0
  14. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql.egg-info/SOURCES.txt +0 -0
  15. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql.egg-info/dependency_links.txt +0 -0
  16. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/database_wrapper_pgsql.egg-info/top_level.txt +0 -0
  17. {database_wrapper_pgsql-0.2.17 → database_wrapper_pgsql-0.2.23}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper_pgsql
3
- Version: 0.2.17
3
+ Version: 0.2.23
4
4
  Summary: database_wrapper for PostgreSQL database
5
5
  Author-email: Gints Murans <gm@gm.lv>
6
6
  License: GNU General Public License v3.0 (GPL-3.0)
@@ -32,7 +32,7 @@ Classifier: Topic :: Software Development
32
32
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
33
  Requires-Python: >=3.8
34
34
  Description-Content-Type: text/markdown
35
- Requires-Dist: database_wrapper==0.2.17
35
+ Requires-Dist: database_wrapper==0.2.23
36
36
  Requires-Dist: psycopg[binary]>=3.2.0
37
37
  Requires-Dist: psycopg[pool]>=3.2.0
38
38
 
@@ -10,20 +10,21 @@ import logging
10
10
 
11
11
  from .connector import (
12
12
  # Basics
13
- PgConfig,
14
- # Connection and Cursor types
13
+ PgConnection,
15
14
  PgConnectionType,
16
15
  PgConnectionTypeAsync,
16
+ PgCursor,
17
17
  PgCursorType,
18
18
  PgCursorTypeAsync,
19
- # Connectors
20
- PgSQL,
21
- PgSQLAsync,
22
- PgSQLWithPooling,
23
- PgSQLWithPoolingAsync,
19
+ PgDictRow,
20
+ Pgsql,
21
+ PgsqlAsync,
22
+ PgsqlConfig,
23
+ PgsqlWithPooling,
24
+ PgsqlWithPoolingAsync,
24
25
  )
25
- from .db_wrapper_pgsql import DBWrapperPgSQL
26
- from .db_wrapper_pgsql_async import DBWrapperPgSQLAsync
26
+ from .db_wrapper_pgsql import DBWrapperPgsql
27
+ from .db_wrapper_pgsql_async import DBWrapperPgsqlAsync
27
28
  from .pg_introspector import PostgresIntrospector
28
29
 
29
30
  # Set the logger to a quiet default, can be enabled if needed
@@ -34,19 +35,22 @@ if logger.level == logging.NOTSET:
34
35
 
35
36
  __all__ = [
36
37
  # Wrappers
37
- "DBWrapperPgSQL",
38
- "DBWrapperPgSQLAsync",
38
+ DBWrapperPgsql,
39
+ DBWrapperPgsqlAsync,
39
40
  # Connectors
40
- "PgSQL",
41
- "PgSQLAsync",
42
- "PgSQLWithPooling",
43
- "PgSQLWithPoolingAsync",
41
+ Pgsql,
42
+ PgsqlAsync,
43
+ PgsqlWithPooling,
44
+ PgsqlWithPoolingAsync,
44
45
  # Connection and Cursor types
45
- "PgConnectionType",
46
- "PgCursorType",
47
- "PgConnectionTypeAsync",
48
- "PgCursorTypeAsync",
46
+ PgConnection,
47
+ PgConnectionType,
48
+ PgConnectionTypeAsync,
49
+ PgCursor,
50
+ PgCursorType,
51
+ PgCursorTypeAsync,
52
+ PgDictRow,
49
53
  # Helpers
50
- "PgConfig",
51
- "PostgresIntrospector",
54
+ PgsqlConfig,
55
+ PostgresIntrospector,
52
56
  ]
@@ -21,7 +21,7 @@ PgConnectionTypeAsync = PgConnectionAsync[PgDictRow]
21
21
  PgCursorTypeAsync = PgCursorAsync[PgDictRow]
22
22
 
23
23
 
24
- class PgConfig(TypedDict):
24
+ class PgsqlConfig(TypedDict):
25
25
  hostname: str
26
26
  port: NotRequired[int]
27
27
  username: str
@@ -35,7 +35,7 @@ class PgConfig(TypedDict):
35
35
  pool_kwargs: NotRequired[dict[str, Any]]
36
36
 
37
37
 
38
- class PgSQL(DatabaseBackend):
38
+ class Pgsql(DatabaseBackend):
39
39
  """
40
40
  PostgreSQL database implementation.
41
41
 
@@ -45,7 +45,7 @@ class PgSQL(DatabaseBackend):
45
45
  Close is called automatically when class is destroyed.
46
46
 
47
47
  :param config: Configuration for PostgreSQL
48
- :type config: PgConfig
48
+ :type config: PgsqlConfig
49
49
 
50
50
  Defaults:
51
51
  port = 5432
@@ -53,7 +53,7 @@ class PgSQL(DatabaseBackend):
53
53
 
54
54
  """
55
55
 
56
- config: PgConfig
56
+ config: PgsqlConfig
57
57
 
58
58
  connection: PgConnectionType
59
59
  cursor: PgCursorType
@@ -152,7 +152,7 @@ class PgSQL(DatabaseBackend):
152
152
  self.connection.rollback()
153
153
 
154
154
 
155
- class PgSQLAsync(DatabaseBackend):
155
+ class PgsqlAsync(DatabaseBackend):
156
156
  """
157
157
  PostgreSQL database async implementation.
158
158
 
@@ -163,7 +163,7 @@ class PgSQLAsync(DatabaseBackend):
163
163
  ! You need to call it manually in async environment.
164
164
 
165
165
  :param config: Configuration for PostgreSQL
166
- :type config: PgConfig
166
+ :type config: PgsqlConfig
167
167
 
168
168
  Defaults:
169
169
  port = 5432
@@ -171,7 +171,7 @@ class PgSQLAsync(DatabaseBackend):
171
171
 
172
172
  """
173
173
 
174
- config: PgConfig
174
+ config: PgsqlConfig
175
175
 
176
176
  connection: PgConnectionTypeAsync
177
177
  cursor: PgCursorTypeAsync
@@ -280,7 +280,7 @@ class PgSQLAsync(DatabaseBackend):
280
280
  await self.connection.rollback()
281
281
 
282
282
 
283
- class PgSQLWithPooling(DatabaseBackend):
283
+ class PgsqlWithPooling(DatabaseBackend):
284
284
  """
285
285
  PostgreSQL database implementation with connection pooling.
286
286
 
@@ -292,13 +292,13 @@ class PgSQLWithPooling(DatabaseBackend):
292
292
  Or use context manager to get connection and return it back automatically,
293
293
  for example:
294
294
 
295
- pool = PgSQLWithPooling(config)
295
+ pool = PgsqlWithPooling(config)
296
296
  pool.open_pool()
297
297
  with pool as (connection, cursor):
298
298
  cursor.execute("SELECT 1")
299
299
 
300
300
  :param config: Configuration for PostgreSQL
301
- :type config: PgConfig
301
+ :type config: PgsqlConfig
302
302
  :param connection_timeout: Connection timeout
303
303
  :type connection_timeout: int
304
304
  :param instance_name: Name of the instance
@@ -310,7 +310,7 @@ class PgSQLWithPooling(DatabaseBackend):
310
310
  maxconnections = 5
311
311
  """
312
312
 
313
- config: PgConfig
313
+ config: PgsqlConfig
314
314
  """ Configuration """
315
315
 
316
316
  pool: ConnectionPool[PgConnectionType]
@@ -331,7 +331,7 @@ class PgSQLWithPooling(DatabaseBackend):
331
331
 
332
332
  def __init__(
333
333
  self,
334
- db_config: PgConfig,
334
+ db_config: PgsqlConfig,
335
335
  connection_timeout: int = 5,
336
336
  instance_name: str = "postgresql_pool",
337
337
  ) -> None:
@@ -541,7 +541,7 @@ class PgSQLWithPooling(DatabaseBackend):
541
541
  self.connection.rollback()
542
542
 
543
543
 
544
- class PgSQLWithPoolingAsync(DatabaseBackend):
544
+ class PgsqlWithPoolingAsync(DatabaseBackend):
545
545
  """
546
546
  PostgreSQL database implementation with async connection pooling.
547
547
 
@@ -554,7 +554,7 @@ class PgSQLWithPoolingAsync(DatabaseBackend):
554
554
  Or use context manager to get connection and return it back automatically,
555
555
  for example:
556
556
 
557
- pool = PgSQLWithPoolingAsync(config)
557
+ pool = PgsqlWithPoolingAsync(config)
558
558
  await pool.open_pool()
559
559
  async with pool as (connection, cursor):
560
560
  await cursor.execute("SELECT 1")
@@ -564,7 +564,7 @@ class PgSQLWithPoolingAsync(DatabaseBackend):
564
564
  ! You need to call `await close_pool()` manually in async environment.
565
565
 
566
566
  :param config: Configuration for PostgreSQL
567
- :type config: PgConfig
567
+ :type config: PgsqlConfig
568
568
  :param connection_timeout: Connection timeout
569
569
  :type connection_timeout: int
570
570
  :param instance_name: Name of the instance
@@ -576,7 +576,7 @@ class PgSQLWithPoolingAsync(DatabaseBackend):
576
576
  maxconnections = 5
577
577
  """
578
578
 
579
- config: PgConfig
579
+ config: PgsqlConfig
580
580
  """ Configuration """
581
581
 
582
582
  pool_async: AsyncConnectionPool[PgConnectionTypeAsync]
@@ -597,7 +597,7 @@ class PgSQLWithPoolingAsync(DatabaseBackend):
597
597
 
598
598
  def __init__(
599
599
  self,
600
- db_config: PgConfig,
600
+ db_config: PgsqlConfig,
601
601
  connection_timeout: int = 5,
602
602
  instance_name: str = "async_postgresql",
603
603
  ) -> None:
@@ -6,13 +6,11 @@ from psycopg import Cursor, sql
6
6
  from database_wrapper import DBWrapper
7
7
 
8
8
  from .connector import PgCursorType
9
- from .db_wrapper_pgsql_mixin import DBWrapperPgSQLMixin
9
+ from .db_wrapper_pgsql_mixin import DBWrapperPgsqlMixin
10
10
 
11
11
 
12
- class DBWrapperPgSQL(DBWrapperPgSQLMixin, DBWrapper):
13
- """
14
- Sync database wrapper for postgres
15
- """
12
+ class DBWrapperPgsql(DBWrapperPgsqlMixin, DBWrapper):
13
+ """Wrapper for PostgreSQL database"""
16
14
 
17
15
  db_cursor: PgCursorType | None
18
16
  """ PostgreSQL cursor object """
@@ -6,10 +6,10 @@ from psycopg import sql
6
6
  from database_wrapper import DBWrapperAsync
7
7
 
8
8
  from .connector import PgCursorTypeAsync
9
- from .db_wrapper_pgsql_mixin import DBWrapperPgSQLMixin
9
+ from .db_wrapper_pgsql_mixin import DBWrapperPgsqlMixin
10
10
 
11
11
 
12
- class DBWrapperPgSQLAsync(DBWrapperPgSQLMixin, DBWrapperAsync):
12
+ class DBWrapperPgsqlAsync(DBWrapperPgsqlMixin, DBWrapperAsync):
13
13
  """
14
14
  Async database wrapper for postgres
15
15
 
@@ -5,9 +5,9 @@ from psycopg import sql
5
5
  from database_wrapper import NoParam, OrderByItem
6
6
 
7
7
 
8
- class DBWrapperPgSQLMixin:
8
+ class DBWrapperPgsqlMixin:
9
9
  """
10
- Mixin for providing methods that can be used by both sync and async versions of the DBWrapperPgSQL class.
10
+ Mixin for providing methods that can be used by both sync and async versions of the DBWrapperPgsql class.
11
11
  """
12
12
 
13
13
  ######################
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper_pgsql
3
- Version: 0.2.17
3
+ Version: 0.2.23
4
4
  Summary: database_wrapper for PostgreSQL database
5
5
  Author-email: Gints Murans <gm@gm.lv>
6
6
  License: GNU General Public License v3.0 (GPL-3.0)
@@ -32,7 +32,7 @@ Classifier: Topic :: Software Development
32
32
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
33
  Requires-Python: >=3.8
34
34
  Description-Content-Type: text/markdown
35
- Requires-Dist: database_wrapper==0.2.17
35
+ Requires-Dist: database_wrapper==0.2.23
36
36
  Requires-Dist: psycopg[binary]>=3.2.0
37
37
  Requires-Dist: psycopg[pool]>=3.2.0
38
38
 
@@ -1,3 +1,3 @@
1
- database_wrapper==0.2.17
1
+ database_wrapper==0.2.23
2
2
  psycopg[binary]>=3.2.0
3
3
  psycopg[pool]>=3.2.0
@@ -4,14 +4,12 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "database_wrapper_pgsql"
7
- version = "0.2.17"
7
+ version = "0.2.23"
8
8
  description = "database_wrapper for PostgreSQL database"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
11
- license = {text = "GNU General Public License v3.0 (GPL-3.0)"}
12
- authors = [
13
- {name = "Gints Murans", email = "gm@gm.lv"}
14
- ]
11
+ license = { text = "GNU General Public License v3.0 (GPL-3.0)" }
12
+ authors = [{ name = "Gints Murans", email = "gm@gm.lv" }]
15
13
  classifiers = [
16
14
  "Development Status :: 4 - Beta",
17
15
  "Intended Audience :: Developers",
@@ -31,11 +29,11 @@ classifiers = [
31
29
  "Topic :: Database",
32
30
  "Topic :: Database :: Front-Ends",
33
31
  "Topic :: Software Development",
34
- "Topic :: Software Development :: Libraries :: Python Modules"
32
+ "Topic :: Software Development :: Libraries :: Python Modules",
35
33
  ]
36
34
  keywords = ["database", "wrapper", "python", "postgresql", "pgsql"]
37
35
  dependencies = [
38
- "database_wrapper == 0.2.17",
36
+ "database_wrapper == 0.2.23",
39
37
  "psycopg[binary] >= 3.2.0",
40
38
  "psycopg[pool] >= 3.2.0",
41
39
  ]