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 安装。

依赖和互操作性

  • 支持的 Python 版本:3.8 至 3.13 。

  • 支持的 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.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.2-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.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.2-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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.2-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.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.2-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.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.2-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

gbase8sdb-0.2.2-cp37-cp37m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbf9f1356e1f4d3fb6830de6eb3989e3558be714af5ac1a4b244addf2b0f0282
MD5 7b66a9abe2c9f753a810f78bf5dd69d2
BLAKE2b-256 2c2961f799428d9d0fd191e27712d5e28765b57e8927a90bd08306d376d957ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 d191025719d4eab1a5222a25d86e9cca1a503d10422f68ecef4414bf6f9c7d94
MD5 cfa30103b13bbcb3dff05706495d0cc7
BLAKE2b-256 82878a062ee51c75965946dd89fbb883376f1e03e52438c04976eebf56ab67b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c04bddf6adbabe8c03f40281515c5fe9c809a694dd8a9eaddc1c25b10cf8c4ca
MD5 4eced8a026975e0ae20ab54acf7a6ec9
BLAKE2b-256 d8f114ceed1123f8710122c0726456f0a23a284f5bc24d5b0d0f616a292e7e4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 f879f97fcb86c17a896fb76c842189e1b61f61b2d0fef871ca9b838498938c6d
MD5 e7ff78745e58b42c7282b53c61710b6d
BLAKE2b-256 d6336ca71bdd148374593d78e39883560b0a7ef1adf777be23fb203d3359c8e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53e412846239692c1fb67a2eafbc3b2eb21744f9acc8c42dde426ec2b6d93be3
MD5 0910e5f2329299c522a17ff9bce268f9
BLAKE2b-256 49d37ae8d1193317f5c97c87ba14f309321e67c812cf9b36eb0c98e7b1faf5d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 4d75b9d5cc895dc9d7f3ec724959da9ba1c59742a2dbd1edfa049440ddf4bb36
MD5 38c8afcdc6b478dedffd8689b57f86cc
BLAKE2b-256 0aac8501b1d09bd86eddc8b00c065144688962984fc97b4b7878f61daedd1229

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e979e095bbdefc9af64be33b4a8f0eafd29c7cefe2bcf05895f776d84c108799
MD5 0065066e84de6558350274eda3abb7b6
BLAKE2b-256 70495476b78c93288255708dd614f5541fd148f371b0f34d7ec7b6f29d24cc1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 062aab691ceaa177a18e0c2119543b94b4f9494c8fdccf4be9b49ded2395b715
MD5 542358a5027e20d6bd44b5a4be32ac9a
BLAKE2b-256 590cad83c07959839cd3e8561249b02ea652bf2d77fde5bcc88a1ab538e20b2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c08f8f02bac9ffe1cc4ac8533aa86bca8928ac749ccb8a679c4a4851bd98eab
MD5 2a9c3a0870cfbaf13eb5692cf6e91cb6
BLAKE2b-256 46845a749808c4ba3a62e54992175bade5ce4ae552b7e73d9c5adc45d489c4ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 a964a0fbf1c6c4df616f83f99e324132c569720290c74dacce3a53611b00b2bb
MD5 3c28c6a2c962446e8a098889e4610891
BLAKE2b-256 9a5e5a4a022de4f4b400cb23ee2e62ad9fb207e41cee60deeec396935ac177da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dafb93475ebad24fcfcc206bab755c07ddc3c127c3824137bc371200a8f024be
MD5 c9f4a6529ab02e202b934fa03322f4be
BLAKE2b-256 8d344323bf717b73daee60f9bd3013a74d87ca0f3a8f3041186b9887a153e135

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 b581b06c9f335aa47b6d8c19fd89e2d858983dfd8507c97dbb59adc30e700c4b
MD5 01fdc35f3af5dcca896455613605db10
BLAKE2b-256 2a5f7ca8a65b142e6e2e4bd8b4bf775f4b42a7edafe4a91e4dc59b63f8f62028

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe02ecaee3ac54649ad72e1ec3e585db86082b0f5256e7cd0edc476b99f7512d
MD5 d6532c768f860c042069e4da8c5214ce
BLAKE2b-256 4988392d56aaeb51fdaf1ac1a6fb2ab6c46cd370e20a374a8a16527ea3e4efd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbase8sdb-0.2.2-cp37-cp37m-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 405964a8d7d9f42ceafc90968b16d915dfde3e385273dafeab484a4426efae5c
MD5 c9c435093c605ba64f779e6db3a49a82
BLAKE2b-256 7a32137d0e51267b96b88b8682024f70a2737bb92e74d7a7cff55955498a9c4c

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