数据持久化¶
本章中描述的模块支持在磁盘上以持久形式存储 Python 数据。 pickle
和 marshal
模块可以将许多 Python 数据类型转换为字节流,然后从字节中重新创建对象。 各种与 DBM 相关的模块支持一系列基于散列的文件格式,这些格式存储字符串到其他字符串的映射。
本章中描述的模块列表是:
pickle
--- Python 对象序列化copyreg
--- 注册配合pickle
模块使用的函数shelve
--- Python 对象持久化marshal
--- 内部 Python 对象序列化dbm
--- Unix "数据库" 接口sqlite3
--- SQLite 数据库 DB-API 2.0 接口模块- 教程
- 参考
- 模块函数
- 模块常量
LEGACY_TRANSACTION_CONTROL
PARSE_COLNAMES
PARSE_DECLTYPES
SQLITE_OK
SQLITE_DENY
SQLITE_IGNORE
apilevel
paramstyle
sqlite_version
sqlite_version_info
threadsafety
version
version_info
SQLITE_DBCONFIG_DEFENSIVE
SQLITE_DBCONFIG_DQS_DDL
SQLITE_DBCONFIG_DQS_DML
SQLITE_DBCONFIG_ENABLE_FKEY
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
SQLITE_DBCONFIG_ENABLE_QPSG
SQLITE_DBCONFIG_ENABLE_TRIGGER
SQLITE_DBCONFIG_ENABLE_VIEW
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
SQLITE_DBCONFIG_RESET_DATABASE
SQLITE_DBCONFIG_TRIGGER_EQP
SQLITE_DBCONFIG_TRUSTED_SCHEMA
SQLITE_DBCONFIG_WRITABLE_SCHEMA
- 连接对象
Connection
Connection.cursor()
Connection.blobopen()
Connection.commit()
Connection.rollback()
Connection.close()
Connection.execute()
Connection.executemany()
Connection.executescript()
Connection.create_function()
Connection.create_aggregate()
Connection.create_window_function()
Connection.create_collation()
Connection.interrupt()
Connection.set_authorizer()
Connection.set_progress_handler()
Connection.set_trace_callback()
Connection.enable_load_extension()
Connection.load_extension()
Connection.iterdump()
Connection.backup()
Connection.getlimit()
Connection.setlimit()
Connection.getconfig()
Connection.setconfig()
Connection.serialize()
Connection.deserialize()
Connection.autocommit
Connection.in_transaction
Connection.isolation_level
Connection.row_factory
Connection.text_factory
Connection.total_changes
- 游标对象
- Row 对象
- Blob 对象
- PrepareProtocol 对象
- 异常
- SQLite 与 Python 类型
- 默认适配器和转换器(已弃用)
- 命令行接口
- 常用方案指引
- 说明