用于访问托管平台的doorda sdk

doorda-sdk的Python项目详细描述


doorda python开发包

要求

安装

Pypi

$ pip install doorda-sdk

来源

下载位置:

  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

安装

$ python setup.py install

用法

门主机

  1. 连接到数据库

    fromdoorda_sdk.hostimportclientconn=client.connect(username="username",password="password",catalog="catalog_name",schema="schema_name")cursor=conn.cursor()
  2. 执行查询

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

    # Check database connectionresults=cursor.is_connected()# List all catalogsrows=cursor.show_catalogs()# List all tablesrows=cursor.show_tables("catalog_name","schema_name")# Get number of rowsrows=cursor.table_stats(catalog="catalog_name",schema="schema_name",table="table_name")

了解更多信息

要了解doordahost的更多信息,请前往https://github.com/Doorda/Getting-Started

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Wildfly 8.2远程处理打开的通道太多   java如何为StringBuffer(“+”+“+”)分配内存   java从特定sql语句获取true(1)或false(0)   在Java中使用自定义权限   java Hashmap Json保存和加载   Android中的java地图视图   java如何获得正确的AWS可用性区域?   java从字符串中删除HashMap键   有没有一种简单的方法可以读取Java中的XML文件?   java ORMLite如何使用两个日期列进行查询,其中一个为空或小于另一个   使用java将带有动态字段的json文件反序列化到类中   当单元格包含空值时从excel获取数据的java   java在线程中实现runnable接口并使用此关键字   java为什么我会在这里遇到例外?