A general method for accessing databases from GnomeVFS is probably not particularly useful. WinFS is *very* different from just being a way to reference databases as a filesystem like structure. I'd suggest just writing a method that directly solves your problem, on your DB structure. libgnomedb would be a great library to use in writing such a method, particularly if you want it to access multiple kinds of DB.
You might also find the code in storage/vfs useful. storage-method.c implements a pretty simple DB-backed VFS method that allows both query URIs, and reading the contents of files by their oid. I'm directly using PostgreSQL (I *think* because I needed large object support, and gnome-db didn't have it at that point, maybe it does now), but it'd be pretty easy to convert to use gnome-db. -Seth On Wed, 26 Jan 2005 18:17:35 +0100, Magnus Bergman <[EMAIL PROTECTED]> wrote: > On Wed, 26 Jan 2005 16:53:24 +0100 > Rodrigo Moya <[EMAIL PROTECTED]> wrote: > > > On Wed, 2005-01-26 at 17:00 +0100, Magnus Bergman wrote: > > > I'm about to write a Gnome-VFS module for accessing SQL databases > > > (primary MySQL and Oracle). > > > > > if you use libgda (http://www.gnome-db.org) you'll get access to those > > and more databases for free. > > Yes, I know about it, and looking into it is already on my todo-list. > But thanks anyway. > > > > And I was wondering if there is some kind of > > > standard related to mapping a URL to an SQL query. And if I'm forced > to > > > hack something myself I would appreciate opinions from others. > > > > > I've many times thought about doing a database: method for VFS, but I > > ended up not doing because it really makes no sense, to have a > database > > being accessed like a file system. The only thing I could come up to > was > > to have just database: be a special nautilus folder that would show > all > > database connections as folders, and when you visit them, show the > > tables in those databases. > > > > But I guess it's better to have a nice program for accessing those > > databases than doing it via the file system. > > > > Another idea would be to use an underlying database and offer it as a > > file system, showing it like a file system in nautilus, not like > > databases. Something like MS's WinFS. That would make sense, IMO, for > > which you don't need that complicated URI scheme, you just need to be > > able to access the files as any other file system, like > > database://photo.jpg. > > > > What were your ideas? > > What I need it for is to index text documents already stored in fields > in databases (doing so in the first place was not my idea, I just have > to deal with it). I have already written a Gnome-VFS plugin to the > (commercial) search engine I use. And the search engine requires that > each "document" can be identified with a single string, for example a > URL. So I thought it would be nifty to use Gnome-VFS for this since it > will also work with GStreamer, which I plan to use in the system later > on. > > Something like WinFS would suit me fine if it works with how the > databases in question are designed. But how would the mapping from just > a name to a specific field work? And should I interpret "database" as > a suggestion for the name for of schema, or was just an example? > _______________________________________________ > gnome-vfs-list mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/gnome-vfs-list > > _______________________________________________ gnome-vfs-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnome-vfs-list
