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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

dbhose_utils-0.0.2.1-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.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 66b5f723e8943b38c2b48dedc14d2595f5e084cdcdfcfa3506de7687b07793c6
MD5 3712daf2094e9abe6a1e90445268a8b9
BLAKE2b-256 0974aad1d355fba2b55a938704c2440543bc76bb9ee7d7d87d77404e0454848b

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.1-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.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 97b312a4bbee61059b83ce89b6c3c8680242283cbb1e0262c7060d3abdb3ed9e
MD5 8face338e4d48e2e592fdb79b75f291d
BLAKE2b-256 bad179573e4084022495f1246a2133c3c2fae182cf41ce838035b64de120a371

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a876d8b6080f46a1ed6c4ff7f32e6ea633cfffcb4614959dc29bbedffa2a9f2
MD5 b698fa493924b2e6811f3d7505af05f1
BLAKE2b-256 9d65b71b371e3ed0a03d0596918fd91a8fc5117f71582830687e665ec2529525

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 36d354cc314c3a06d07bc99f8a6bc191cd5b1f59d0abc28b649c50a061a12757
MD5 2b4c28b59a14057f17474c7c381efb88
BLAKE2b-256 5c52dbdf3317c64e6bad97fc25fcc68b3e6cb9be5014535e090020419b73387d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5f01e6f8d601731dce424269214e4c3350349c0752b16182bc12644bb4a29678
MD5 3dd27d7f0f8f98ae35b05399d39cca8c
BLAKE2b-256 e51809b0c8073701fe0ab4c8cdee17b01917c8aacf9825fc4f5aea4397070f44

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.1-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.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cadde56a03de2d34c4ad6ccd9e919f80a26bfe9e7a613a42b8e97c5ba4b4fedf
MD5 be4e7dc999dcc96ccfa5f62ea1282cd7
BLAKE2b-256 c44b777b5c6e7bc547827108eb8c9064071bffd5f4724397f83e7efee3322633

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 86dc2a5fe196c54b086c30c7b444e4c269d0a348b9af6907e21063e2bfe5b878
MD5 1a4a0c6ee12f3434b26d039866d37c01
BLAKE2b-256 0881b243631bde597c422cec9d1d38987ce7dc890b3be393e379adea06d0a275

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 15cb4b5076806daf5193acf3565acaf1ba9b2c2f067bb96d48080b5137c8220a
MD5 f3a5cf6439653cae8a21f69f6547692b
BLAKE2b-256 68e614d291db54c1333c2fb03e3e4f23ee6ea61c90fd96bb0b8c268a2521a8dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f898b06a1d049c2c03367e9b92998e219f446f0b4d90eda0f6dfd38c3e483c99
MD5 4c1b98f63f334d22d69e5d8431ae8306
BLAKE2b-256 1d2206971738fdd2ad1275fae4afffc8d75bd4f0bd15b4a67d974ce79af04f08

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.1-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.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d5de17fc71fb9ca56f99d90bdf699c20319ee888379eed37058f5308f2b99224
MD5 55107162788231054df67e53bfc55e31
BLAKE2b-256 acd4866ef7c1130d9c2ffd99c3ad7dc04e1c6980c639506661574c61dafca7da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8076c450ac9951c1a412283fdc91f5bfcb7ab8c697c11d471e5103858fd289b2
MD5 eb6566f2a6051edb9572f6df3f2eaf9f
BLAKE2b-256 10be92e44cba4d0a2edc01eace0e6f4f8c9874b32a319f213db9c1259bda6750

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 81458ceb3b98d615b448a0818b7dfd03d32c9bce713c981b73dcbff796675180
MD5 da2452fb502d6e021e6295e99cbff9a0
BLAKE2b-256 f7a3dc51fd3f7d312511ed3da4c2b2daac246939d43f35c592464485f2d9b7d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e4f26aabffb425ceaba4ececd2c654736c0a7ed4f2a97673fd74d8370085a5fa
MD5 25c5fe123c3c23c0bd2f681818d93c0c
BLAKE2b-256 f16208b71facedc3a8a1615d48a50f1ab68890ff5735c1cf3074b449b442f5d0

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.1-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.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 10aeca6efb4bd2bf592adf1c861ad6e01735be091c893f96f469ff182f0dd6b1
MD5 e293bb00a302aa190cd9fdd372e821a8
BLAKE2b-256 0f58fc92a3ff94853797ca0bc0347a994f1a38d5649f617bd8d22af4ed938eee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e91a173eb03e04e47b450ab37a6296ca84169d0239d4bd222b7dd0ebd705170f
MD5 53072fa49c0184fac23e241d4bad851c
BLAKE2b-256 a6bdf917a818d3018615830876172a7f194b50161211287ffe88c3f46c1709b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 90778add89f799fdf244b5771d82cef36225923d859ad7ab25097e211d82df35
MD5 21d83ad222b034d7b8f32ad30696a098
BLAKE2b-256 5ab093d68c6b70bf1cf3836f628f51a39fca50c3cdcdaa21a2c93f16fb3d476e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 94f12a4e19f7764c80cf081af25e2ddf33d98da929c882f07204ddf6da95213e
MD5 bc636c7ad42fa85728c1f6953b93da6a
BLAKE2b-256 f555949dfd411dbb72616debefcdfa3faa9a897836e4454dc48a22427ae39a67

See more details on using hashes here.

File details

Details for the file dbhose_utils-0.0.2.1-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.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 833475ea0f5c75ae9701daf6060f898a2bf98bcbe374c820ed71776221ed50bf
MD5 f29510ec4143f1e3dd99c00b553afd2f
BLAKE2b-256 50347dd2fb42781d2f4fbea1f39849af48fb24a2b9b0882181b06438c3c811c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ffb52ed1bb9f12f2dd5a13717b44ed5f772b9c0d5731a5da5a2f8ab998a182b8
MD5 4b75ad600622bfc1576ca7c92450b9b0
BLAKE2b-256 d0fb66d123bdb44efbe84738eff675907951a906a80d5c4ddf24b3ed1193b92e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbhose_utils-0.0.2.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ba140ec4bcaadcf7d270843ef4da3a70819c676d414e9cc20f5d4e134ae30b8a
MD5 ea234937f00879098e82fa90e4491aab
BLAKE2b-256 a3fe5baed4b08b25f00bf3e69645a02bd7fa6f5d6f6597f8750e449b3018b312

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