Skip to main content

python-gbase8sdb

python-gbase8sdb 是一个 [Python 编程语言][python] 扩展模块,允许 Python 程序连接到 GBase 8s 数据库。

该模块符合 [Python 数据库 API 2.0 规范][pep249],并且包含大量扩展和少数排除项。

安装

运行 python -m pip install gbase8sdb 安装。

依赖和互操作性

  • 支持的 GBase 8s 数据库版本:GBase 8s V8.8_3.6.2版本及以上。

  • 支持的操作系统:Linux x86_64、 Windows 64位操作系统 。

  • 依赖 GSDK 1.1 版本。

使用说明

  1. gbase8sdb驱动连接数据库依赖GSDK,所以您需要联系GBase 8s技术支持或通过官方渠道获取相应版本的GSDK,并安装到您的机器上, 并设置如下环境变量:
  • Linux系统:
GSDK_PATH=/path/to/gsdk
export LD_LIBRARY_PATH=${GSDK_PATH}/lib:$LD_LIBRARY_PATH
export GBASEDBTDIR=${GSDK_PATH}/lib
  • Windows系统:
GSDK_PATH=\path\to\gsdk
set PATH=%GSDK_PATH%\lib;%PATH%
set GBASEDBTDIR=%GSDK_PATH%\lib

入门

在您的Python应用程序中,可以通过以下方式连接到数据库:

import gbase8sdb

# 生成dsn
dsn = gbase8sdb.makedsn(
    server_name="ol_gbasedbt1210_2",    # 数据库实例名称
    db_name="testdbutf8",               # 数据库名称
    host="192.168.xxx.xxx",             # 数据库实例所在服务器的IP地址或域名
    port=9088,                          # 数据库实例的端口号
    db_locale='zh_CN.utf8'              # 数据库字符集
)
user = "gbasedbt"                       # 数据库用户名
password = "xxxxxx"                     # 数据库用户密码

# 连接数据库
conn = gbase8sdb.connect(dsn, user, password) 
# 创建游标  
cursor = conn.cursor()  
# 执行SQL语句                       
cursor.execute("drop table if exists t")
cursor.execute("create table t (id int, name varchar(20))")
cursor.execute("insert into t values (?, ?)", (1, "zhangsan"))
cursor.execute("select * from t")
# 获取查询结果
print(cursor.fetchall())
# 关闭游标和连接
cursor.close()
conn.close()

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.

gbase8sdb-0.2.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.5-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.5-cp37-cp37m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.5-cp36-cp36m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

File details

Details for the file gbase8sdb-0.2.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 60e865d4d7be5519170406105987907828cba5cf8b6c83ec506f157cd9f1a155
MD5 0e3b352e867fecb406da6b11e545993f
BLAKE2b-256 284693bd76d4e4b0665244d3384e38b05e44385d661fcfcd874a098f8b6016e2

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dbfa26c204e645a10f11d05eb39dab344664d716a5c9611de1d0c991271b5c5d
MD5 588d0f58b3898b8ded37cefe7ae110e3
BLAKE2b-256 0ae62aff6a733069b024f6934e23f824ee78afd6470584c3973555fc61d9c35e

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ea8e68df37506cdda981573f3a758e99aca97183df5e0c3e2689279a58718b29
MD5 e40c589dba73c07775cad854a0be16e3
BLAKE2b-256 cf5531d3a6fb291524f284af7a608d9a3e7148b923e92bc5d762563cc83f045b

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4ff88d1a0331ccb0f84cd0345db1c1c1fdce2524d3466bdf974a7cae9ad1c59c
MD5 7fe3b39c960c2e679f777fa0b0b29495
BLAKE2b-256 ac1caf2fb9d4e159c6280d2af4ee20a25adceb593d922131c9405a5f062230a2

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.5-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.5-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8b3dbbfdd8a8a55890a7dc955142d895ba6d149a42ca89156a7bc69b458a4e09
MD5 57a1f3cd1b4bb4c230e4b27f65c4355f
BLAKE2b-256 c6bccaa59b9cd5241226f0e288049d6f7735535c6d5a7ead1c9de4bef6210c0d

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.5-cp37-cp37m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.5-cp37-cp37m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c2f020f905cf330b6f2256f5767661c5c9c3b1104e0061f3a01dfa2b3e87e176
MD5 3d49b400ba0b8095ec64116e95af5d9c
BLAKE2b-256 7c51a3442d1304bbc7313462fb20ce0c2b4e5fda122698778ca5b64f4e9be3e6

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.5-cp36-cp36m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.5-cp36-cp36m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fe7502a2651efc3b9d50b814a051a4f5bac04e4948ce497471893f522068328f
MD5 cbd0f1517dd38464dcc8ed7f70a4b9cb
BLAKE2b-256 77ec028e1c2e4be65978fab1828c7772aaa8b885a98990c5e889bee987d053f7

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