BioSQL.DBUtils 模組

Biopython 的 BioSQL 程式碼的輔助程式碼(供內部使用)。

class BioSQL.DBUtils.Generic_dbutils

基底類別:object

預設的資料庫工具。

__init__()

建立一個 Generic_dbutils 物件。

tname(table)

傳回表格的名稱。

last_id(cursor, table)

傳回表格最後使用的 ID。

execute(cursor, sql, args=None)

僅執行一個 SQL 命令。

executemany(cursor, sql, seq)

執行多個 SQL 命令。

autocommit(conn, y=1)

在資料庫連線上設定自動提交。

class BioSQL.DBUtils.Sqlite_dbutils

基底類別:Generic_dbutils

針對 SQLite 的自訂資料庫工具。

execute(cursor, sql, args=None)

執行 SQL 命令。

在 sqlite3 中將 %s 替換為 ? 以進行變數替換。

executemany(cursor, sql, seq)

執行多個 SQL 語句。

class BioSQL.DBUtils.Mysql_dbutils

基底類別:Generic_dbutils

針對 MySQL 的自訂資料庫工具。

last_id(cursor, table)

傳回表格最後使用的 ID。

class BioSQL.DBUtils.Psycopg2_dbutils

基底類別:_PostgreSQL_dbutils

針對 Psycopg2 (PostgreSQL) 的自訂資料庫工具。

autocommit(conn, y=True)

在資料庫連線上設定自動提交。

class BioSQL.DBUtils.Pgdb_dbutils

基底類別:_PostgreSQL_dbutils

針對 Pgdb (又名 PyGreSQL,適用於 PostgreSQL) 的自訂資料庫工具。

autocommit(conn, y=True)

在資料庫連線上設定自動提交。目前未實作。

BioSQL.DBUtils.get_dbutils(module_name)

傳回資料庫驅動程式的正確 dbutils 物件。