pgpack-dumper 0.3.2.2__cp310-cp310-macosx_10_14_x86_64.whl → 0.3.3.0__cp310-cp310-macosx_10_14_x86_64.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.

Potentially problematic release.


This version of pgpack-dumper might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
- select json_agg(json_build_array(attnum, json_build_array(attname, atttypid::int4,
2
- case when atttypid = 1042 then atttypmod - 4 when atttypid = 1700 then
3
- case when (atttypmod - 4) >> 16 = -1 then 10 else (atttypmod - 4) >> 16 end else attlen end,
4
- case when atttypid = 1700 then case when (atttypmod - 4) >> 16 = -1 then 0 else
5
- (atttypmod - 4) & 65535 end else 0 end, attndims)))::text::bytea as metadata
6
- from pg_attribute where attrelid = '{table_name}'::regclass and attnum > 0 and not attisdropped;
1
+ select json_agg(json_build_array(num, json_string))::text::bytea as metadata from (
2
+ select row_number() over(order by attnum) as num, json_build_array(attname, atttypid::int4,
3
+ case when atttypid = 1042 then atttypmod - 4 when atttypid = 1700 then case when (atttypmod - 4) >> 16 = -1
4
+ then 10 else (atttypmod - 4) >> 16 end else attlen end, case when atttypid = 1700 then case when
5
+ (atttypmod - 4) >> 16 = -1 then 0 else (atttypmod - 4) & 65535 end else 0 end, attndims ) as json_string
6
+ from pg_attribute where attrelid = '{table_name}'::regclass and attnum > 0 and not attisdropped) as num_json;
pgpack_dumper/dumper.py CHANGED
@@ -106,11 +106,11 @@ class PGPackDumper:
106
106
  query: str = kwargs.get("query_src") or kwargs.get("query")
107
107
  part: int = 1
108
108
  first_part, second_part = chunk_query(self.query_formatter(query))
109
- total_prts = len(sum((first_part, second_part), [])) or 1
110
-
111
- if first_part:
112
- self.logger.info("Multiquery detected.")
109
+ total_prts = len(sum((first_part, second_part), [])) + int(
110
+ bool(kwargs.get("table_name") or kwargs.get("table_src"))
111
+ )
113
112
 
113
+ if len(first_part) > 1:
114
114
  for query in first_part:
115
115
  self.logger.info(f"Execute query {part}/{total_prts}")
116
116
  cursor.execute(query)
pgpack_dumper/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.3.2.2"
1
+ __version__ = "0.3.3.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pgpack_dumper
3
- Version: 0.3.2.2
3
+ Version: 0.3.3.0
4
4
  Summary: Library for read and write PGPack format between PostgreSQL and file.
5
5
  Author-email: 0xMihalich <bayanmobile87@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/0xMihalich/pgpack_dumper
@@ -1,16 +1,16 @@
1
- pgpack_dumper-0.3.2.2.dist-info/RECORD,,
2
- pgpack_dumper-0.3.2.2.dist-info/WHEEL,sha256=GmNlKk4d1gPsua-iPffT7bORBzsJEd1t8OUYE14nKxc,138
3
- pgpack_dumper-0.3.2.2.dist-info/top_level.txt,sha256=AhxLKWTyGtJWNLWUSyBu54xY4wjVS8vSXgW4wwq4bYk,14
4
- pgpack_dumper-0.3.2.2.dist-info/METADATA,sha256=luJBfdwbAZewBT_fp8HAgRDYfrltSHHX4bYLXcvHkr8,5069
5
- pgpack_dumper-0.3.2.2.dist-info/licenses/LICENSE,sha256=9IYMxtPlcVkrfjeRPA9GRUmaQkLG_FL-Gx7HxLvcLDQ,1067
6
- pgpack_dumper/version.py,sha256=uVFvcAMfUr4ym7apbXcab1bSyJcP0rFeLgleor9GOEc,24
1
+ pgpack_dumper-0.3.3.0.dist-info/RECORD,,
2
+ pgpack_dumper-0.3.3.0.dist-info/WHEEL,sha256=GmNlKk4d1gPsua-iPffT7bORBzsJEd1t8OUYE14nKxc,138
3
+ pgpack_dumper-0.3.3.0.dist-info/top_level.txt,sha256=AhxLKWTyGtJWNLWUSyBu54xY4wjVS8vSXgW4wwq4bYk,14
4
+ pgpack_dumper-0.3.3.0.dist-info/METADATA,sha256=VusqKoKehKE8OvYOg6F0Xn_qzc5ObGJPcbpEh6NHYu8,5069
5
+ pgpack_dumper-0.3.3.0.dist-info/licenses/LICENSE,sha256=9IYMxtPlcVkrfjeRPA9GRUmaQkLG_FL-Gx7HxLvcLDQ,1067
6
+ pgpack_dumper/version.py,sha256=aNXeiNHEfnCcinecueAUs7woEEyAwS-vF1YS8ONPQEo,24
7
7
  pgpack_dumper/__init__.py,sha256=2x9LRaKPMjMuOoP9pBAeSRZoAeCo9B8fxFbnW_N7kh8,966
