/packages/fcl-db/src/datadict/fpddpq.pp

https://github.com/slibre/freepascal · Puppet · 72 lines · 52 code · 20 blank · 0 comment · 1 complexity · a3b7feefc1795bcb53422fdaa3ffad28 MD5 · raw file

  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2007 by Michael Van Canneyt, member of the
  4. Free Pascal development team
  5. Postgresql Data Dictionary Engine Implementation.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit fpddpq;
  13. {$mode objfpc}{$H+}
  14. interface
  15. uses
  16. Classes, SysUtils, sqldb, fpdatadict, fpddsqldb;
  17. Type
  18. { TSQLDBPostGreSQLDDEngine }
  19. TSQLDBPostGreSQLDDEngine = Class(TSQLDBDDEngine)
  20. Protected
  21. Function CreateConnection(AConnectString : String) : TSQLConnection; override;
  22. Public
  23. Class function Description : string; override;
  24. Class function DBType : String; override;
  25. end;
  26. Procedure RegisterPostgreSQLDDengine;
  27. Procedure UnRegisterPostgreSQLDDengine;
  28. implementation
  29. uses pqconnection;
  30. procedure RegisterPostgreSQLDDengine;
  31. begin
  32. RegisterDictionaryEngine(TSQLDBPostGreSQLDDEngine);
  33. end;
  34. procedure UnRegisterPostgreSQLDDengine;
  35. begin
  36. UnRegisterDictionaryEngine(TSQLDBPostGreSQLDDEngine);
  37. end;
  38. { TSQLDBPostGreSQLDDEngine }
  39. function TSQLDBPostGreSQLDDEngine.CreateConnection(AConnectString: String
  40. ): TSQLConnection;
  41. begin
  42. Result:=TPQConnection.Create(Self);
  43. end;
  44. class function TSQLDBPostGreSQLDDEngine.Description: string;
  45. begin
  46. Result:='PostGreSQL using SQLDB';
  47. end;
  48. class function TSQLDBPostGreSQLDDEngine.DBType: String;
  49. begin
  50. Result:='PostGreSQL';
  51. end;
  52. end.