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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.2.0-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.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 dfe5d861ab0a2b75801ba950e4429918e51da586f0912e0fc3625dbca5a7e2e0
MD5 d6ec00e8e4bbff321e6643831dc488a1
BLAKE2b-256 d04287d44e05704f6764009f1c0338fde53d1f64e50c60c24e2b0e677c1e242f

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.0-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.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 09e93835122244d015f81137f03d9f7d2ffd99946c0c184820b71ba161fca0da
MD5 1f36b68e32aaa00b7f463a085889d048
BLAKE2b-256 e6e5f950a5cacd1314f2764afa43182e4881ffed6b30dfadf3201122d2e8c6d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e98e31eda17aacfddc118d451c9f9128132c4f3567e6c86b3f4c3d166e12a7f2
MD5 14d5589969dea2a2aa39994b49832ae4
BLAKE2b-256 eb351522d0387b48f87d289af44c2b1d9eca62105dcd7e69c41f8a07fa4f56c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 868d217c3d971ccd5f502d037a7ee81fd51794cb23be7fe556ce9cc37956cc03
MD5 bb15ce6b7bbbd367b91d9d18894a0527
BLAKE2b-256 902bf9c2e42b6d03ff26f85886c1b6d2d97549123fda1ba84f18667bbb55d866

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b4d55e2b821c7b77fcad8bb1e4adf1ed939bb9fc07a767343452fff9bba51c59
MD5 d2799f00dfd7a131f49b5fb68dd65161
BLAKE2b-256 8c511f52ed7d72f5ad6bb2dea4fd50919b27c29c340ab57774b9d74d7460b3ea

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.0-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.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 663ea69912ba8dc784e259db7a36d3c9c364ecfbda4abedfd95eb566f36b09fb
MD5 449dab97872f5195de9d20342b9379d2
BLAKE2b-256 4d9f7b007d186737bb089e0ca8bd54e4e71475c28dda57bc23a4a02e1d13c069

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c83dfe6216cc249f45fbd407729430c0df5a6b63ed1f677e7a2c6ea6ab73729a
MD5 1618d83f8331fced7a8eee810bbd2619
BLAKE2b-256 9922ef980e9232eb6712bd6a5386b4500937b1a0e01fed2d3ef73d545f868d9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b59d74c5a4391deac8b94673e71de5d65f65e9e3a6bf36fe588f1a2be6d5923e
MD5 86343273ce9d4e35ceebc6e561838770
BLAKE2b-256 d256bca1a792c20cceb5ee9f16bed2966249101e5a096b50c363df2757d6f795

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 016aa21e338de2a44359e0c34e875b754c103a408d01b0a00da8dd825e9f68bc
MD5 b7d6019fe8720d5f3a339a3edcbe26e3
BLAKE2b-256 fd0129354f5e433bb71fbdc6aee96eb66ef59f6e6de6c10e7fad978f3fff9684

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.0-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.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b147a2aca4861bc395fbcf659e57fcfb4ddd21c2934903fcae0222995b163659
MD5 47ab314d6d2823e3ff08403dfdcaa586
BLAKE2b-256 1395f283bc75e8d131adca5436844ca26f1261b59869c4d4dd5b777950f723e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 29ba886b6fad276434cd0c0d5d2aad5386319d0726ec3aec5a810bfbcbf47108
MD5 17058ca836a63f0fd20d0d5ca7e21cbc
BLAKE2b-256 b5c97a4620a3dfeb85857a639bf7d0bf32d70739a2b44adf94785842e32147d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f1fe4d0adecf77b4875025bb57d9e8fe6d6d2bdd5245ecd9fadfac6d706a0b23
MD5 a10cf94f625af17d7ef3748bbb495dc6
BLAKE2b-256 3fd2d86410f393c9afc4df6b8e518b7576b3467280647d810e7978b8b98ef6fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d5ddbaaf143372747ecd1905926c5eccc77cb66fbd191084160c00634af427cc
MD5 eb849b8fcae8cba675a9f01398ddc1db
BLAKE2b-256 0c2db338465fda1d628f218d8709fd8e07457728b694938eb3a692e6d8500177

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.0-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.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e16d601b695a2f15bbbf8a66f5f5a228a63d7c45a685f55cabdca82b57f7c39e
MD5 76329f853f329012a00c14761cc7d9ab
BLAKE2b-256 4713b5b3ed33bc46eafef1aeff4ad994806567f646ad923e0d427ad1e20cb811

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e12b4acfb6a1950890f4c3a1e3c54918978afd2d08eefb39bc7884e5e9a6a88b
MD5 9f16aba9d2a59fcaec5789107e04e100
BLAKE2b-256 23a76b4152ccc907024a77b1da22c6e3d872073d71e755e1c50b09e027e8b6fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 95fdf4cecf9d272dc4fd20c183b20ab7d1466731e4d91e51d9ca1302d7ab46d8
MD5 9508b8fd67e2038e6e6205fc983acf34
BLAKE2b-256 58e9a14027403dc20f557214279be19a9ff5b2e1870989a25506425ba13b04e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cb6d516614fdb728bf826a30f5b1f9b98f9fcc86dc6e534d58d6d15188ba90d6
MD5 6c7d4f00c034d7c4bcc7b6805c617553
BLAKE2b-256 9680f886b8195210bc7c9027160a165d112ff71339cb7d1406908678fd4c1532

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.0-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.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6c9c86b67f08a4cc7b612605c3894e99f5adf8308c868d192263cb10a7a4aea3
MD5 ef03dfed64a1b01108446e1dcc90dbee
BLAKE2b-256 4e9ca3a8b9cfdf57c0f49daede322e00419e1e7e38a283e4edad9b8ffa09deab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65374d75b49a3e3b6db7a0f2603b6c2e63c41ea19b5d69cd5dd6aad00762c93d
MD5 f3a401a91ef26e5fd7033d52c34e6b50
BLAKE2b-256 5eb54970e17cda0e8394d2f941be6bcf6d477756fe6baeb3e220c2b8e38c0200

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f0a218beb9d4d89f57cdd29d2cfb65e1252a38ce1a456bf728329a0ed016ebc1
MD5 52d76f888bfc58b7978664c18826f610
BLAKE2b-256 d26e734f8211e707fd08b05e74ce80ba77a2c709f21cc63a69da5c8c1c7a0015

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