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

Uploaded CPython 3.14Windows x86-64

dbhose_utils-0.0.2.5-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.5-cp314-cp314-macosx_11_0_arm64.whl (57.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

dbhose_utils-0.0.2.5-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.5-cp313-cp313-win_amd64.whl (52.3 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

dbhose_utils-0.0.2.5-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.5-cp312-cp312-macosx_11_0_arm64.whl (57.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dbhose_utils-0.0.2.5-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.5-cp311-cp311-win_amd64.whl (56.8 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

dbhose_utils-0.0.2.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (318.3 kB view details)

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

dbhose_utils-0.0.2.5-cp310-cp310-macosx_11_0_arm64.whl (60.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.2.5-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.5-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a952a2ab82ac9617d04fc2657828a53d5b1d91e5ab44b94f669709fb55b3f272
MD5 18621369fa39e8ff241eb476d853d36c
BLAKE2b-256 fa30e16c2eb9b60fcfb50573b44a49e92899fc47fce45b28afaa9bb879b97522

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.5-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.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8366b877ff593900244b7e402d830c7e098b505e4fb4d0d4fc05aa73efe69795
MD5 e581a3316a7ef9d1fcfe618b9e0d2032
BLAKE2b-256 abd532fd10713edba1a85e912e392a650c262f5a9cea2bd1c76dcddfb71737f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b19f4812ba7dc872b26ea60732d872830717c4fc3714efc162f9e041758da70d
MD5 539c4087fa326481041dea063141e5fe
BLAKE2b-256 53401a624b1c2e7d543d447782cf5fcf243aea702ca2eb90dcbd8d2b0f9482c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 36d639649dcc023cbd7b6f983676a2311cde019c28da4f663142f0cff918ec22
MD5 0744ffa27b597629824a5f531f4d4206
BLAKE2b-256 b5a65dd77de1093c11d8300a1f808d66e45c93d6fc5bda3a8303e3a87b247d29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7009fe1405e0b80297a7816f43c44aa2ffa4590cc9997214d2a5b0a69c9038f7
MD5 bccabc1f56c99fa53d99dea0a57528f5
BLAKE2b-256 205a0a0981213c957a922f835aa964e623b3baada0d2d5e3631f87152ae5b26c

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.5-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.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 71eba883f9736abb3f88470dc0ce4e85d37eee887dbfd2976310050bba60440d
MD5 4d8f7f0157164fcad874463538a6624d
BLAKE2b-256 fbb4fcfdcab1052dc66000ebd30615850b028d5150cff0ec5651b8472cd1738c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b16b23815db531cb1d5aa1c96a8a791ffa9b143209d1e05264edf186cc6af692
MD5 d0b7ed51bf4105c530b62bc3e51ceed2
BLAKE2b-256 83673e4b56bf270f9f7c242892addbdde990bcea046551eb48a8a05376fd1913

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2a8dec1e223ec1f943d4e728a95f88fa6388c95fcc7e70a598dd4ef84b5a0f41
MD5 e56ba7090d0342d56ec587a97d7dc423
BLAKE2b-256 632475f12937c78e0b248adbaf4a25b957e70e1eaff9bac4679bffeec870e9c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c352d0b80f408e9088b769cc9805a724acce8d61c68beae8ed852c19c2173809
MD5 0354e540417801ab1a80b584fca6e9d8
BLAKE2b-256 c648f4565ac537a6506e279bdadfbbe9c8c8127e6abfee7356d8e60bba1607a5

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.5-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.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3a384cc4c302c620a4ee854fe74388881ab508ddf2a6fbf09a67179d3c7706cf
MD5 c5378fa990eef4cd4c90e1545bf93b97
BLAKE2b-256 824d97f51b095389bbd16b1e94c9679f0107a55c4645563bce10cb08a7acc986

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7763c886a56a54a7a4c2c5d45632343040cb23b9345724601086d8185c5dbed6
MD5 f70960148e14d2f2ca3882cc5c255c32
BLAKE2b-256 7e6022586c86960c8e5ee28539d5e8f3e1821c76beb674833db072662ea7583b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7a44194b22dfa2f18928e804a62e0c8733cf597f257222457b31e8e507439ee2
MD5 695bd3fd490d362c30d963b4118744c2
BLAKE2b-256 c237786dff618f88f154fffdc082a4b5769acc353e91cc280d2613674b16b958

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0ea1d60aaf2d30d4c276cefe0801a0359dc4dd49f08b45000de14d34f29518b5
MD5 9cbed8c1545c32fbe147e4c2ed3b2873
BLAKE2b-256 578112fb61ecc16d17198ed4963c5cf5e40a49bee1c372aa7e87ff48ce26ea9c

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.5-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.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9903ace301f979d625032e9f1a0dbbcdb4a51317bde7dbb1f37df0e58796b0d9
MD5 a85d630ac983b4d1abd2336caaf7b67e
BLAKE2b-256 b22a570a2f966eab261aaffc2516a5bfc08380b4d5fdb87a43cbd4c2a293011b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7ac298de90dfcbd762ecaffc15fb9e95c412faa4e7af200a8bb445c9618069c9
MD5 7e89c944d47c1189a0c26dccae081f6b
BLAKE2b-256 d5c319f19421d3bdaa5879ba623e24c32d1e30eb65da2136208c6a396673f0c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 04db4208a04e623b7bc7657d675c7c5194cc47e33ef55ccf8d44e7e6003d2d23
MD5 d6a913db8c93cc85ff29484541a0e497
BLAKE2b-256 22e84a52338ab1a033c3ab2282bbef7f70438b9c2857a8b854c4bde7f06db14b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e9f22b36ec80f89822004ee0a180d46f0ca57026a5f10127326634de162e9f1a
MD5 929f830f21006189a0d2df1767f18f88
BLAKE2b-256 356dc2d5cb6c2b85730d0e25f1d6d548c762c802f1d3a2910a15ee96fe0bbe45

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.5-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.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dcb9d4e5a80bd2fd9dc5d0ba31f45d2eadeaacaf25b2f058bb8264cfc571130a
MD5 05959c24f924efd9657041c39dc9c262
BLAKE2b-256 21390bd5db408d5b55a5d499d8262fcfb427996d2768dd1871f8604691117338

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7e503df07235f27ee2b8814d197aaf913c01cbd0ba330c82bcf688c699a5501
MD5 1805866404feeef5aafcc0b98768d397
BLAKE2b-256 c0bc928dd650f1108ee4577659c71d3cc194e40429229b0b9654d0c6c35953dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.5-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 160ba8b2d5144b718cb66172fafea938ced959e5e4541fbaa9dd1a4b4a5b2e07
MD5 2f6f4117d6a674ae2a086f1effe9fd9c
BLAKE2b-256 b410b6aa0f6663fb0b57581ea9d58de479fe06ae479e131c1fc3118347467a5d

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