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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.2.3-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.3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0fa1eb6b7ca58f67de5ddcbfe87eab69565a75170510125cd90709dd8568113b
MD5 426dc8bb4bd60131322de2d792cb33f7
BLAKE2b-256 b3add45d55ad7c7961267a0c4a66ce34fdcf759931d3941525691798ac5549cc

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.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.2.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8eed25f73e4096c3998f8457ebf6ed74818c2bc119fe617c03cd0af77e7ac1ab
MD5 d458749bc08852668484376857cb951f
BLAKE2b-256 3fcc31a06ceca10c6b649b49634acf0a315d5ab2ceaeab294d65b1849d264246

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a0c05f0dd9854d67d1d793090b78a0ab4b3a93822d723bb20c26fce89a044e0
MD5 1a7d663c325ae3e7c35d5daad2a84cc5
BLAKE2b-256 cf3cb72b971d7b37da47d5ee36fff5cf3a4c79f49ff09f9728bbfde1d3c6cef8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 980c1f6c5d5eeb2c3acb4025105131ef16078d571e862963dc2e07f207f93372
MD5 0540a92221c43cae8650db3b9156af04
BLAKE2b-256 4b75ab10b8a40dedb38e06f4e2212c3067dfbfecf15a0fda8178af80852e095f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c851e70087818e2222a92d6be68216c0c492f4f1cd08c34287f0aa88bfefdf63
MD5 55dc6a90f3b28140fe8ebf41998e125c
BLAKE2b-256 2c96dabcb38acc8b3e21aa89658b0a451085574f02655625346e341d1df72316

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.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.2.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2b3c3aa26df964e8e1d266de8cdbeee868cfba078c9453938bf29eebb1722ceb
MD5 54f8718df4063cb3ad4e4eb9271586b9
BLAKE2b-256 bb70fe52fd32ac4d1bb71c8d159e3793fb7fc73aebd08ae46a53b70d66f30e18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02d4ca7ff0f382af7b9b0e9b94295521d6e9acfc420821c0ed92a848de29d20c
MD5 964ff775e7e87f5e3ab8c385e4da6d9f
BLAKE2b-256 1f9e0db8c3249e5480d7b5eb6202be89259e6b0be18bf49822ba7328488f9fc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 fefc29b4c5f149ddc4fb15b19dc9c677d52d8ce20f2ac8c3eebceb06470c69de
MD5 98639db0cfb213e8579ef984a6b6d2d7
BLAKE2b-256 dd5c52e4c609c28d7354c78c1f49942f5977315f38348c3af4d35aa82bd42371

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 272407cdfa24a2ac1e432c4b8df97a9835bab0e3be8ce82f1c4696017f0135f5
MD5 528bbc9dafd07de6839a233b478e5abe
BLAKE2b-256 44a90216f4715f1d5e260d814b729ae4f16c00855fc87eee9767af84ddf4503f

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.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.2.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 edc53fa6647d8c20a3f23c74bc3a931797966ac2be4c5de6a408b6b2ea169a97
MD5 2028f9d650994001fd05c887feca5893
BLAKE2b-256 b86ee035e9f32be76edee002c4887bac4625398b73aaa7253399302cd2c4b6d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47487ac4231769bd8f34fc9682a253495208d3c79355bb155cadc19b6285d043
MD5 198eecbc54d00476ad7a3cf6d3d02164
BLAKE2b-256 6a35b5eeab7af719e9eb41ad29cffe050f837b15ef0c86c87298ec881cd45245

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e2bdcc57a04fdd2a71c2a9487ebde2da2451cdb49d2c1cfd4db41df7d62978cc
MD5 8a167bf31f8f827dc3e5722cef358aa4
BLAKE2b-256 82543b84f7f84af0a1d6a31ea040c76b32ccdeda53dd3040a6ff96dc0ae9cae7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ee2d0ac78b3b1901bc6cbed6c28ae20fe4c6ffb58c8ea7b16dd2612a21a7b4fa
MD5 113e76be136a140ef55e8cf83efd794d
BLAKE2b-256 7fd3d8bd005d8effb02c184c6be60d20c42d83c2de68c2b974c0b70a583b4c67

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.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.2.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 335727db664b08a4df42e5a47cabed00be0f94f04b5295c8d57a378c9aca3e75
MD5 edf7734cc9fcc7f7ad00780ddffb0e0f
BLAKE2b-256 e1e94b72af9c2bf488d9a59e268d4a4cd4cefa19c422539d39b32da30d6f835a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee4f0353e019e2bdb2c6604dcf89c11e74486a736123d30ab0d2ccbf753e2160
MD5 2498136094dbe09755b12085b0d50c20
BLAKE2b-256 be5708e43ce6ec8ef69d40b43c5cc265c26de64e1a2d3525ef4e7a7d0cd0703e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 754f75461d99a1ed6afe977955f1fa8d1b89c0c69f77280cf2e0b5bd231b99d5
MD5 fa838c6c141a2b9d090e32aff0dcb50e
BLAKE2b-256 725049498ed7f1c748439f1ffacc0349562953ef72138c41440c54f447a462ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 93e0738d90ceef482bd3875d0c784e5d160e5ec18cdf5fe625a1279d58f87174
MD5 04a865fa0fe674ffe9ee6c90a35e96ff
BLAKE2b-256 74a4c506bcb0d44bb0c51ccb0b482887960115628c9568d0ba1c851ad5b9c6c6

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.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.2.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30077d226a9113737793cdb2e100a8e5a179a98fc3075b713d029e0eaaf675ef
MD5 1de750d7c10f78adbd8706c18a1425ae
BLAKE2b-256 e6d1b74065252c54dcb507c6bafcd62e47352980fcb416c3819244e85448e60d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d079b924013ddb744a0a32a049e19c958c16aea848b6d7bfbddbd1bd0a5fada6
MD5 dcb9de781c09244d489b865878f30aa6
BLAKE2b-256 ab824353c858dd6689b2d722545423023390af280f8db195a3062a9d0b48f717

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 502a7c42f2bedd3e64ff329daf424d4f7cf833404ab26d14473312f15ea77312
MD5 ebbccdd95f82d8672ae9d3c2eeaf29b2
BLAKE2b-256 7a29b962834ab29552c0055c8366f8823261527472d1db3349112582eef3d1b5

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