473,378 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Database abstraction (like AdoDB in PHP)

Is there something like ADODB in PHP for Python? something that would
allow me to easily switch databases just by changing a few parameters?
:)

- Andres
Jul 18 '05 #1
3 1434
DH
Andres Montiel wrote:
Is there something like ADODB in PHP for Python? something that would
allow me to easily switch databases just by changing a few parameters?
:)


The person who wrote ADODB made a version for Python, too, recently:
http://php.weblogs.com/adodb_python

But see also:
http://sqlobject.org/
http://modeling.sourceforge.net/
and some commercial products like Rekall, mxODBC
Jul 18 '05 #2
DH a écrit :
Andres Montiel wrote:
Is there something like ADODB in PHP for Python? something that would
allow me to easily switch databases just by changing a few parameters?
:)

The person who wrote ADODB made a version for Python, too, recently:
http://php.weblogs.com/adodb_python

But see also:
http://sqlobject.org/
http://modeling.sourceforge.net/
and some commercial products like Rekall, mxODBC


In fact, this is nearly already the case. If your library is "Python
Database API Specification v2.0" compliant (see
http://www.python.org/peps/pep-0249.html) then you can just change the
connection object. But you need to take care of such thing like the
"paramstyle" parameters.
I've already use this to change from MySQL to ODBC with no change in the
code.

But the real pain is not the API, it is the SQL. For example an integer
will not be declare the same way in PostGres or MySQL, same for BLOB, etc.

That is why the only way is to do things in a more abstract way like
sqlobject or modeling. But I find it is still complicate to have a
persistent framework that can accept Database, ZODB, etc in a nice way...

Loïc

Jul 18 '05 #3
Thanks for the tips. :)

On Fri, 2004-02-20 at 05:50, Yermat wrote:
DH a écrit :
Andres Montiel wrote:
Is there something like ADODB in PHP for Python? something that would
allow me to easily switch databases just by changing a few parameters?
:)

The person who wrote ADODB made a version for Python, too, recently:
http://php.weblogs.com/adodb_python

But see also:
http://sqlobject.org/
http://modeling.sourceforge.net/
and some commercial products like Rekall, mxODBC


In fact, this is nearly already the case. If your library is "Python
Database API Specification v2.0" compliant (see
http://www.python.org/peps/pep-0249.html) then you can just change the
connection object. But you need to take care of such thing like the
"paramstyle" parameters.
I've already use this to change from MySQL to ODBC with no change in the
code.

But the real pain is not the API, it is the SQL. For example an integer
will not be declare the same way in PostGres or MySQL, same for BLOB, etc.

That is why the only way is to do things in a more abstract way like
sqlobject or modeling. But I find it is still complicate to have a
persistent framework that can accept Database, ZODB, etc in a nice way...

Loïc

Jul 18 '05 #4

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

Similar topics

9
by: Ruby Tuesday | last post by:
Which one is better to do dynamic websites using MySQL? Thanks a.. ADODB, http://php.weblogs.com/ADOdb/ b.. Metabase, http://www.phpclasses.org/browse.html/package/20.html c.. PEAR::DB,...
3
by: Rainer Collet | last post by:
hi! i tested several php database abstraction layers (db, mdb(2), creole, adodb, etc), but i always missed one really important feature: i need a method for a limited select which gives me the...
1
by: DartmanX | last post by:
I'm looking for any comparisons of PHP Database Abstraction Layers out there, with an eye towards speed/efficiency. I'm still using PEAR::DB, which obviously leaves something to be desired. I'm...
11
by: Full Decent | last post by:
Hey all! I've been using PHP for a while and I'm hearing that I should look into using it OO. I'm looking into making changes to the program Camera Life (http://fdcl.sf.net). I want to abstract...
54
by: sam.s.kong | last post by:
Hi! I've been programming ASP for 5 years and am now learning PHP. In ASP, you can use GetRows function which returns 2 by 2 array of Recordset. Actually, it's a recommended way in ASP when you...
4
by: Samuel | last post by:
Hi, I am looking for a library that takes an XML file that specifies a table structure, and generates the CREATE/DROP/ALTER SQL statements to create the tables in the database. In particular,...
2
by: scott.alfon | last post by:
Hello, i need your help. I want to implement a php-script where I can access to different database types as PostSQL, MySQL etc. Is that possible? Furthermore I want to include an access...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
8
by: Ivan S | last post by:
What are your recommendations for lightweight database abstraction library (Oracle/MySQL)? I prefer OOP. :) Tnx, Ivan.
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.