Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to fallback to pysqlite2.dbapi2 as sqlite3 in core.history #2718

Merged
merged 1 commit into from Jan 20, 2013

Conversation

skyl
Copy link
Contributor

@skyl skyl commented Dec 24, 2012

for situations where Python is built without sqlite3 and
can not easily be changed, it would be nice to still be
able to get history with pysqlite2.

for situations where Python is built without sqlite3 and
can not easily be changed, it would be nice to still be
able to get history with pysqlite2.
@@ -20,7 +20,10 @@
try:
import sqlite3
except ImportError:
sqlite3 = None
try:
from pysqlite2 import dbapi2 as sqlite3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have guaranties that the api will be the same ?

I don't like importing as sqlite3 as later you don't know that sqlite3 is not effectively sqlite3

Maybe importing both as history_db and change sqlite3 references across all file ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The database API is supposed to be consistent, so I think importing as
sqlite3 is OK. Changing the name across the file would make the code harder
to read, and leaves more chances for bugs to sneak in.

Skylar, have you tested it with pysqlite2, both manually and by running
iptest?

On 24 December 2012 11:46, Bussonnier Matthias notifications@github.comwrote:

In IPython/core/history.py:

@@ -20,7 +20,10 @@
try:
import sqlite3
except ImportError:

  • sqlite3 = None
  • try:
  •    from pysqlite2 import dbapi2 as sqlite3
    

Do we have guaranties that the api will be the same ?

I don't like importing as sqlite3 as later you don't know that sqlite3 is
not effectively sqlite3

Maybe importing both as history_db and change sqlite3 references across
all file ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/2718/files#r2497725.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disabled sqlite3 and ran iptest, and played around interactively, and this seems to work just fine.

@Carreau
Copy link
Member

Carreau commented Jan 20, 2013

Merging as this seem to be ok.

Carreau added a commit that referenced this pull request Jan 20, 2013
try to fallback to pysqlite2.dbapi2 as sqlite3 in core.history
@Carreau Carreau merged commit 42886e3 into ipython:master Jan 20, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
try to fallback to pysqlite2.dbapi2 as sqlite3 in core.history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants