Skip to main content

TopMind Vertica Connector Wrapper

Project description

Customized vertica connector

The Python Wrapper to vertica_python lib for reconnectiong across server nodes

Usage

pip3 install vertica-connector-talenttech
import os
import json
from vconnector.vertica_connector import VerticaConnector

user = "test_user",
password = "test_password"
database = "test_database"
vertica_configs = json.loads(os.getenv("VERTICA_CONFIGS"))


with VerticaConnector(user=user, 
                      password=password, 
                      database=database, 
                      vertica_configs=vertica_configs) as v_connector:
      cur = v_connector.cnx.cursor()
      sql = "SELECT 1"
      cur.execute(sql)

VERTICA_CONFIGS variable structure

{"host": <VERTICA_HOST>,
 "port": <VERTICA_PORT>,
 "backup_server_node": [<SERVER_NODE_1>, <SERVER_NODE_2>, <SERVER_NODE_3>}

INSERT TABLE EXAMPLE

   with VerticaConnector(
            user=os.getenv("VERTICA_USER"),
            password=os.getenv("VERTICA_PASSWORD"),
            database=os.getenv("DATABASE"),
            vertica_configs=json.loads(os.getenv("VERTICA_CONFIGS")),
    ) as v_connector:
        cursor = v_connector.cnx.cursor("dict")
        cursor.execute("drop table if exists test_staging.test cascade")
        cursor.execute(
            """create table netology_staging.test
                             (
                              a int,
                              b varchar(10),
                              c long varbinary(1000),
                              d long varchar default MAPTOSTRING(c)
                             )"""
        )
        v_connector.insert(
            table_name="test",
            schema="test_staging",
            data=list(
                [
                    {
                        "a": 1,
                        "b": "test2",
                        "c": '[{"x": 1, "y": 2}, {"x": 1, "y": 2}]',
                        "d": "fuck",
                    }
                ]
            ),
        )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vertica-connector-talenttech-1.2.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file vertica-connector-talenttech-1.2.1.tar.gz.

File metadata

  • Download URL: vertica-connector-talenttech-1.2.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.9.6 requests/2.28.2 setuptools/66.0.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.8.10

File hashes

Hashes for vertica-connector-talenttech-1.2.1.tar.gz
Algorithm Hash digest
SHA256 bfefeda878de6648c8151aea910db1cb96ff865d37a74543b5b0b09d044d5b24
MD5 b093b2568ac002e0270b338aec5b3ad2
BLAKE2b-256 2bf55361923f21c38e6f7dc786bde9e2d380a0323b1f765f07deeb1b2bf170f2

See more details on using hashes here.

File details

Details for the file vertica_connector_talenttech-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: vertica_connector_talenttech-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.9.6 requests/2.28.2 setuptools/66.0.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.8.10

File hashes

Hashes for vertica_connector_talenttech-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d7e19bf2f8c1dbe0a1d9064151bd5098f326d781e36878ff8087242c31b2f4f
MD5 996bf569fa87eefa73684ac1259cdf2f
BLAKE2b-256 4b3182c2280cf6bd212e78175ae8f5489e7711a828c9ef1e6ec1cfa783390c77

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page