Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Doorda SDK for access to Hosted Platform

Project description

Doorda Python SDK

Requirements

Installation

PyPi

$ pip install doorda-sdk

Source

Download from:

  1. https://github.com/Doorda/doorda-python-sdk/releases
$ wget https://github.com/Doorda/doorda-python-sdk/archive/1.0.10.zip

$ unzip 1.0.10.zip

Install

$ python setup.py install

Usage

DoordaHost

  1. Connect to database

    from doorda_sdk.host import client
    
    conn = client.connect(username="username",
                          password="password",
                          catalog="catalog_name",
                          schema="schema_name")
    cursor = conn.cursor()
    
  2. Execute Queries

    cursor.execute("SELECT * FROM table_name")
    
    # Returns generator of results
    # Does not put result into memory. Iterates through rows in a streaming fashion.
    for row in cursor.iter_result():
        # Do something with row
    
    # Fetch all results
    rows = cursor.fetchall()
    
    # Fetch one results
    rows = cursor.fetchone()
    
    # Fetch multiple results
    rows = cursor.fetchmany(size=10)
    
    # Get list of column names
    cursor.col_names
    
    # Get column names mapped to data types
    cursor.col_types
    
  3. Simplified Functions

    # Check database connection
    results = cursor.is_connected()
    
    # List all catalogs
    rows = cursor.show_catalogs()
    
    # List all tables
    rows = cursor.show_tables("catalog_name", "schema_name")
    
    # Get number of rows
    rows = cursor.table_stats(catalog="catalog_name", 
                              schema="schema_name",
                              table="table_name")
    

Find out more

To find out more about DoordaHost, head over to https://github.com/Doorda/Getting-Started

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
doorda_sdk-1.0.10.tar.gz (9.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page