8
- pgpack_dumper/dumper.py,sha256=5WnXg69hszHjzPXRoAMAvFY5ZrVsKVtx48XMsLDG0og,14261
8
+ pgpack_dumper/dumper.py,sha256=y9ed80MAX2-C9q08kqPWTjCQVRR6o_ahSgr7-Icet9A,14302
9
9
  pgpack_dumper/common/metadata.py,sha256=Z_vbgi1V85jgPR0h1xbUtt3Ru7vMcmG06bd13Gn_ocY,864
10
10
  pgpack_dumper/common/diagram.py,sha256=2w5-s5qwYjCd0cqqlBRbHQ8E90jU7Ay7TNLeROHjCa0,2505
11
11
  pgpack_dumper/common/query.py,sha256=NHLtv_JmaSKq9jugef808vLqn2OoIThCzzPNdSJoQHE,1511
12
12
  pgpack_dumper/common/reader.pyx,sha256=vRIR558enMtx4gueWtoujJbpRoWbKnLWx_foVR-rxIw,1821
13
- pgpack_dumper/common/reader.cpython-310-darwin.so,sha256=rDA8BD15SAEK7zYqtEH1-Sgw0QX3G3JonOFtCtI2gO4,85992
13
+ pgpack_dumper/common/reader.cpython-310-darwin.so,sha256=2ZGnHEOsl25yWW5zGz7OadL96Ud1045fo_VlOxySZkQ,85992
14
14
  pgpack_dumper/common/__init__.py,sha256=gz-xk9TgMHVx5hlFnipO3kuLp7k3grb-OhoSP5Y7LvU,1242
15
15
  pgpack_dumper/common/copy.py,sha256=3mzGGVOVMdnUXqmpdXu3THQJpJB85D9LQN-MC-LX-fg,4941
16
16
  pgpack_dumper/common/logger.py,sha256=gsFCOjnCU3Hvg5UGYMVrPjKRCZKRFtBFBX-7QLZshFo,1675
@@ -25,6 +25,6 @@ pgpack_dumper/common/queryes/copy_from.sql,sha256=hEHfzW7P9-q74jtgMMA94kGpiMeyUR
25
25
  pgpack_dumper/common/queryes/gpversion.sql,sha256=iUwW40pFCVAZhDZ6ah8CIW75_KMBLyvUxMyqOI7vxtA,80
26
26
  pgpack_dumper/common/queryes/relkind.sql,sha256=wpyWaIiuCqQ0YaFPsNAEwwxSxuErNnRmP__-bfZ1vho,66
27
27
  pgpack_dumper/common/queryes/copy_to.sql,sha256=AUSsFl_WFB88UcC45SLd8lD_1La1MIkV2CKX-gCOxEE,49
28
- pgpack_dumper/common/queryes/attributes.sql,sha256=p-rGZxyQhKpdDhqEe7Ch1LrzcHYxUkX9n1PTQLHALSg,501
28
+ pgpack_dumper/common/queryes/attributes.sql,sha256=4hGJ6UYhbsqj-pspUk9uJ72h4a2YDpI0QpSjrCcqtt0,595
29
29
  pgpack_dumper/common/queryes/dbname.sql,sha256=Z3b6a_566PxA52ywRJw1JDSCUMC_c-FyulvW8mC1C7c,141
30
30
  pgpack_dumper/common/queryes/prepare.sql,sha256=oqRk3GU0gjFzM0nLNsKWeD8GfeThZVKsFiMY1-tdb8g,182