Skip to main content

DBHose dumps convertors utility.

Project description

DBHouse Utils

Dump convertor utility

Enums

CompressionMethod

Enum for select current compression method

  • NONE - without compression
  • LZ4 - lz4 compression
  • ZSTD - zstd compression

DumpType

Enum for dump class classification

  • NATIVE - Clickhouse native
  • PGCOPY - Postgres/Greenplum pgcopy
  • PGPACK - Postgres/Greenplum pgpack container with metadata and pgcopy

DumpClass

NamedTuple object for DumpType value

  • name: str
  • reader: object
  • writer: object
  • have_compress: bool

Cython functions

columns_from_metadata

Function for convert pgpack metadata to native column list

metadata_from_columns

Function for convert native column list to pgpack metadata

pgoid_from_metadata

Function for convert pgpack metadata to pgcopy oid list

Python functions

chunk_fileobj

Function for make iterable bytes chunks from file

dump_convertor

Function for convert dump to another dump

A dump in Native format can be converted to PGPack or PGCopy, or you can leave it in Native format but change the compression codec. A dump in PGPack format can be converted to Native or PGCopy, or you can leave it in PGPack format but change the compression codec. A dump in PGCopy format cannot be converted to other formats due to its storage characteristics (no metadata), but you can change the compression codec for compact storage of the dump on disk.

Example

from dbhose_utils import dump_convertor

source = "path_to_source_dump"
destination = "path_to_output_dump"
dump_type = "native"  # Native, PGPack or PGCopy output format
compression_method = "lz4"  # lz4, zstd or none

dump_convertor(
    source=source,
    destination=destination,
    dump_type=dump_type,
    compression_method=compression_method,
)

dump_detective

Function for auto detect dump type and compression method

Make current reader object from dump

from dbhose_utils import dump_detective

file = "path_to_any_dump"

reader = dump_detective(file)

dump_recovery

Added dump_recovery function to recover data from incomplete dumps

How it works

For pgpack and pgcopy, the damaged archive is recovered to the last valid row; for native, the damaged archive is recovered to the last valid block. Why might this be useful? Let's say you were dumping a table and at that moment the server crashed/the connection was lost/some other force majeure occurred. Now you have the opportunity to retrieve at least some data if you need it here and now.

from dbhose_utils import dump_recovery

file_path = "path_to_broken_dump"
recovery_path = "path_to_recovery_dump"

dump_recovery(
    file_path=file_path,
    recovery_path=recovery_path,
)

Installation

From pip

pip install dbhose-utils

From local directory

pip install .

From git

pip install git+https://github.com/0xMihalich/dbhose_utils

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dbhose_utils-0.0.1.3-cp314-cp314-win_amd64.whl (52.8 kB view details)

Uploaded CPython 3.14Windows x86-64

