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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.1.4-cp310-cp310-macosx_10_14_x86_64.whl (65.7 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 74f0bc5c307adda4d73444be7506f2af21d6c6d7c0eb18c94c1f72dbf5b68550
MD5 1d6ecfffc1de4363585d91e1845d8c9b
BLAKE2b-256 44bfcababf6bd7eba37544ec6b3bb60e59dc1d392d31d0ae6555f14ef5c3a590

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.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.1.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b6024a5e272d77bd3ddda1c714d818b1790bf7b78eefc1ad2116724c48d79aa5
MD5 5298573eeaee9c5634343379e613d934
BLAKE2b-256 4ee1a48983dd81264eccf1462c967fa1dcb75c6cc4170176994dd98a6e8325d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e82d81ba7688352081a4f34d5459917560d743e6c5faa74eebc9740e2860ec5
MD5 0194867b827a58b6c8e1e07bbb65fcee
BLAKE2b-256 982777792f121ce3c96b4332267f55a2c2a8e1a3b44a5f040fb64d65dbe5e7a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ce415a25bb034af2d18c8cb92a50da7523d90207b69b964d862c7872bd10b443
MD5 c27740fa9f5fe7124c540a603f3f24cc
BLAKE2b-256 292910b0247ddc035eb23cd296be6ac792d9345f6bc432f73f73d3acc625b40c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 62fc92ccdc3befea9b71ec0e7cd244b04e7854b0f18874dc4f097b52829d2a8f
MD5 14249864f606b249bde30b3e54d2fb69
BLAKE2b-256 f038e062514564b5d95ee4277a7161b35663ac9e14cf7a4fda99b6806e8f1e15

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.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.1.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3256e9124b5d7f97a213f24e8269f730732c72e9b5fef7f77754b2a6f1b2243d
MD5 f6ef5bebbb86c04311fd60bdf4250ce2
BLAKE2b-256 795608e5fa96ddbd587f32f1d992d3951404ceeb303dab641e0a22f301d26d15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc7c2ad792d40412a8c1b5616425fa466ecb0f1e48a7a0afab78102c3d9f61a7
MD5 533f1d916f61e38707e9b525905297d2
BLAKE2b-256 26bb2fff40d6278da44b21dc5db1e724ec62d80af986f83a81d01cbfe62f73c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3544b85911dc030b6c362f7a95a7882055b74b27e0e372b655857075af859d87
MD5 b8350968d1205ceb73e321ea7a0ac946
BLAKE2b-256 5a8ac3ceaa5b507e6f0f42a0af5a85da2d55927cec67ada1cbc3b4e69ecb6e67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 da654205bdc4cd3b0babd695ca2512900b8128d65ffad4f3750da13966106ba9
MD5 56047beef8f31313c8fbe8b1185d5c77
BLAKE2b-256 81d2bcfbd27b1d7f3d99aca7f231ad1dad65e1f13e7a363575c2689b944de706

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.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.1.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 268fd9c0747d19b887f61f7cbe19746a719cd623ee2b47b5b406dd85d1238513
MD5 b3fb0f4b7314392b66059c358b02ee60
BLAKE2b-256 962d58e6fb0f36fc98e2d4741fcbf82f29be148c0bee60728c8c5f5e16c51c9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44b4a16b453166ef82d40cb051b8b5de16593f97c0484c6a6fe28ffa7a11fd0a
MD5 8ccf7f5543645e9723ce6c4e2c7538f9
BLAKE2b-256 c112e955ae367d2f3e8424e0d753004db75caaf5c8aba509e9371b04f34e59d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 dbe73a4e17dc7e29facba90529ab9b0c5437c50295a08b357e0049afabe5ced9
MD5 c9b345a42f79ac6daa31e85b74f05075
BLAKE2b-256 8c89c95bb8cdebc0590b47d912857b16e76fc5fdb673c3984e4b0dd49aabb538

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b238f5b57c910f2353b79e9136c4097ad73e3c5c03071454a11626bbd7d4f57a
MD5 306846618b98206ff7bad189bf534909
BLAKE2b-256 d53a65773a5a547b83b1b27adf8063eb17f0b9bceb89f1781d8ae6869994853b

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.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.1.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0b486b67e7eaf9f85f91d8e2484ba4c434ee4775aef7a821cb2b03adf35078de
MD5 c09cb62ec3db24fc8784c33b516a3800
BLAKE2b-256 eac5dfddb15435803376f64b19b3d67affeb611c7b7115db5b7a326dca5c31c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2389efd9e536a470893b9bdb38c82945f88f850b5f5d47f0d504f6515c0d0ca
MD5 836a36091f410d8377b4ab3334117702
BLAKE2b-256 3a07edffa0a532cc7d424e731c53093e090585561a2fb1bf60167dd71baebe8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6e5910bf0f711ff459b312b9ccd9d027181c26b6629850a482d63989504689e7
MD5 3cf95f06be2adc330f0405eadbaa762e
BLAKE2b-256 3728d66835bad0bde4958d4f9eff0392be24aba20d5688c4fe0b7b117ae51fc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 562c9ab12a5e73ef50a01dc2ce9a411ccaecbc213f0730971dabf66934d864a2
MD5 ed0cf2569ff58752f4df6e3ff68a0bc3
BLAKE2b-256 3db715034edc1b6a6a41c8f0436e8dfd74ca7240c0eafdfa7687e5e144415eb2

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.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.1.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f063f1c68f9e1558c2ab49485c2675dac92c74435e506117e5bbc9241b497f98
MD5 d23f1a694a700fd620fe264f80bf1b62
BLAKE2b-256 9c4ccd8904fdae0f22b7b89dd096a8d599fef5edbb98ca4ce7ba6df0bd49f802

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd39b69b6b2a236f720282cf39da5d55b140b810792c62c4357917a459824c92
MD5 276435c683cd6863e9666b952bf3b87c
BLAKE2b-256 5fd73ef1806c6e786184b0ac7a737859c834d0d64ba97d8938ab606e033102b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.4-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7a9c7d41d51b869854b262c3422a56846fe3d221587e079ddb89125d45e98de4
MD5 6f40d68e3645aba0fedfd07b8b20df00
BLAKE2b-256 2d6340d46166fce52951444309b4396bb6f90761a3c6a948c20f47dd671d5d08

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