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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

dbhose_utils-0.0.1.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (344.6 kB view details)

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

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.1.6-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.1.6-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 2cc68dfc32f751bf65459502deb60ac51f28d792c490e19fce090c1c1804c599
MD5 624a0a57f6580125e475809c8d6941cd
BLAKE2b-256 55cbf4c89529923cf440e29392d327c641c571ff17ef5db234990d90480d97e4

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.6-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.6-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d198da2f7c2dab0a14d832b138dede4cea727603f10c3ff50cb7507fb853b3b7
MD5 f67cb049db3f263db48732a8b0a1e4c1
BLAKE2b-256 10d3525d909e93b24b3f1e729e7e83fcc06253f6011568ff309e6bc3febd275b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73cc9f8282bd54152418cb5a7ed0a21cf9b512d7b093d9b3a754567cd562f583
MD5 90a5cd02e422fcf1cd60c44b9363632a
BLAKE2b-256 b5d160d0352d1d28c82c8362486d646e853b1aed6110927ac6f462ffd3f58fa2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6de715017f775849c27ab6f63cbbaf603d04339738a665dd2dc02c6bfdde0515
MD5 2b4ecde47ed1508a2db635441aba304c
BLAKE2b-256 f35417b5be38ec8c2799bae9da705f0558e0af4437203cb13680088cabcdab78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6176234e7a873a7761517afd6fc740b7c5b1ed4799a5dce291bf2f8495fb155d
MD5 b50f81afbaaba1cd05f1e02160c597bb
BLAKE2b-256 2aeb75b8401ffd4604672bbe991d0f633fb61a2ae941480c740dda2cc4a0818a

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.6-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.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d897be4f1696d5372be4a1b13abd3b9ec0214e07e83b51eefff8645990a23b8d
MD5 e2a45ce8ba76649e7fc102539d7c4b0e
BLAKE2b-256 1902f29df38cc75f6287ac7c279b0fe4a89c83f2d76f957b8b8d43f67e9f8095

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 625be8a964fe1ceba6b75b8f6fbea982ae2e4b0ebc9313b927c115214487e786
MD5 1383086c7f94cb6128610c854facf4ec
BLAKE2b-256 32c70710dcbd9593785f8f19b04829108982e2f86300f6f5d4eba95cb495bcdb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 47ecc3b1e869bd0d332609a8de6a38af54806559bb1fab38872eecd9ede054ed
MD5 a8f5873085933ba8d42a507495dbbcf1
BLAKE2b-256 cad98a817fcdf1c0d3d14a500c027f43d1840697bf99750d0b26feefd26b211d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0d1a2d2b52b419401a33891c5b8f07aae15dc9ac0ce3cd53008fe4f207f3530e
MD5 2cf8ff65a9cbc8e3f603a80a7e30e0f3
BLAKE2b-256 81ea001213f750b21186f4c2f4530c622236da523d8d3c04d59f0268cbf5aa9e

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.6-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.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e754ba579974777060d406c21c17afc177447e61d7736cf2d22e624e6c9c1d5b
MD5 088ca56fdaf41ab4cc9cabc9756a1eb4
BLAKE2b-256 482cab6d0ded5629dba39c587ec3f494c40a5dc8f734fee17f6c0033e731ddab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a51f3f7dd3ae92f84af43f590fb1079fd05f5ec42dcfa0e3756389818ce45b04
MD5 395ea1f18381925143d6acfcb27313bc
BLAKE2b-256 492a2a096a99292e934821a526f740562616616c90b9bf121087444065cb6df9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f344633dc00b05fb98f8df078159ebe91950ef0b5a00471ec81efb521c96f17b
MD5 1b07c231a0b5a66785a6aafb362c5deb
BLAKE2b-256 651213a9fcd591ba83cc85a0ed0ce17e9fa12c8e09c1a97a6da299b81721e453

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7519b35fd770688d8bc85ecb72cbd3478097a3e6bbfaf0e022d7d793a7fdd839
MD5 b3ad22d70b3c42232e951531d220e2c9
BLAKE2b-256 6a43a030a574aea696beaf79874d93deaf58128e1f7d2a1d4f7bf42c361f3747

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.6-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.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 adec1cdf8d9975e25349a10b8549c401c4c61fcaa71d32dd21f6a5d5d66d172b
MD5 71531154acd1344efb63e8e974b28282
BLAKE2b-256 98a74e6eff0f37f8edbd26e07ba65bd23e48f4c3cb950e5090c6bba422e76ff1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ebb873a0685488872291c1e8c117451fd11694d9767e9fc4ebc7f8662d63a45
MD5 fe842e1b96e126095080ab5752f1200f
BLAKE2b-256 45b80e780523762b16b6bc84721ae95541553c0cfc19ac821dfc13ba27364c04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5043f13b5cbfd6e764896184948906f1db5a71b211200a4ddbb71e767f0ef1f4
MD5 49f64b7370ba129ec92b995bb2a0066d
BLAKE2b-256 7fafa6bca49fde2382afc7828dfbaf89270967c569af7ec38adb7d8c1fd7fe52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8d4e594a84b3650f72e73180736bcd937e88f337e72e2651dbfedafc1a263edc
MD5 6519e60daa25efc8e41154831a4285d3
BLAKE2b-256 b007f1b9b22ce94267e5b5e0d1290a699a64141c10a23e93eff5fe259684a970

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.1.6-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.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4a9b1435ea9687e9d3dde1408029e515a69898952ce04a9da30d5d2b06b359ad
MD5 e0b4a8ef11b5265d282cb977870d45d8
BLAKE2b-256 83cbfd8dd66ecdbdb40a041b9a04ec70e13b6fa66da774900d0bf976557cc675

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb23a6d7b390cee8861462124e002b73f7ab050f671bc7a3e990d0b783c2d0d9
MD5 9ba0873edc4e84f098724fd85ca6fc1b
BLAKE2b-256 dbb4768b1d23770b7cc4a24a8e7a22e956eb14b23f9550fc14d37573636a0bdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.1.6-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4529bb3fc9ceaa84a4bf997e6a07ea4ffcf002d64b4ba367fc66e8f8a069f978
MD5 656a0ecb2baf2b16d432566183119ae3
BLAKE2b-256 4d625c1a5de8b22e4b5a92f45ca5d4f31f9361120ea50919d752ab0536c9c831

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