/packages/fcl-db/src/datadict/fpddpq.pp
Puppet | 72 lines | 52 code | 20 blank | 0 comment | 1 complexity | a3b7feefc1795bcb53422fdaa3ffad28 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
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 6 Postgresql Data Dictionary Engine Implementation. 7 8 See the file COPYING.FPC, included in this distribution, 9 for details about the copyright. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 15 **********************************************************************} 16unit fpddpq; 17 18{$mode objfpc}{$H+} 19 20interface 21 22uses 23 Classes, SysUtils, sqldb, fpdatadict, fpddsqldb; 24 25Type 26 { TSQLDBPostGreSQLDDEngine } 27 28 TSQLDBPostGreSQLDDEngine = Class(TSQLDBDDEngine) 29 Protected 30 Function CreateConnection(AConnectString : String) : TSQLConnection; override; 31 Public 32 Class function Description : string; override; 33 Class function DBType : String; override; 34 end; 35 36Procedure RegisterPostgreSQLDDengine; 37Procedure UnRegisterPostgreSQLDDengine; 38 39implementation 40 41uses pqconnection; 42 43procedure RegisterPostgreSQLDDengine; 44begin 45 RegisterDictionaryEngine(TSQLDBPostGreSQLDDEngine); 46end; 47 48procedure UnRegisterPostgreSQLDDengine; 49begin 50 UnRegisterDictionaryEngine(TSQLDBPostGreSQLDDEngine); 51end; 52 53{ TSQLDBPostGreSQLDDEngine } 54 55function TSQLDBPostGreSQLDDEngine.CreateConnection(AConnectString: String 56 ): TSQLConnection; 57begin 58 Result:=TPQConnection.Create(Self); 59end; 60 61class function TSQLDBPostGreSQLDDEngine.Description: string; 62begin 63 Result:='PostGreSQL using SQLDB'; 64end; 65 66class function TSQLDBPostGreSQLDDEngine.DBType: String; 67begin 68 Result:='PostGreSQL'; 69end; 70 71end. 72