代码之家  ›  专栏  ›  技术社区  ›  thinwybk

如何在Ubuntu上使用sqlite3v3.7api?

  •  1
  • thinwybk  · 技术社区  · 6 年前

    sqlite3 数据库 existing_db.db :memory: 使用 sqlite3.Connection.backup() ? backup() 适用于SQLite 3.6.11或更高版本。3.7版中的新增功能。如果我运行下面的代码

    import sqlite3
    
    source = sqlite3.connect('existing_db.db')
    dest = sqlite3.connect(':memory:')
    source.backup(dest)
    

    我知道错误了 AttributeError: 'sqlite3.Connection' object has no attribute 'backup' . 我怎么做 备份() 工作?我的设置是ubuntu18.04。

    $ python3
    Python 3.6.6 (default, Sep 12 2018, 18:26:19) 
    [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sqlite3
    >>> sqlite3.version
    '2.6.0'
    >>> sqlite3.sqlite_version
    '3.22.0'
    
    0 回复  |  直到 6 年前
    推荐文章