Doorda SDK for access to Hosted Platform
Project description
Doorda Python SDK
Requirements
- Python 3.6/3.7
- DoordaHost Account
Installation
PyPi
$ pip install doorda-sdk
Usage
DoordaHost
-
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()
-
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. # DEPRECATED for row in cursor.iter_result(): # Do something with row # Use: for row in cursor: # 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
-
Simplified Functions
# List Permissions ## Permissions are shown as a hierarchical tree structure ### Level 1 = Catalog, Level 2 = Schemas, Level 3 = Table Names permissions = cursor.permissions() print(permissions) # Check database connection results = cursor.is_connected() # List all catalogs rows = cursor.show_catalogs() # List all schemas rows = cursor.show_schemas("catalog_name") # 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
doorda_sdk-2.0.0.tar.gz
(15.6 kB
view hashes)
Built Distribution
doorda_sdk-2.0.0-py3-none-any.whl
(16.2 kB
view hashes)
Close
Hashes for doorda_sdk-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 286a6273d090999b92f4bad706e10dc5ed65218c797a2dedf1c54574734948a7 |
|
MD5 | 2a113b3072d5eb3cd4758a4285b625d4 |
|
BLAKE2b-256 | 37688df341456d2592d78b293105ff1122b7e2d857ac65bf49bc7f967620aea4 |