473,322 Members | 1,755 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,322 software developers and data experts.

Generic database dictionary access

Version 2.0 of the Python database API was written over 5 years ago, in
1999. While it has been used successfully by many implementations, there is
no generic access into the data dictionary of relational databases except at
the table column level. I am working on some Python which would hopefully
give me a form of generic access to more common data dictionary
functionality such as indices, constraints etc. but no such functionality
currently exists in the official Python distribution. Has there been any
movement in the 5 year time span since the 2.0 API was published to add
richer generic functionality for relational databases as regards data
dictionary access ? I fully realize that each major RDBMS has its own
methods for programatically querying its data dictionary, and I suspect that
there is no common SQL specification for doing so, but I would think that
richer functionality along these lines might be welcome to Python database
programmers other than myself.
Jul 18 '05 #1
4 1947
"Edward Diener" <el******@earthlink.net> writes:
Has there been any movement in the 5 year time span since the 2.0 API
was published to add richer generic functionality for relational
databases as regards data dictionary access ? I fully realize that each
major RDBMS has its own methods for programatically querying its data
dictionary, and I suspect that there is no common SQL specification for
doing so, but I would think that richer functionality along these lines
might be welcome to Python database programmers other than myself.


SQL defines INFORMATION_SCHEMA as a standard way to query metadata,
although not all databases implement it. Google for more info.

Recent versions of PostgreSQL support INFORMATION_SCHEMA -- here's
the doc:

http://www.postgresql.org/docs/7.4/s...on-schema.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 18 '05 #2
Michael Fuhr wrote:
"Edward Diener" <el******@earthlink.net> writes:
Has there been any movement in the 5 year time span since the 2.0 API
was published to add richer generic functionality for relational
databases as regards data dictionary access ? I fully realize that
each major RDBMS has its own methods for programatically querying
its data dictionary, and I suspect that there is no common SQL
specification for doing so, but I would think that richer
functionality along these lines might be welcome to Python database
programmers other than myself.


SQL defines INFORMATION_SCHEMA as a standard way to query metadata,
although not all databases implement it. Google for more info.


Yes, I see it but it seems as if even some of the large databases don't
support it ( unless I am mistaken, Oracle for instance ). Nonetheless it
would be great if the Python database API were able to use it to create
richer data dictionary information than what it provides. In particular
constraints and unque key/foreign key links in tables if this could be
discovered generically through the INFORMATION_SCHEMA standard methods.
Jul 18 '05 #3
Edward Diener wrote:
Version 2.0 of the Python database API was written over 5 years ago, in
1999. While it has been used successfully by many implementations, there is
no generic access into the data dictionary of relational databases except at
the table column level. I am working on some Python which would hopefully
give me a form of generic access to more common data dictionary
functionality such as indices, constraints etc. but no such functionality
currently exists in the official Python distribution. Has there been any
movement in the 5 year time span since the 2.0 API was published to add
richer generic functionality for relational databases as regards data
dictionary access ? I fully realize that each major RDBMS has its own
methods for programatically querying its data dictionary, and I suspect that
there is no common SQL specification for doing so, but I would think that
richer functionality along these lines might be welcome to Python database
programmers other than myself.

Hear Hear. This would be a welcome improvement. Note that you could
create it as a library that runs on top of DB-API drivers and knows
various flavours of database, and then work towards standardizing the
interface... I for one would be interested in the library

David
Jul 18 '05 #4
David Fraser wrote:
Edward Diener wrote:
Version 2.0 of the Python database API was written over 5 years ago,
in 1999. While it has been used successfully by many
implementations, there is no generic access into the data dictionary
of relational databases except at the table column level. I am
working on some Python which would hopefully give me a form of
generic access to more common data dictionary functionality such as
indices, constraints etc. but no such functionality currently exists
in the official Python distribution. Has there been any movement in
the 5 year time span since the 2.0 API was published to add richer
generic functionality for relational databases as regards data
dictionary access ? I fully realize that each major RDBMS has its
own methods for programatically querying its data dictionary, and I
suspect that there is no common SQL specification for doing so, but
I would think that richer functionality along these lines might be
welcome to Python database programmers other than myself.

Hear Hear. This would be a welcome improvement. Note that you could
create it as a library that runs on top of DB-API drivers and knows
various flavours of database, and then work towards standardizing the
interface... I for one would be interested in the library


As Mr. Fuhr has pointed out, there is an SQL standard for it in
INFORMATION_SCHEMA. One could attempt to build a base class for it using
this and a set of functions which exposed the data dictionary through it,
and then derive from that class and override its functionality for databases
which don't support it but provide different methods to access the data
dictionary data.

Finding out which databases do support it, and to what extent, would be the
first hurdle. Then deciding what the class functionality desired would be
the next. Of course writing the correct SQL to get what one wants would be
the final challenge.
Jul 18 '05 #5

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

Similar topics

49
by: Steven Bethard | last post by:
I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another...
18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
2
by: Jasper Kent | last post by:
I'm trying to do the equivalent of using typedefs with templates in C++ to avoid long instantiation names. I can do this okay: using BigDictionary = System.Collections.Generic.Dictionary<int,...
3
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news...
3
by: fstorck | last post by:
Hi, I'm kind of stuck with an serializing / deserializing problem using a generic dictionary holding references to various generic types. It goes as follows: <code> class MyBase :...
3
by: Otis Mukinfus | last post by:
I've been wrestling with this for a while and can't figure it out. I have a generic method with the following signature: //this compiles OK public abstract class DataMethod { public...
0
by: xpding | last post by:
Hello, I have a class MyEmbededList contains a generic dictionary, the value field is actually the MyEmbededList type as well. There is another class need to access and manipulate a list of...
2
by: =?Utf-8?B?RGF2aWQgTW9ycmlz?= | last post by:
I am trying to create a nested Dictionary and get an error that seems odd to me. Here is my declaration: private IDictionary<Guid, IDictionary<Guid, string>> myNestedDictionary = new...
7
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
I have a Class "Multidictionary" which I created which is basically a dictionary which can have multiple values for the same key. The class centers around private Dictionary<K,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.