{
    This file is part of the Free Pascal run time library.
    Copyright (c) 2007 by Michael Van Canneyt, member of the
    Free Pascal development team

    MySQL 8.4 Data Dictionary Engine Implementation.

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 **********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit fpddmysql84;
{$ENDIF FPC_DOTTEDUNITS}

{$mode objfpc}{$H+}

interface

{$IFDEF FPC_DOTTEDUNITS}
uses
  System.Classes, System.SysUtils, Data.Sqldb, Data.Dict.Base, Data.Dict.Sqldb;
{$ELSE FPC_DOTTEDUNITS}
uses
  Classes, SysUtils, sqldb, fpdatadict, fpddsqldb;
{$ENDIF FPC_DOTTEDUNITS}
  
Type
  { TSQLDBmysql84DDEngine }

  TSQLDBmysql84DDEngine = Class(TSQLDBDDEngine)
  Protected
    Function CreateConnection(AConnectString  : String) : TSQLConnection; override;
  Public
    Class function Description : string; override;
    Class function DBType : String; override;
  end;

Procedure Registermysql84DDEngine;
Procedure UnRegistermysql84DDEngine;

implementation

{$IFDEF FPC_DOTTEDUNITS}
uses Data.SqlDb.mysql84;
{$ELSE FPC_DOTTEDUNITS}
uses mysql84conn;
{$ENDIF FPC_DOTTEDUNITS}

Procedure Registermysql84DDEngine;

begin
  RegisterDictionaryEngine(TSQLDBmysql84DDEngine);
end;

Procedure UnRegistermysql84DDEngine;

begin
  UnRegisterDictionaryEngine(TSQLDBmysql84DDEngine);
end;

{ TSQLDBmysql84DDEngine }

function TSQLDBmysql84DDEngine.CreateConnection(AConnectString: String
  ): TSQLConnection;
begin
  Result:={$IFDEF FPC_DOTTEDUNITS}Data.SqlDb.mysql84{$ELSE}mysql84conn{$ENDIF}.Tmysql84Connection.Create(Self);
end;

class function TSQLDBmysql84DDEngine.Description: string;
begin
  Result:='Mysql 8.4 connection using SQLDB';
end;

class function TSQLDBmysql84DDEngine.DBType: String;
begin
  Result:='MySQL 8.4';
end;

end.

