简体   繁体   English

“sqlite”和“pysqlite2/sqlite3”模块有什么区别?

[英]What is a difference between “sqlite” and “pysqlite2/sqlite3” modules?

I gave up to make "sqlite3" working but I just found out (with help("modules")) that I have "sqlite" module.我放弃了让“sqlite3”工作,但我刚刚发现(在帮助(“模块”)下)我有“sqlite”模块。 I tested it (create table, insert some values and so on) and it works fine.我测试了它(创建表,插入一些值等等)并且它工作正常。 But before I start to use this module I would like to know if it has some significant limitations in comparison with sqlite3 module?但是在我开始使用这个模块之前,我想知道它与 sqlite3 模块相比是否有一些明显的限制? Can anybody, pleas, give me advise?任何人都可以请给我建议吗?

Thank you in advance.先感谢您。

As per this wiki , you can ask your module exactly what version it is, eg:根据这个 wiki ,您可以询问您的模块到底是什么版本,例如:

>>> import sqlite
>>> sqlite.version
'1.0.1'
>>> sqlite._sqlite.sqlite_version()
'2.8.16'

So what versions numbers do you see when you try this?那么当你尝试这个时你会看到什么版本号?

A list of release note links from pysqlite version 2.3.4 to 2.5.5 (about 2 years' worth of releases) is available here -- so if you were using the 2.3.2 embedded in the sqlite3 that comes with Python 2.5 or the 2.4.1 that comes with Python 2.6 you could trace exactly what features, optimizations and bug fixes you might be missing (a long list).此处提供从 pysqlite 版本 2.3.4 到 2.5.5(大约 2 年的发行版)的发行说明链接列表——因此,如果您使用的是嵌入在 Python 2.5 或 Python 2.5 附带的 sqlite3 中的 2.3.2 Python 2.6 附带的 2.4.1 您可以准确地跟踪您可能缺少的功能、优化和错误修复(一个长列表)。 But 1.0.1 is SO far back that I don't know where to find a further list of changes from there to 2.3.2!但是 1.0.1 太早了,我不知道在哪里可以找到从那里到 2.3.2 的进一步更改列表! Looks like a job for an archeologist...;-).看起来像是考古学家的工作......;-)。

I've seen a pysqlite tutorial here ;我在这里看过一个 pysqlite 教程; full docs (LaTex sources) here ;完整文档(LaTex 来源) 在这里 good luck!祝你好运!

I just install sqlite, and 'import sqlite3' works but not 'import sqlite'.我只安装了 sqlite,'import sqlite3' 可以工作,但不能'import sqlite'。 You can use sqlite3.sqlite_version to find the package version.您可以使用 sqlite3.sqlite_version 来查找包版本。 Thus因此

$ pip install sqlite==3.33.0
$ python
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.33.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM