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

Uploaded CPython 3.14Windows x86-64

dbhose_utils-0.0.2.4-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.4-cp314-cp314-macosx_11_0_arm64.whl (56.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

dbhose_utils-0.0.2.4-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.4-cp313-cp313-win_amd64.whl (52.4 kB view details)

Uploaded CPython 3.13Windows x86-64

dbhose_utils-0.0.2.4-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.4-cp313-cp313-macosx_11_0_arm64.whl (57.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dbhose_utils-0.0.2.4-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.4-cp312-cp312-win_amd64.whl (52.4 kB view details)

Uploaded CPython 3.12Windows x86-64

dbhose_utils-0.0.2.4-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.4-cp312-cp312-macosx_11_0_arm64.whl (57.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dbhose_utils-0.0.2.4-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.4-cp311-cp311-win_amd64.whl (56.7 kB view details)

Uploaded CPython 3.11Windows x86-64

dbhose_utils-0.0.2.4-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.4-cp311-cp311-macosx_11_0_arm64.whl (59.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dbhose_utils-0.0.2.4-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.4-cp310-cp310-win_amd64.whl (56.9 kB view details)

Uploaded CPython 3.10Windows x86-64

dbhose_utils-0.0.2.4-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.4-cp310-cp310-macosx_11_0_arm64.whl (60.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.2.4-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.4-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 f388d944641e87df19f461aa38f2ac752a50186a1fa8628c4e45b72d2998da79
MD5 25c8859afe3d4f1531028447fe256100
BLAKE2b-256 4917f54426914ef86674ba607217ff8dcff5bebb6d071f4fb9651a0a7ee0488c

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.4-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.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e7288c4719c543e7b0bd1c466ff1f31991b38c103939a85a13321e41e79eed3a
MD5 645f6b5228c89945447c1384e53ec2e4
BLAKE2b-256 25b1ba8899189f0b50eb8efba166ff9b6d9eef0f913168be719d22c61fe82034

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 429086f43a5fe0a2d1cfe29fb414b547ff2330efabfde202d3378e0602ad9887
MD5 c6250f52fea1b94e00faf9b5e2cdd045
BLAKE2b-256 96c886f0fa48ce3cc8cc5327e012b6ef670797195ee21a545bd8f8c55bdac21b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 eb06b0ae683f7ac565344724b0ff5da17d16cd2d3425c720896641597893b370
MD5 f07d284696c872cf49bc9a4603f9ed93
BLAKE2b-256 58159d1b0c18c9dd0e6918a13eb94d4081efa144e968b24728ae46c57e5b3358

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 63d5ff1ce22d9a1b7a7424afc0aadd1f31c9ec53a7d82153ce0e2c5e348ccbc1
MD5 44c65b4d9a051125e4099c547578835d
BLAKE2b-256 dfc3154a7f5299db09a51f5a82401e7236e17ff06c503315c8bd82d9a6692c9e

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.4-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.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7adc43b442f11f3fd2b56948e5d797f675ca88b8c6d8003cf35d7205dc793cc7
MD5 22d70028c7abf2431a17cb9a73254361
BLAKE2b-256 549535d4b1e9fe751aa6f71801d024fb18010278276290aaaf966e07a495ddb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a0937302d368fd3a954116b117a6790453de8fe48772c0bea86460259e3e625
MD5 127c597102d6bfddad3e91b9c47e7714
BLAKE2b-256 2cbeb84980b0e4f28f78bb9edfa59f5fac9af59c6c955b33fc1762f3cedc2403

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1ed983cf260bd0ccd6b4880adf4f1d94f0dcea9345ae9cacd2a3024bb0d9570b
MD5 ea2625d16cd39b0374d67391a0d9eff8
BLAKE2b-256 dedd85d2369921e9d4bd761ac0605948c9603ce16bb2a3c67990c7ee4b690552

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ba6837b836b754188c69e439da1d4c5edcc780fe172f4686c08900796f97213d
MD5 fc64a5048068992c27747e6eb3c531e6
BLAKE2b-256 b4ce4f93ec2788f549c747d90ce935d3b52bd238693359382451a054ddfe2c70

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.4-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.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5ad8ca9c6df3d05e36b0dd987f57b7055b50bde4c4d209faee0008132fd7264e
MD5 618780c2dcd19b53a946eb7eb60aac01
BLAKE2b-256 98015f81f3bf95571c9e68fdfc0e83daf7a083e460ca36325fb6e224ade7a7ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51e4ebb5232e6f86d8d1006add33f20b1a60fed3bc4ffd2cc64edc626b50906a
MD5 f17c1e8fa7ddf4f36615dafd9175db09
BLAKE2b-256 fbfa06a36a218f8dc610995654637630add4544ae3cab17ecbaeac9f14d67177

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5e6d413a8aad83d71f02780f198ae635bd5a9f91b0e0a2259928535f16fad565
MD5 beebab39ea5339e6a73eca41c2bc8685
BLAKE2b-256 6387b8dfdb4ef9a7e88215f1dbb17d1400dff6f3e85ad747fa1d296ceac2a5eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 27806d8aa831037ac4568e9b17cdbd90c3246c6be20db87eb2ddc0c080f1d7fa
MD5 0569738f5b787ccdb8493a3ff9d67a6f
BLAKE2b-256 acf7a10446348cc1efc094c09529ba902625b927ef00ca27f498a126057f7a1e

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.4-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.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f9950fb21acbbda38e50705a55e5ba5b501f1d7391593374b462106a4159a18
MD5 06f5b0b1a41a40a9364323d01b58901b
BLAKE2b-256 13b13d6cbb998c7a6f6029f4b6a5509ea30474bb40399aa7f6ed326f1a562f9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e5457a65cbb2a9e7996c8ac70e89b17564b875916929b8ff1a7063aa0752380f
MD5 f61cf514f59ab79019de2a43b3cf52cf
BLAKE2b-256 71c8414ee2856ef4883a0ecfbd805ba5487e31fdce8cefe672d99a3bfbe4f817

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 407b56abb282150811ba29cda91e2429f7ec8308749d431baf80928ed652cf8b
MD5 aec43553e35dd333d873807532738a9f
BLAKE2b-256 cf8fa8ae095a6101937a442cf6ed6ac1eb2fe133d5afa301945c01b39eb3ca18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 39b8e30a518b394928172b4616546b68657fe595310d535832c95b3f90b53c8a
MD5 4fc3bdb0ad0d9e52e225f37a04e479eb
BLAKE2b-256 90e9736e592aee317c7f9eb2d225c3fdc4f23118563b4d387c952476608ed3f2

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.4-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.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 46def7bf01b5e1c3ebbccc072fa2de83e9f85df072e2ce1ab8c952d0602eed5c
MD5 8192eb4816c68276a1a4a82dfbce2bd7
BLAKE2b-256 c9948edaa4cbde93ae376753bf27c326c41c76dfbdafa5b00cf3403d755a49ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fec6c3396c6f70aeccd1e1f0ac4271fea26cc8a7c380c748ef20e983277d615d
MD5 d1e8a4eac60462f26880627d8d106d45
BLAKE2b-256 2d6e1d3006675ed65ce7994736246e06b2ad6588ee4ca4c33687ceba63424ad0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.4-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 bccb10d2c11147056f9b35bc09d90418d3a3141a7cbd9c93171c855ef94fc8d0
MD5 940561e8887ab4844cfed8f93e826957
BLAKE2b-256 e5a85b3587ab1f9c225d77a73a138b7e132339380a372397dfb36b5eeae0b6ed

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