[Gambas-devel] More Database Driver Changes

Nigel Gerrard nigel at ...2...
Wed May 19 13:08:45 CEST 2004


Benoit,


>
> Sorry, but I really don't understand what you did about this "multitable
> fields" thing and it is really necessary.
>
> I thought that the old db component was already able to access these
fields by
> using rData["Table.Field"].
>
> What's the point exactly ?
>
Does this work in the current driver ( I have upgraded my postgresql to
7.4.1 and there are
some changes that are needed to the driver to make things work...see my
changelog...so I
can no longer test the standard implementation)

Create two tables.

Table1 as ( Id Integer, Field1 text)
Table2 as ( Id Integer, Field1 text, Field2 Integer)

Then populate Table1:
1, "Group A"
2, "Group B"
3, "Group C"
4, "Group D"

Table 2:
1, "Joe", 1
2, "Fred", 2
3, "Sid", 1
4, "Tim", 1

Now

WHILE rData.Available
       rData = ....Exec("select * from Table1, Table2 where Table1.Id =
Table2.Field2")
      PRINT rData["Table1.Field1"] & ":" & rData["Table2.Field1"]
      rData.MoveNext
WEND

What happens?

I would expect to see:
Group A : Joe
Group B : Fred
Group A : Sid
Group A : Time

If my memory serves me correctly this will not be the case with the standard
implementation.

> Another point: I'd like to make changes in the DB component to remove as
much
> as possible the pseudo-collections like Database.User... to replace them
with
> true collections (Database.Users), so that things are easier to use. The
only
> pseudo-collection I want to keep is Result.
>
> I'd like to make a better interface for users and authorisations too, by
> allowing it to embrace the very different possibilites of MySQL and
> PostgreSQL: users have different authorisations, and these authorisations
can
> differ between the connection location (localhost, ...).
>
> What do you think about that ? I'm not sure this is a good idea to do that
> before 1.0, but I find the current interface a bit weird.
>
I'll need to get my head around this, before commenting :-)

Nigel





More information about the Devel mailing list