Skip to main content

Python interface to GBase 8s Database

Project description

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()

Project details


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.4-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.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

gbase8sdb-0.2.4-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.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

gbase8sdb-0.2.4-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.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

gbase8sdb-0.2.4-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.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

gbase8sdb-0.2.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

gbase8sdb-0.2.4-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.4-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

gbase8sdb-0.2.4-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.4-cp37-cp37m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

gbase8sdb-0.2.4-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

gbase8sdb-0.2.4-cp36-cp36m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ ARM64

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3bb107fce89476d1716dcd3cb7dae1f113a0f57cda8c224cb6ba9cedf6801ae0
MD5 fda16a15555f9a3e4c1e850461af74de
BLAKE2b-256 0131ee50b49b805f707ca963ab96d22663ce338128e204925ce5989aae26f928

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 e1fcbb047db0253f5668210909252196d1a745520be57006fb9b16e4797d5dea
MD5 0c0025b3f7d31bbcff30cbed852568fe
BLAKE2b-256 28e340a3532552a3c72c6affd058495abb68db4175484a423e358735d938f2d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 349e5ed9b9ebcebc02bc37bb9c4f66540a8c7aadc192da1240659d3dd171e361
MD5 9c475663c03a7785f4d3590651e194a5
BLAKE2b-256 a7c34c14bd50ba4528b51e354079c7e962ceffd005a5d28a3436c2f3aa8bf403

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 47d6cd5759e6afeebc3fdbf4046e5ec81926139782e2a8576742d3107a2ee70d
MD5 4621ef5eb5f229b35afb429961cab621
BLAKE2b-256 cb908e4735c21b395fb960f6bf3bb372a64b1906d38889f96060fc1d81c4589f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bfe2d447962b1d699fec4a3b27f443582c9c2da953186b6108f3d1542eed0699
MD5 28813c0c7b186bf985b29c57cf4d3a56
BLAKE2b-256 9aeb9d1f92124d807e6e0c033804dc6dece3458ea93275f995d90f250c71f9cc

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 3d389ffb7f7d98990d08fae0e5ed8cff4fbddd2598a80519b6117451fbbe9fdc
MD5 cf3fe9110944f87963dffbc2aebbb7af
BLAKE2b-256 e52217943cf258ad59d8593ab8b3c373add228320274d15a1f064f3ca409fbcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 75fc5a9ccaab704c337ad4d7554e8b5c191ab0c272539066507029838d3cab50
MD5 42a192d73fcf5b380a3ed9daaa6d9c41
BLAKE2b-256 60577168681d2bded16e985890849fa6174f1ec59d73ee517ff0af861efb3b85

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 8a53e24861df51e7befd945f318e87c1151ccca4caaadddf8a79e87280a094f8
MD5 9751a18f6afe66045426716a73a93e6e
BLAKE2b-256 c46a2630e035a1fe5acd4dda2cd4b67c7a0aa860d1e5b7dcf3e3f03bc02ec111

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3159bd23fc529ef7636772e7de49bec7e8cabaf4d352429c7d44661a28f4ca0f
MD5 f512c7704e6071e1a688b44a0c604f98
BLAKE2b-256 27cac10066b2b9983593360748e299600ad858c3693183e4178cdd37ab7bb631

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 2c552d1ebcc7876840c48f6296d1050d068c022458bd5ef70de2aade13ae1d84
MD5 895dba5ed8b96a5c35b97f5179720b38
BLAKE2b-256 30237def61efc7a9dabe3ca3892d60a48dc5d288e7bcb388f5b0d9567e915fc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 355c1c9a42c20c102815138480449a32939d3b56d9b4c94559595075b02f4bc9
MD5 052357e5e1d943f8dba9f5ae2c7f8e93
BLAKE2b-256 e29804a9ea70064253035cecb02f4ca37bb2e62619f2a37b2dd98e2d73ed3c7d

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 22d830bf71be6189bf604dfc00e35ba48d2814075a5c0a5b7b1ba773660b20c8
MD5 bcc91fba97b8a659f5986ef251af21d4
BLAKE2b-256 b40adeac166d1fc8a0a4863782ad1a4d9c4d5d783919cff0f0d2c6b8b1d6be4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp37-cp37m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a1469e5968786f6d5a66fe63dd65a25d57ccb68f7db696013074c5d55d226c80
MD5 d35ebe351babe417df4135f5d03eb83a
BLAKE2b-256 f9fa54c744854c12c4816295ba5be0e3cb447bba33b40c5bfadeee998fae0552

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp37-cp37m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp37-cp37m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 d194a984532f07b6b6e0efcf40cfe17df9532c75a1e9cdf02485e93ee41bfc01
MD5 c2d88a934f3c3d2edc3738648d3c1972
BLAKE2b-256 7320525096819d76f77f9cf8e19045bf07383333fb2b1ff65b6e3ff906da9fce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp36-cp36m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 19efb172d591a03a270d05b5cd87e33495d6f015cd5f3f29b1a5044fadc3e619
MD5 e09acc36a6b0bddeb3d95e5a1f03eda5
BLAKE2b-256 91663add0394fc4d8cef7b62ef94c5f3d844c7730574cf70189bf10ead445da6

See more details on using hashes here.

File details

Details for the file gbase8sdb-0.2.4-cp36-cp36m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for gbase8sdb-0.2.4-cp36-cp36m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 de0f947046c5ed6b1906e6bcf14a1dcdd07ccfc0812dfe0c360f4f16062369f4
MD5 30d3419007990633a7f2de75b34c4f0b
BLAKE2b-256 d77bf40cce0f75f6917da71297aa260ced052bc9ea9999369f89dbcfb5de29ed

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