[fpc-pascal] Re: SQLDB GetSchemaInfoSQL for indexes etc?
reinierolislagers at gmail.com
Thu Apr 19 13:48:55 CEST 2012
On 19-4-2012 13:28, LacaK wrote:
> Reinier Olislagers wrote / napísal(a):
>> On 18-4-2012 8:27, LacaK wrote:
>>>> I don't have Delphi with dbExpress here, so can't test.
>>> I did some tests in Delphi XE with DBExpress and MySQL:
>>> for stTables column names are: CatalogName, SchemaName, TableName,
>>> TableType ('TABLE')
>> So difference with FPC: the names (catalog_name, schema_name,
>> table_name, table_type). The FPC names seem to match the ISO SQL*) names
>> more (ISO has them capitalized, no problem if no quotes are used).
>> In contrast to dbExpress (and probably the standard), FPC also has recno
>> (internal database object ID? Could be very handy.)
>> Other difference: TableType ('TABLE'): I think Delphi+dbExpress better
>> match ISO SQL*) here (though 'BASE TABLE', 'VIEW') instead of the 0 that
>> FPC returns - at least in the Firebird, PostgreSQL connectors that I
>> *) at least an SQL2008 draft version I found some time ago...
>> The PostgreSQL documentation is also very nice:
>> As is the Mimer (link to old documentation; newer is inside a frame):
>> I'd prefer changing TABLE_TYPE to the ISO way of doing things, but of
>> course it could break existing applications if any of them use this
>> functionality... Still, FPC always returns 0 so I suppose it would have
>> been useless anyway, so no harm in changing it.
> Thinking about column names I would suggest, change it according to
> SQL-Standard (information_schema views). To be fully compatible.
> (because ATM we are not compatible with SQL-Standard NOR Delphi)
> Advantage will be, that we will be able do for example 'select * from
> so if some DB provides also other columns (additional information on
> tables, procedures, indexes, columns etc.) we will get it.
> It will of course lead to breaking backward compatibility, but I think,
> that there is very, very (if any) small amount of users, which use
> setschemainfo+open to get metadata information.
Agreed that renaming the stuff to ISO makes sense.... will however be a
bit more problematic with indexes, after my brief glance at the specs.
grep -i --recursive SchemaInfo * | grep -v .svn | more
=> no code other than the db connectors
3rd party code: might be some.
Will shelve this for the rewrite after the lazdatadesktop work for MS
More information about the fpc-pascal