[fpc-pascal] Re: GetTableNames in TSQLConnection / Postgresql

Reinier Olislagers reinierolislagers at gmail.com
Fri Dec 21 13:12:24 CET 2012



On 21-12-2012 12:37, Tomas Hajny wrote:
> On Fri, December 21, 2012 11:59, Reinier Olislagers wrote:
>> On 18-12-2012 10:49, Tomas Hajny wrote:
>>> On Tue, December 18, 2012 09:35,
>>> michael.vancanneyt-0Is9KJ9Sb0A-XMD5yJDbdMReXY1tMh2IBg at public.gmane.org wrote:
>>>> On Tue, 18 Dec 2012, John wrote:
>>>>> you can't!  That brings me back to the original point that either
>>>>> gettablenames has to operate on a known schema only (so you can supply
>>>>> the
>>>>> schema afterwards), or it has to supply the schema with the table
>>>>> name.
>>>>
>>>> I would opt for the latter, hence the soPrependSchemaName.
>>>
>>> Isn't something like a FullTableName property/method
>>> (connection-specific)
>>> a better solution (more universal, also catering for differences in
>>> construction of the full name with different database engines)?
>> No, because then you won't be able to get metadata using the same
>> mechanism for all connections.
>> If we create a FullTableName method (or property, with corresponding
>> tablenames collection etc), we should do the same for stored procedures,
>> views, and any other object a db supports.
>> Switching dbs would then be very problematic.
>>
>> The current mechanism has the advantage that it is extendable for
>> various dbs without too much effort... and is like other mechanisms
>> (e.g. the ADO.Net method of doing things).
> 
> I must have missed something, because my thoughts went exactly into the
> direction of simplifying switching from one database to another. Indeed,
> doing the same for all database objects would be IMHO beneficial too, but
> that's another story. My proposal was exactly this - whatever naming the
> respective DB provider requires natively when addressing objects, it would
> be reflected in this property (implemented in DB provider specific way).
Ah now I understand what you mean: you mean a boolean property that
specifies behaviour. I was thinking of a property or method that
returned the table names (which seemed very strange to me but well..).

Yes, that could work, sorry I misunderstood you.




More information about the fpc-pascal mailing list