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.2.2-cp314-cp314-win_amd64.whl (53.4 kB view details)

Uploaded CPython 3.14Windows x86-64

dbhose_utils-0.0.2.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (329.9 kB view details)

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

dbhose_utils-0.0.2.2-cp314-cp314-macosx_11_0_arm64.whl (56.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

dbhose_utils-0.0.2.2-cp314-cp314-macosx_10_15_x86_64.whl (58.1 kB view details)

Uploaded CPython 3.14macOS 10.15+ x86-64

dbhose_utils-0.0.2.2-cp313-cp313-win_amd64.whl (52.4 kB view details)

Uploaded CPython 3.13Windows x86-64

dbhose_utils-0.0.2.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (329.0 kB view details)

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

dbhose_utils-0.0.2.2-cp313-cp313-macosx_11_0_arm64.whl (57.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dbhose_utils-0.0.2.2-cp313-cp313-macosx_10_14_x86_64.whl (58.2 kB view details)

Uploaded CPython 3.13macOS 10.14+ x86-64

dbhose_utils-0.0.2.2-cp312-cp312-win_amd64.whl (52.4 kB view details)

Uploaded CPython 3.12Windows x86-64

dbhose_utils-0.0.2.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (344.5 kB view details)

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

dbhose_utils-0.0.2.2-cp312-cp312-macosx_11_0_arm64.whl (57.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dbhose_utils-0.0.2.2-cp312-cp312-macosx_10_14_x86_64.whl (58.3 kB view details)

Uploaded CPython 3.12macOS 10.14+ x86-64

dbhose_utils-0.0.2.2-cp311-cp311-win_amd64.whl (56.7 kB view details)

Uploaded CPython 3.11Windows x86-64

dbhose_utils-0.0.2.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (336.4 kB view details)

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

dbhose_utils-0.0.2.2-cp311-cp311-macosx_11_0_arm64.whl (59.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dbhose_utils-0.0.2.2-cp311-cp311-macosx_10_14_x86_64.whl (66.3 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

dbhose_utils-0.0.2.2-cp310-cp310-win_amd64.whl (56.9 kB view details)

Uploaded CPython 3.10Windows x86-64

dbhose_utils-0.0.2.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (318.2 kB view details)

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

dbhose_utils-0.0.2.2-cp310-cp310-macosx_11_0_arm64.whl (60.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.2.2-cp310-cp310-macosx_10_14_x86_64.whl (66.4 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1611ca084acb56cb1185b8c141b30fce076fcaef0ebde1f07c95851394326a0c
MD5 06aa33a0b14e2e0a4802e95df30828a5
BLAKE2b-256 4aa80582d6323a3eccdb7180780c56511b79b6c2cd536fca144708a7549bcc86

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.2-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.2.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5db66fc2c5ca555249382c46c9946de6e6048d1dab18a0ca356109c436567730
MD5 18ca7315261c6b690138b98bdd71591c
BLAKE2b-256 ee19b78bc188b1d1ccc89e1cf2f2511fa94b78319337af8628232bad5d8ffcde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4cc9b303358d6d2e33ad48c6421b9b4ff62c00b7cdf7ba825ca7fda5f389b2ff
MD5 89d6f74d0fddc5579f9b55d75e054298
BLAKE2b-256 b533b7d509baac747969b0bfd76e0ed53b7f6d859ff5de38999dd850ee8a4108

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1d377d582f3ef94b41c6a17d8b4ce50c832496e03e141f81767ffecd2283d38c
MD5 c1dd7e96a59d6f0263806c8504cd9c79
BLAKE2b-256 40a42aacd8222b02cae83546cd0fd84e5951cc45b6fccf212fc8a7d4d6d4aecb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1fde7c97473a9b91929365e9a5c575779da4eef5f45af7257e3e38d4627133cc
MD5 5065a28528563a35a43c3784f0d343b4
BLAKE2b-256 7117619391e4faac62cb3f980cc95f1b2139fa5edce1caa1f32c1560c42c0d39

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.2-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.2.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1af346ce40cf47f0b37686aa5fff256948342d2a0c9f53141f60cfe8e9b237f2
MD5 be65f506272883d8829836ad8e39e533
BLAKE2b-256 1994d6704d4e0c5c2f7e578664847d96bc7968924896c9f94a36f4786cb83541

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21b482522861f0a2f112b4f79621704bc51393ac1b0b115bfe4f7ae98b745eee
MD5 1f20b29f7ae35fe5abdfefb9ccf8c388
BLAKE2b-256 4d43652a8260c4cffb1372abf2dcb05f1a029d54f4303bd9c2a08045ef4c5c96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0426ed7ff3c53363748b59d65f48a68a41b9101c2affd9ba7939f2303b41e528
MD5 5fadeeb65045caf5b555479fb013ce55
BLAKE2b-256 fa317b3f75e7a62b25d299279ca6d56dbc0d988869439ef0ef2707f248951e4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4607ace86afa702148760bc75b645db1dca00565d937e6f4322fe255e9995fa8
MD5 ce58922c724175fad0787710a01c56ab
BLAKE2b-256 03d9b6e22740140cf96ee9b773b1a912aebe8f508ad782862dc072bde067420c

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.2-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.2.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3a5005e5112a6028976878c34c9693ab8b984c59d42ee94029925f8e2415af36
MD5 9f280bece69d2447eaddb8fc808a357d
BLAKE2b-256 86cc87e3b9acaf0f5a94f94faa264ff4648521dce4b7e47bed330bab54047ba8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d3cb701db16f327e154c669e9a618f526cf64de822de62c13369b2bd528c6f1e
MD5 a960aa5554d4bc66487898f3ba997e3c
BLAKE2b-256 3db8aa0ada82d716d6ae1cea9592aec92ac1df255896ba7a35422817d0818c23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 16d41d3e2b8d446d37443bab4b84338aee25c9d4e38cfd9fa4d8544a82b6798b
MD5 8b08598192f7d52b51d73efb6ec50c9a
BLAKE2b-256 27ad18c7f316404c2036deae38eeee2b036af19bc322b8c03ea17917944700d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9b77c89350ed8f152b01b06977e8d852be99e719bfdb51a83a36b479e81f85f6
MD5 7a81e174315d0aa2d06d616693580126
BLAKE2b-256 00af5fe2c7382934159fe4c43c8cd2506b6b2d17600017fe3d0a717fdb8fad73

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.2-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.2.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0c1355e628793b29be7145e813541c3242b90f608b62f5195579e94a1752455b
MD5 948a110ac52e97144ed33f7d77467077
BLAKE2b-256 d6e833bd0384476b60fa9eea15c751d4408755d5317cf1c10fe65d22a2c5ecc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6569f542532ee8628452e0929c57e3652413b83412bd927b8fe3279627f1a933
MD5 3f2da7592fd29e5bdfaec3b97ecd4c8c
BLAKE2b-256 7d2e77b13db76ca4641f435673e861b19df5d48494b5e602d5aae534bb0a1e31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 44b130f87704414179d033117a0a93debe0e156de955caebec7c68a17d4e7f29
MD5 7b8d70cd79253da7a2a0be0d03dd439a
BLAKE2b-256 d43096c264f2ba1ddd169b156dc252a3765a38862ea71090e466eb0e140e6c15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3d28beb460eb8e0f6cdf2a908c46621aa8c4f87bfb187bff5b38cc258d7df717
MD5 48a27c6ba514082d9160632ad6e7a09c
BLAKE2b-256 d0a88face6e91a78fa3f0b0eb33726a05111969e053ed6f238ee194c199c0f58

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.2-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.2.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9447c41599d180e54e65edcbdf50ca2060edb25a71f0a4a80b2144761602fdd2
MD5 2b99309113ef8d7aa4f2807b2f3175f6
BLAKE2b-256 a427fce38d7a11705955f870e5dbe35d69aa53b9ecfa607e41e5ae5f7a8a3aed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f501330ddd022004975545761afc91e0ddae594a926a9c7ce944976a4558645
MD5 20cd1d9a3b654b485e0b7dda6f4a6c11
BLAKE2b-256 736b31b4933c1ed483a90fe7dd7ba3017a0040f78104c26afea4a0fe189bff83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 749226a8d413153481baee96a36f015af9e3012946571c540b58f0e8e1fe209a
MD5 f100ca1b683aa3ad394a7c667b894d8b
BLAKE2b-256 ecb646d0e6ec2b1755c226511abb67dac9e52c8726c5bee36d5917fb9345fd2f

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