Out of the box database support

Alex Biddle heuristic at gmail.com
Mon Jul 3 17:48:17 EDT 2006


On 7/3/06, Paul McGuire <ptmcg at austin.rr._bogus_.com> wrote:
> "Alex Biddle" <heuristic at gmail.com> wrote in message
> news:mailman.7731.1151943001.27775.python-list at python.org...
> > Hey, thanks for the reply Jean-Paul.
> >
> > That's pretty cool knowing that Python 2.5 will have it out of the
> > box, however what about basic out-of-the-box functionality in 2.4 (or
> > even older)?
> >
> > In all my other experiences Python comes with a lot of tools already
> > available, it seems odd not to have basic database functionality
> > installed as default.
> >
>
> Would you like a pony with that?  pysqlite *is* available today, and is not
> overly onerous to install or bundle with your own package.  And on the near
> horizon, we see that it *will* be part of the included batteries, so
> separate installation is only a temporary nuisance.
>
> But there is another database battery available in current Python versions.
> Try this:
>
> import bsddb
>
>
> No SQL support, instead this gives you a dict-like access to the database
> (values must be strings, so you have to serialize columns into something
> like XML, JSON, YAML, etc.):
>
> import bsddb
> db = bsddb.hashopen("testdb.db")
> db["Paul"]="""<user name="Paul" id="12345"/>"""
> db["Alex"]="""<user name="Alex" id="12346"/>"""
> print db.keys()
> del db["Paul"]
> print db.keys()
> db.close()
>
>


Thanks for the info. No thanks for the smarmy "pony" comment. I can't
install my own version because I'm on a shared server, of course
ideally I wouldn't like to be.


On 7/3/06, Shane Hathaway <shane at hathawaymix.org> wrote:
> Alex Biddle wrote:
> > Ah, so separate downloads then. At least now I know.
> >
> > Ergh... I checked the version of Python my current host is running and its 2.2.
> >
> > ...ergh....
>
> This is why you really want a VPS (virtual private server).  The cost is
> similar to a web host but you get to choose your own technologies and
> versions.  Several companies come to mind:
>
> http://westhost.com/
> http://jvds.com/
> http://linode.com/
>
> I'm using Westhost, which provides Python 2.2 if you ask for it, but I
> compiled Python 2.4 instead.  I didn't even have to ask whether I was
> allowed to do that. :-)
>
> Shane
>
>

Yeah, ideally a VPS would be the way to go. In the US hosting seems to
be cheaper than here in the UK, I don't know why. If I was going to
make a Python web app then I would go VPS, nowadays though I just make
do with PHP.


On 3 Jul 2006 09:45:35 -0700, BartlebyScrivener <rpdooling at gmail.com> wrote:
> I guess you looked here without finding what you want?
>
> http://www.python.org/doc/topics/database/
>
> What's the big deal with "out of the box"? People have different tastes
> in dbs and ways to access them, why not just pick the one you want and
> download it?
>
> You didn't say if you are on Linux or Windows. The ODBC module comes
> with PythonWin. Others have good luck with mxODBC, which works right
> out of the box after you download and install it.
>

The big deal with "out of the box" is that if it had support from the
outset for MySQL then Python could appeal to the mass market of people
who go for cheap-o hosts that can't be bothered to upgrade Python let
alone install databasefoo support. Currently this market is more or
less solely occupied by PHP.

Yes... I have installed MySQL support etc. on my local Linux server
but I /can't/ do that on a shared hosting environment.

> Searching the group will tell you all you need to know on this topic,
> as it comes up twice a week.
>

For what it's worth, I did try searching, but I guess my parametres
were the wrong ones. If it comes up twice a week, perhaps its a case
of demand and supply anyway?



More information about the Python-list mailing list