[fpc-pascal] GetTableNames in TSQLConnection / Postgresql
michael.vancanneyt at wisa.be
michael.vancanneyt at wisa.be
Mon Dec 17 11:12:07 CET 2012
On Mon, 17 Dec 2012, LacaK wrote:
>>> But original question AFAIU was about: what should GetTableNames return
>>> (schema query can return multiple columns, but what column use when fill
>>> list of table names)?
>>> GetTableNames return list of table names into TStrings.
>>> Now only TABLE_NAME is returned. John requested, that also schema name
>>> should be prefixed (if there is any)
>>
>> Ah, that was not clear to me :-)
>>
>> But why the SCHEMA_TABLE_NAME ? It's redundant information, as the
>> information is present in SCHEMA_NAME and TABLE_NAME anyway ?
> *Yes is redundant
Redundancy is bad in data :)
>> A different story is the GetTableNames call, which will - presumably - use
>> the above information.
>>
> *Yes it is point of story ... GetTableNames call GetDBInfo which calls
> SetSchemaInfo and in loop fills TStrings with provided AReturnField Field.
>
> *
>> There I think some extra options are needed:
>>
>> TSchemaOption = (soPrependSchemaName,soIncludeSystemObjects);
>> TSchemaOptions = set of TSchemaOption;
>>
>> Procedure GetTableNames(List : TStrings; Options : TSchemaOptions = []);
>>
> *possible, but introduces incompatibility with Delphi, where GetTableNames is
> declared like now in FPC (GetTableNames(List: TStrings; SystemTables:
> Boolean) + other overloads)
> So SystemTables is there already ...
There is no need for incompatibility ?
We keep the call as it exists now, and redirect it to the new call with
the extended options. We do this in several places in the RTL/FCL already.
The idea is to offer more options, this way there is no need for custom
solutions. Everyone benefits.
Michael.
More information about the fpc-pascal
mailing list