473,732 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

couple more questions about sqlite

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!
Aug 18 '06 #1
12 2485
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

Aug 18 '06 #2
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.)
Aug 18 '06 #3
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_inf o[: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

Aug 18 '06 #4
"John Machin" <sj******@lexic on.netwrote in message
news:11******** **************@ 74g2000cwt.goog legroups.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
Aug 19 '06 #5
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?
Aug 19 '06 #6

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.

Aug 19 '06 #7
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
experimenta l 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

Aug 19 '06 #8
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.
Aug 19 '06 #9

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

Aug 19 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2578
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 PHP5.1.* and 5.2.* the SQLite source version only stands at 3.2.8, while the actual realease is now at 3.3.6. What I was wondering is whether or not this could be updated, as there have been numerous bug fixes in the SQLite source in the past 6...
4
8024
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 alphabetally listed, so I'm thinking that the order of the load doesn't matter.
3
2557
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 rows to a database, and use sqlite as the engine, is there a danger of a race condition if several users at the same time try to submit the form? I want a unique row id, and make a unique identifier for the submissions. Am I in danger of having...
14
2976
by: 7stud | last post by:
Does sqlite come in a mac version? Thanks.
10
7561
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 = sqlite_open("mytest.db", 0666, $sqlite_error);
9
7094
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 it can either be access directly, or through the PDO interface. Can you confirm that the RPM that I used will only allow me to work through PDO, and not the SQLite library directly, and which is more recommended?
8
3414
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 installed sqlite.org/sqlite-3.5.4.tar.gz, and... 2. used "--with-sqlite --disable-pdo", but it fails.
3
275
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 is completely independent of the sqlite build. In other words, if your sqlite build supports full text searching you can use it through the python sqlite wrapper (that is part of the stdlib) and if it doesn't then not. This is true for any sqlite...
20
3970
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 using a sun machine (I normally use linux machines) and place this in my lunix home account would I be able to use python and sqlite? Any thoughts? I know its a bit of a stretch ...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.