I've been looking around and reading, and I have a few more questions
about SQLite in particular, as it relates to Python.
1. What is the current module to use for sqlite? sqlite3? or is that not
out until Python 2.5?
2. What's the difference between sqlite and pysqlite? Do you need both,
just one, or is one an older version of the same thing?
3. What's the difference between the command line program called sqlite3
and the module you would use with Python? (I know that the former let's
you do normal database things without dealing with Python, but is it
necessary if you are using Python to interact with the DB?)
Thanks! 12 2371
2. What's the difference between sqlite and pysqlite? Do you need both,
just one, or is one an older version of the same thing?
To access your database from python you need both (or some alternative
to pysqlite)
3. What's the difference between the command line program called sqlite3
and the module you would use with Python? (I know that the former let's
you do normal database things without dealing with Python, but is it
necessary if you are using Python to interact with the DB?)
slqite comes with a library which other programs can call, and a
command line interface
that you can use from the shell. pysqlite needs the library but I
don't think it is possible
to get one without the other.
Regards,
Andy an**************@yahoo.co.uk wrote:
>2. What's the difference between sqlite and pysqlite? Do you need both, just one, or is one an older version of the same thing?
To access your database from python you need both (or some alternative
to pysqlite)
I can understand this in terms of MySQL being one thing, and mysqldb
being the necessary module for Python to use MySQL. But in 2.5, for
example, which comes with sqlite3, is this all you need, or do you still
need pysqlite? Or are these two different things that can access the
sqlite system? (I guess I kind of thought there would be just one
standard module used for each type of database, such as mysqldb being
the one used for MySQL.)
John Salerno wrote:
an**************@yahoo.co.uk wrote:
2. What's the difference between sqlite and pysqlite? Do you need both,
just one, or is one an older version of the same thing?
To access your database from python you need both (or some alternative
to pysqlite)
I can understand this in terms of MySQL being one thing, and mysqldb
being the necessary module for Python to use MySQL. But in 2.5, for
example, which comes with sqlite3, is this all you need, or do you still
need pysqlite? Or are these two different things that can access the
sqlite system? (I guess I kind of thought there would be just one
standard module used for each type of database, such as mysqldb being
the one used for MySQL.)
Your confusion is quite understandable. I started looking at sqlite
when the announcement that it would be included in Python 2.5 came out.
Puzzlement reigned. I ended up with the following up the front of my
experimental module:
import sys
PY_VERSION = sys.version_info[:2]
if PY_VERSION >= (2, 5):
import sqlite3
else:
from pysqlite2 import dbapi2 as sqlite3
print "Python :", sys.version
print "pysqlite:", sqlite3.version
print "sqlite :", sqlite3.sqlite_version
Interestingly, at the time pysqlite2 was providing a version of the
underlying C library that was 2.4-compatible but *later* than the
version that came with 2.5a2 [I haven't checked since].
So, if you want to try out sqlite now, download pysqlite2 and use it
with Python 2.4. If you have the 2.5 release candidate, you can try
your code with it as well, using version-detecting code along the above
lines.
I would strongly recommend for a learner of SQL and the Python DBAPI:
(1) start with sqlite; it's great, and there's minimal admin involved
(2) download the command-line utility from the sqlite website -- you'll
need it for the minimal admin, plus it's handy for quick one-line SQL
statements, peeking at the schema, etc.
HTH,
John
"John Machin" <sj******@lexicon.netwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
I would strongly recommend for a learner of SQL and the Python DBAPI:
(1) start with sqlite; it's great, and there's minimal admin involved
(2) download the command-line utility from the sqlite website -- you'll
need it for the minimal admin, plus it's handy for quick one-line SQL
statements, peeking at the schema, etc.
I've also become a big fan of sqlite. For a nice open source db gui
utility, download a copy of SQLite Database browser at http://sqlitebrowser.sourceforge.net.
-- Paul
John Machin wrote:
Your confusion is quite understandable. I started looking at sqlite
when the announcement that it would be included in Python 2.5 came out.
Puzzlement reigned. I ended up with the following up the front of my
experimental module:
So does this mean that when 2.5 is released, all I need is the built-in
module sqlite3?
John Salerno wrote:
John Machin wrote:
Your confusion is quite understandable. I started looking at sqlite
when the announcement that it would be included in Python 2.5 came out.
Puzzlement reigned. I ended up with the following up the front of my
experimental module:
So does this mean that when 2.5 is released, all I need is the built-in
module sqlite3?
Plus the command-line utility, which AFAICT is not included with Python
2.5.
John Machin wrote:
John Salerno wrote:
>John Machin wrote:
>>Your confusion is quite understandable. I started looking at sqlite when the announcement that it would be included in Python 2.5 came out. Puzzlement reigned. I ended up with the following up the front of my experimental module:
So does this mean that when 2.5 is released, all I need is the built-in module sqlite3?
Plus the command-line utility, which AFAICT is not included with Python
2.5.
Why? The sqlite3 module links to the library; it doesn't need a separate
executable. Or is that what you meant (since one generally never installs the
library without also installing the executable, too)?
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
Dennis Lee Bieber wrote:
SQLite, in whatever incarnation, is a "file server" database. There
is no separate database server running -- each application is linked
directly to the code that opens and processes the database file(s).
If SQLite is supplied with the impending Python 2.5, then the
code/library to access the database file is included. If one is running
Python 2.4, then one needs to obtain the third-party pysqlite package --
which, as I recall, includes the runtime library that does the database
file work.
The only reason, then, to download the stand-alone SQLite package
(not the python package) would be to obtain the command line query/admin
tool.
Thanks, that was a great response that pretty much covered everything I
was wondering. I would need pysqlite right now (2.4), or sqlite3 (2.5),
and I don't necessarily need the command line program if I'm using
Python as an interface.
What is really confusing is that I did a search for 'sqlite' in my
Ubuntu repositories and it came up with entries like this:
python2.4-pysqlite1.1 python interface to SQLite 3
python2.4-pysqlite2 python interface to SQLite 3
python2.4-pysqlite python interface to SQLite 2
python-pysqlite1.1 python interface to SQLite 3
python-pysqlite2 python interface to SQLite 3
python-sqlite python interface to SQlite 2
Needless to say, the numbering had me banging my head against my desk.
Robert Kern wrote:
John Machin wrote:
John Salerno wrote:
John Machin wrote:
Your confusion is quite understandable. I started looking at sqlite when the announcement that it would be included in Python 2.5 came out. Puzzlement reigned. I ended up with the following up the front of my experimental module:
So does this mean that when 2.5 is released, all I need is the built-in
module sqlite3?
Plus the command-line utility, which AFAICT is not included with Python
2.5.
Why? The sqlite3 module links to the library; it doesn't need a separate
executable. Or is that what you meant (since one generally never installs the
library without also installing the executable, too)?
Hi, Robert,
Sorry if that and the earlier message were unclear. The Python module
does Python DPAPI without any help from the standalone executable.
AFAICT (so far) the standalone executable also links to the library; it
provides a command-line interface to most/all the underlying sqlite
functionality. This is my understanding, but as stated earlier, I
haven't been playing with it for long, and maybe the Python module goes
way beyond DBAPI and I haven't stumbled on the extra goodies yet.
Regards,
John
Dennis Lee Bieber wrote:
>
The only reason, then, to download the stand-alone SQLite package
(not the python package) would be to obtain the command line query/admin
tool.
Pre-compiles binaries of the tool are available for Linux and Windows. http://www.sqlite.org/download.html
Cheers,
John
John Salerno <jo******@NOSPAMgmail.comwrites:
What is really confusing is that I did a search for 'sqlite' in my
Ubuntu repositories and it came up with entries like this:
python2.4-pysqlite1.1 python interface to SQLite 3
python2.4-pysqlite2 python interface to SQLite 3
python2.4-pysqlite python interface to SQLite 2
That's python2.4-sqlite, not python2.4-pysqlite. The reason for both
having pythonX.Y-foo and python-foo packages is Debian's (and
therefore Ubuntu's) Python package policy.
python-pysqlite1.1 python interface to SQLite 3
python-pysqlite2 python interface to SQLite 3
python-sqlite python interface to SQlite 2
Needless to say, the numbering had me banging my head against my
desk.
Sorry to hear that, and I can understand that the names are a bit
confusing.
Here's the story behind the mess:
In the beginning (well, at least in 2003 when I found out about
SQLite), SQLite was up to version 2.something and the Python module
was called sqlite.py. While the Python module *project* was called
pysqlite 0.something, Debian modules were generally called python-foo
when providing the module foo; hence the name python-sqlite.
Then, SQLite 3 was released (incompatible with SQLite 2 databases),
and pysqlite 1.1 was released with the same module name (sqlite.py)
and API as the old sqlite.py module but linked against SQLite 3. I
decided not to package that version but instead wait for pysqlite 2, a
rewritten and improved version linked against SQLite 3 and with a new
Python API.
pysqlite 2 was released and the Python module was called
pysqlite2.dbapi2. I didn't think python-sqlite3 would be a good name
for the Debian package since there were actually two different
pysqlite versions (both actively maintained) linked against SQLite3,
so I ended up calling the package python-pysqlite2, following the name
and version of the pysqlite project instead of the module.
Finally, by request of Debian users, I also packaged the other
pysqlite version linked against SQLite 3 giving the package
python-pysqlite1.1.
Oh, and then there's python-apsw too. :-)
Regards,
Joel (maintainer of Debian's Python-related sqlite packages)
--
Joel Rosdahl <jo**@rosdahl.net>
Key BB845E97; fingerprint 9F4B D780 6EF4 5700 778D 8B22 0064 F9FF BB84 5E97
Joel Rosdahl wrote:
John Salerno <jo******@NOSPAMgmail.comwrites:
>What is really confusing is that I did a search for 'sqlite' in my Ubuntu repositories and it came up with entries like this:
python2.4-pysqlite1.1 python interface to SQLite 3 python2.4-pysqlite2 python interface to SQLite 3 python2.4-pysqlite python interface to SQLite 2
That's python2.4-sqlite, not python2.4-pysqlite. The reason for both
having pythonX.Y-foo and python-foo packages is Debian's (and
therefore Ubuntu's) Python package policy.
>python-pysqlite1.1 python interface to SQLite 3 python-pysqlite2 python interface to SQLite 3 python-sqlite python interface to SQlite 2
Needless to say, the numbering had me banging my head against my desk.
Sorry to hear that, and I can understand that the names are a bit
confusing.
Here's the story behind the mess:
In the beginning (well, at least in 2003 when I found out about
SQLite), SQLite was up to version 2.something and the Python module
was called sqlite.py. While the Python module *project* was called
pysqlite 0.something, Debian modules were generally called python-foo
when providing the module foo; hence the name python-sqlite.
Then, SQLite 3 was released (incompatible with SQLite 2 databases),
and pysqlite 1.1 was released with the same module name (sqlite.py)
and API as the old sqlite.py module but linked against SQLite 3. I
decided not to package that version but instead wait for pysqlite 2, a
rewritten and improved version linked against SQLite 3 and with a new
Python API.
pysqlite 2 was released and the Python module was called
pysqlite2.dbapi2. I didn't think python-sqlite3 would be a good name
for the Debian package since there were actually two different
pysqlite versions (both actively maintained) linked against SQLite3,
so I ended up calling the package python-pysqlite2, following the name
and version of the pysqlite project instead of the module.
Finally, by request of Debian users, I also packaged the other
pysqlite version linked against SQLite 3 giving the package
python-pysqlite1.1.
Oh, and then there's python-apsw too. :-)
Regards,
Joel (maintainer of Debian's Python-related sqlite packages)
Yikes! Well at least it gets simpler when 2.5 is released with the
module built-in! :) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David Fowler |
last post by:
I'm new to getting in touch with other PHP users/PHP team, so please excuse
me if this post is at all inappropriate or in the wrong place. In the
current release of PHP (5.1.4) and in the CVS for...
|
by: Jim Carlock |
last post by:
I added the following lines to PHP.INI.
extension=php_pdo.dll
extension=php_pdo_sqlite.dll
extension=php_sqlite.dll
specifically in that order. I noticed the extensions getting loaded
are...
|
by: Brian Blais |
last post by:
Hello,
I have more of a conceptual question about the way databases work, in a web
framework, but I will be implementing things with CherryPy and SQLAlchemy. If you
make a web form that adds...
|
by: 7stud |
last post by:
Does sqlite come in a mac version?
Thanks.
|
by: Luigi |
last post by:
Hello all!
I'm a newbie in PHP. I have written a short script that tries to
update a SQLite database with the user data. It is pretty simple,
something like this:
<?php
$sqlite =...
|
by: Gilles Ganault |
last post by:
Hello
I was looking for a lighter web server than Apache, and
installed Lighttpd on CentOS through yum. It works fine, but I now
need to use SQLite from a PHP script. I seem to understand that...
|
by: Gilles Ganault |
last post by:
Hello
I need to compile PHP5 with SQLite statically and without PDO.
I don't need DB-independence, so it's fine using sqlite_*() functions
instead of PDO.
1. I've downloaded, compiled, and...
|
by: Daniel Fetchinson |
last post by:
Does Python 2.5.2's embedded SQLite support full text searching?
Sqlite itself is not distributed with python. Only a python db api
compliant wrapper is part of the python stdlib and as such it...
|
by: timotoole |
last post by:
Hi all,
On a (sun) webserver that I use, there is python 2.5.1 installed. I'd
like to use sqlite3 with this, however sqlite3 is not installed on the
webserver. If I were able to compile sqlite...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: DizelArs |
last post by:
Hi all)
Faced with a problem, element.click() event doesn't work in Safari browser.
Tried various tricks like emulating touch event through a function:
let clickEvent = new Event('click', {...
| |