資料持久性 (Data Persistence)
*****************************

本章節所描述的模組支援將 Python 資料以持久形式儲存在磁碟上。"pickle"
和 "marshal" 模組可以將許多 Python 資料型別轉換為位元串流，然後再從位
元串流重建物件。各種與 DBM 有關的模組支援一系列基於雜湊的檔案格式，用
來儲存字串對字串的對映。

本章節所描述的模組列表為：

* "pickle" --- Python 物件序列化

  * 和其他 Python 模組的關係

    * 和 "marshal" 的比較

    * 和 "json" 的比較

  * 資料串流格式

  * 模組介面

  * 哪些物件能或不能被封裝、拆封？

  * Pickling 類別實例

    * 外部物件持久化

    * 調度表

    * 處裡紀錄大量狀態的物件

  * 針對型別、函式或特定物件定製縮減函式

  * 帶外（Out-of-band）資料緩衝區

    * 供給者 API

    * 消費者 API

    * 範例

  * 限制全域物件

  * 效能

  * 範例

* "copyreg" --- 註冊 "pickle" 支援函式

  * 範例

* "shelve" --- Python object persistence

  * Restrictions

  * 範例

* "marshal" --- 內部 Python 物件序列化

* "dbm" --- Unix "databases" 的介面

  * "dbm.sqlite3" --- dbm 的 SQLite 後端

  * "dbm.gnu" --- GNU 資料庫管理器

  * "dbm.ndbm" --- 新資料庫管理器

  * "dbm.dumb" --- 可攜式 DBM 實作

* "sqlite3" --- SQLite 資料庫的 DB-API 2.0 介面

  * 教學

  * Reference

    * Module functions

    * Module constants

    * Connection 物件

    * Cursor 物件

    * Row 物件

    * Blob 物件

    * PrepareProtocol 物件

    * 例外

    * SQLite and Python types

    * Default adapters and converters (deprecated)

    * 命令列介面

  * How-to guides

    * How to use placeholders to bind values in SQL queries

    * How to adapt custom Python types to SQLite values

      * How to write adaptable objects

      * How to register adapter callables

    * How to convert SQLite values to custom Python types

    * Adapter and converter recipes

    * How to use connection shortcut methods

    * How to use the connection context manager

    * How to work with SQLite URIs

    * How to create and use row factories

    * 如何處理非 UTF-8 的文字編碼

  * 解釋

    * Transaction control

      * Transaction control via the "autocommit" attribute

      * Transaction control via the "isolation_level" attribute
