[fpc-pascal] Database Metadata proposal

Daniel Gaspary dgaspary at gmail.com
Sun Jun 1 00:21:04 CEST 2014


Hi.

   In December 2012, this[1] thread has brought some ideas about
Database metadata, in special the retrieving of Schema names.

   This[2] wiki page summarizes what was discussed.  Some further
conclusion after that thread?

   I agree that using Information schema, wherever is supported, is
the best solution.

   I propose the following types and methods:

    TSqlObjectIdenfier = class
    public
          property SchemaName: String;
          property ObjectName: String;

          //Optional / Reuse TSchemaType?
          property SqlObjectType: TSqlObjectType;
    end;

    TSqlObjectList = specialize TFPGList<TSqlObjectIdenfier>;

    On TSQLConnection the new (virtual) methods bellow (similar to
GetDBInfo, but public) could be added:

      function GetObjectNames(ObjectType: TSchemaType):
TSqlObjectIdenfier; overload;
      function GetObjectNames(ObjectTypes: TSchemaTypes {A new Type
Set of TSchemaType}): TSqlObjectIdenfier;  overload;

      These changes would not affect Delphi compatibility, as I am
proposing to add, not replace what exists today.

      Ideas, Pros, cons.. ?

      Thank you,

             Daniel


[1] http://lists.freepascal.org/pipermail/fpc-pascal/2012-December/035844.html
[2] http://wiki.lazarus.freepascal.org/Database_metadata#Proposal_for_extension.2Funiformization



More information about the fpc-pascal mailing list