pgpack-dumper 0.3.2.2__cp312-cp312-win_amd64.whl → 0.3.3.0__cp312-cp312-win_amd64.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,6 +1,6 @@
1
1
  pgpack_dumper/__init__.py,sha256=wl4I02A6U4A6H3iZC4xNC1N-Y2f9GpgW8lSdbFAR-eA,1012
2
- pgpack_dumper/dumper.py,sha256=d5JgkMGJjoK4hXte7AVpFbg-QSyDLMQy1-6uVpMYOWI,14721
3
- pgpack_dumper/version.py,sha256=WqPSOM1q96nSWWJDyUU8mYexF33Ya3xln9Sy3SqBpYI,25
2
+ pgpack_dumper/dumper.py,sha256=-zHPY1txOtHmu0QEdWSAkCkAHsbZiPrShxK5a8FIGps,14762
3
+ pgpack_dumper/version.py,sha256=2iR8IvYPd9UpeLs-l24xZTv3osRax7ofKozbuYTRXkE,25
4
4
  pgpack_dumper/common/__init__.py,sha256=sWiUnLyvYZZJNIZYWl6MmntIUyDm-naM3DVoV3YcNDA,1300
5
5
  pgpack_dumper/common/columns.py,sha256=sV3e0IErvuBZvIsATSQx_hajBp59VTmni5EmSAdyRBY,723
6
6
  pgpack_dumper/common/connector.py,sha256=3SIGIDTd9OCdr4k5uiPJxzHMGifvsJAEotzzY1GBZgU,187
@@ -10,21 +10,21 @@ pgpack_dumper/common/errors.py,sha256=m0nLUBkpOrodRTesI9WYlpy_MUJ5GPY1e-TaI7RP2L
10
10
  pgpack_dumper/common/logger.py,sha256=PF7L1WYWkj4qU-CDpQTraqSiCPi_AZSmaUt1nscO5gM,1745
11
11
  pgpack_dumper/common/metadata.py,sha256=keknqsofg8nUfu_e38siM5CR-bj8hiiLHSRRXpDs_qU,902
12
12
  pgpack_dumper/common/query.py,sha256=OgPeXgl2-YB-t8alM0PlHEspwsYm3YAW1IAwz0351j8,1579
13
- pgpack_dumper/common/reader.cp312-win_amd64.pyd,sha256=MW9xXsSbkR7g0C7867fb8zT_3LRyS3Wp_5seUtYUn_M,59904
13
+ pgpack_dumper/common/reader.cp312-win_amd64.pyd,sha256=vlnPZRnOW7hC78y8_4SAf6Cr85YiehjSzGqWhmKKwEs,59904
14
14
  pgpack_dumper/common/reader.pxd,sha256=_CVyKYdSScWrDZ7-FeCafFvXSOJDN3KwWIE0dH07Zbo,263
15
15
  pgpack_dumper/common/reader.pyi,sha256=z4ZQMiHLUm1p7lDuWrhnQnv9_sv-GVmBa_5_0Ns1UZc,710
16
16
  pgpack_dumper/common/reader.pyx,sha256=dxu2igQiJvq3EzPRoTpsirxS0ZlQxqTrJrAoz-8Waso,1888
17
17
  pgpack_dumper/common/stream.py,sha256=6yq4flDZYYJ7--1k3Q3g0JflkJIUg-Vo2yHS4MDwu3M,2325
18
18
  pgpack_dumper/common/structs.py,sha256=F2K2D7V6RqSPoZCp00huL6gj0_TSR7czjTvS6fC5Dro,1067
19
- pgpack_dumper/common/queryes/attributes.sql,sha256=DY3Q7MsFb5gpi_0rZXXA4oAWZzNSN1SZ9RTIlkPJU-I,506
19
+ pgpack_dumper/common/queryes/attributes.sql,sha256=Bh1dLxcUMjmA86Bp8gujs7JZahm9Z1V_rzl5RlGd2us,600
20
20
  pgpack_dumper/common/queryes/copy_from.sql,sha256=hEHfzW7P9-q74jtgMMA94kGpiMeyURs0pnFLbmqgdW0,50
21
21
  pgpack_dumper/common/queryes/copy_to.sql,sha256=AUSsFl_WFB88UcC45SLd8lD_1La1MIkV2CKX-gCOxEE,49
22
22
  pgpack_dumper/common/queryes/dbname.sql,sha256=yJN5CJF3KOrbHdOYmoj7DjFveEojjWsmWYuPeL7GyOQ,142
23
23
  pgpack_dumper/common/queryes/gpversion.sql,sha256=iUwW40pFCVAZhDZ6ah8CIW75_KMBLyvUxMyqOI7vxtA,80
24
24
  pgpack_dumper/common/queryes/prepare.sql,sha256=1pACITTlfQo1F_tEtOGigFCkWOkbxD421B4xJjjG70Y,185
25
25
  pgpack_dumper/common/queryes/relkind.sql,sha256=wpyWaIiuCqQ0YaFPsNAEwwxSxuErNnRmP__-bfZ1vho,66
26
- pgpack_dumper-0.3.2.2.dist-info/licenses/LICENSE,sha256=jW7Zeev0dRSYqbEnAk6qGz3e3yok-NhdTxP0ceNPlWM,1088
27
- pgpack_dumper-0.3.2.2.dist-info/METADATA,sha256=QhTlc4Ui8HHuz1pqrG1do_Ht8wu5mf3yT6XYj3RLPOg,5270
28
- pgpack_dumper-0.3.2.2.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
29
- pgpack_dumper-0.3.2.2.dist-info/top_level.txt,sha256=AhxLKWTyGtJWNLWUSyBu54xY4wjVS8vSXgW4wwq4bYk,14
30
- pgpack_dumper-0.3.2.2.dist-info/RECORD,,
26
+ pgpack_dumper-0.3.3.0.dist-info/licenses/LICENSE,sha256=jW7Zeev0dRSYqbEnAk6qGz3e3yok-NhdTxP0ceNPlWM,1088
27
+ pgpack_dumper-0.3.3.0.dist-info/METADATA,sha256=w27dqlgqmJANsZ9yX0eJQCltqYxAvr-P0nIIp0ILYrM,5270
28
+ pgpack_dumper-0.3.3.0.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
29
+ pgpack_dumper-0.3.3.0.dist-info/top_level.txt,sha256=AhxLKWTyGtJWNLWUSyBu54xY4wjVS8vSXgW4wwq4bYk,14
30
+ pgpack_dumper-0.3.3.0.dist-info/RECORD,,