dbhose_utils-0.0.1.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (329.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dbhose_utils-0.0.1.3-cp314-cp314-macosx_11_0_arm64.whl (56.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

dbhose_utils-0.0.1.3-cp314-cp314-macosx_10_15_x86_64.whl (57.5 kB view details)

Uploaded CPython 3.14macOS 10.15+ x86-64

dbhose_utils-0.0.1.3-cp313-cp313-win_amd64.whl (51.7 kB view details)

Uploaded CPython 3.13Windows x86-64

dbhose_utils-0.0.1.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (328.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dbhose_utils-0.0.1.3-cp313-cp313-macosx_11_0_arm64.whl (56.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dbhose_utils-0.0.1.3-cp313-cp313-macosx_10_14_x86_64.whl (57.6 kB view details)

Uploaded CPython 3.13macOS 10.14+ x86-64

dbhose_utils-0.0.1.3-cp312-cp312-win_amd64.whl (51.7 kB view details)

Uploaded CPython 3.12Windows x86-64

dbhose_utils-0.0.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (343.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dbhose_utils-0.0.1.3-cp312-cp312-macosx_11_0_arm64.whl (56.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dbhose_utils-0.0.1.3-cp312-cp312-macosx_10_14_x86_64.whl (57.7 kB view details)

Uploaded CPython 3.12macOS 10.14+ x86-64

dbhose_utils-0.0.1.3-cp311-cp311-win_amd64.whl (56.1 kB view details)

Uploaded CPython 3.11Windows x86-64

dbhose_utils-0.0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (335.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dbhose_utils-0.0.1.3-cp311-cp311-macosx_11_0_arm64.whl (59.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dbhose_utils-0.0.1.3-cp311-cp311-macosx_10_14_x86_64.whl (65.7 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

dbhose_utils-0.0.1.3-cp310-cp310-win_amd64.whl (56.2 kB view details)

Uploaded CPython 3.10Windows x86-64

dbhose_utils-0.0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (317.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dbhose_utils-0.0.1.3-cp310-cp310-macosx_11_0_arm64.whl (59.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.1.3-cp310-cp310-macosx_10_14_x86_64.whl (65.8 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

Details for the file dbhose_utils-0.0.1.3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 07bd7bbbd65dd58f35b6c6e0d2410989935b2c3a8e9a564153fc590b78ef8176
MD5 401efab7c2086ea07c50e201ea13c5cb
BLAKE2b-256 f1b9491dd0ac27f00b0970119268dce811d83c39bf2bdcd1d8ca12e999b0534d

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6c10ac2c699569cccf56b18f0ac8c62ee58401660b1f93be126388167b45d4fb
MD5 72104c07c155370ab951f40e9563e962
BLAKE2b-256 d328f058165e22eeaf7637aec19ac5abdfb0137c7ed692a9943e4b9d4755b45b

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5329bb91ff63f376ea5c19d823e1e0597882ae4fd81e9f5a2c92af94f601805f
MD5 65bc28e2d8d2f63558b025ee374c0724
BLAKE2b-256 d36b46ed36265a1ee6f6f48c9a8ca385cbcb7cac4182a47725eb82f97cf73711

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp314-cp314-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 78d9c0f6b80bea76610443276eba26cf4d7465ef087eb8dc9af9e8a89fdaa461
MD5 9403a4ebec721b31ad1c216bd310ad3d
BLAKE2b-256 51b78df553f97cbb578f997f42cc4b36e8584830b756dd9ba70dc73f7876eaa8

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 751253b45f5c083c5833c67efd2b7bb7f10ff2b1648afe648cba54f0d2345b4f
MD5 843954546833c76613b2c89d0f6de73d
BLAKE2b-256 7126ef1c72f3535cb179975d23c99ab5749378390ebbaa784635b3e145658c93

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1cdfb5f7ea5f6e95401d7a25557b3d1595a2d3172beee5943fa778d8dad16d56
MD5 4c753a050a3aa9263d53d8a13e51dc7d
BLAKE2b-256 15595ec1aac774a2cf0c126d6e47f0f9751a0170e31829f8036b4e160a6a0362

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 663450645dd719c3b758d7419f9d62418f01fd09d67f7ea82010873c60324c65
MD5 b79720881278b21bb4a35c498de2acc6
BLAKE2b-256 b07dcdace334139b67acbeb253948f403efbcd420bbeb28f8c07af9a3302814a

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp313-cp313-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 416b409f8c133c25e8110ad1390b3b6004eee4d3ef34728de2422ec76ec683fe
MD5 9866ba3f8ed8deafdecdd066d34cae9e
BLAKE2b-256 e1add7c3c30d21a3759f14e470b5c82989902761c8e35a70a2b987e02c89a572

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 057dd08c60b1757c5f5f56df679e391e958245e55c8156cb4ef3b0e9e4aa2ed3
MD5 c4382ddb4a7a3c9cc62cfa62bb8bed19
BLAKE2b-256 1fed826a09ae0fbe6103d9a65e6951a9189380557205cf8485fdeb094dd0ce47

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 610bdbfbe72c197e932ad7edc87df458e3d0e8a16ca0d46629c07f8d72fbcebc
MD5 1fd1d470ce23b5d6c04b9218069c5bed
BLAKE2b-256 3735eebfbfdd8d84edf0f493d18c6dcd5ab34ae75bd241e2c79b83b84a850bec

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 903fd8ba94dd7eb228bf48658a81751ffefdf99d814058a118d702a268f27278
MD5 a450433be65d611dd221e8b6b90cff71
BLAKE2b-256 a339ee72621687c9924b70eef4cd7d5c3f38a59176eba1c39d513fba006a18b5

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp312-cp312-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 04fda0192477b3039c8d9bd4b5bfa2bb58b2ecaf2cdf5fe42d7c66848475fb80
MD5 985138443abbb75b0678e9d986ac41f5
BLAKE2b-256 71807c3f7c9132a20c22f6d5585c7865516632b7dd34667ce383912c84bcad98

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d5b04235ec64e29f67046fd5869d914dd08b14ef5f3a44ff2c48c5e77952b4dd
MD5 7d999fc827c355fd76cde8974aba7ffd
BLAKE2b-256 148bc8e0cce3af28e9c459151880df5cc239c01eaa1471a683861a08090ceaa0

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a49c15fff629066262bb08e1cd8a721124e0adab610f734e861379139ece5450
MD5 23af925973e524714e6aa8f54ac593bf
BLAKE2b-256 64fe27cee1ef680b5ba83c41525175dda029f00db1ce8599bb1de4f992247ad4

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87c39497e044da5413418517559d3fe0fa5c32b16f81d4a66fd37b480b5a516b
MD5 c10971f366aea7060f406a86fd6eb2ec
BLAKE2b-256 084633facd9f5a78b6b038d0eb8cf398d291f88438b597eb1152341a96ae8459

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b0fbc9aa32267bcd290987a9bd4465ce8afd468f758ff21228254ceffb9c443e
MD5 914066f8f0911f7714eca21d2b71bb8f
BLAKE2b-256 cc8c04a972cc30d207f86e0b8afc45755a77eb711b0ddee81307b031b668ee63

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6c0205653766fbccee01e64299131c0b2d8059cc68c5ca1572a80a257fb9fa5d
MD5 e44d88b944812772e92279fd7fd7146e
BLAKE2b-256 e5267ef5265ae8e22186ae6038cd0e68bea04012d7508299d533d99269749202

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9187e628ff5922b61bf86c20a0eeb9da36fa695cb561e61c268fc34a47dda395
MD5 c862ce6616264f223eae8af93e688ad7
BLAKE2b-256 58d22e1f618a9c685ea3a0a099dc20db076bde1c5b2f5ccc1f980209a4192d60

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af367511d7f3d3230a4f333ca77f8b4ce931dd46896f688be09c75da2344d06a
MD5 dc0adc8963d0c216216d25f6688f4c4a
BLAKE2b-256 1afd80cdc9a2447e7d9bc2f223caded1e976ba345f7561d837e25ed503a697e9

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.3-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 068f4ece317b4966549017d5395b3ecc7746bdb5764ddf54ffb13ff24d9669a3
MD5 9014640ec0b0f9da64d9b1c3d0eaf2f7
BLAKE2b-256 03d980854915020df0241b23466f60798012507cf96c2d3df4eb42662f13bef8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page