Delphi uSQLBuilder 封装类


 type

   { TSelectSQL }
   TSelectSQL = record
    SELECT: string;
    FROM: string;
    WHERE: string;
    GROUP: string;
    HAVING: string;
    UNION: string;
    PLAN: string;
    ORDER: string;
    function Build(Terminate: Boolean = False): string;
    procedure Init;
   end;

   { TInsertSQL }
   TInsertSQL = record
    INSERT_INTO: string;
    FIELDS: string;
    VALUES: string;
    RETURNING: string;
    function Build(Terminate: Boolean = False): string;
    procedure Init;
   end;

   { TUpdateSQL }
   TUpdateSQL = record
    UPDATE: string;
    SET_: string;
    WHERE: string;
    function Build(Terminate: Boolean = False): string;
    procedure Init;
   end;

   { TDeleteSQL }
   TDeleteSQL = record
    DELETE_FROM: string;
    WHERE: string;
    function Build(Terminate: Boolean = False): string;
    procedure Init;
   end;

   { TChainSelectSQL }
   TChainSelectSQL = record
    SQL: string;
    function SELECT(aSELECT: string): TChainSelectSQL;
    function FROM(aFROM: string): TChainSelectSQL;
    function WHERE(aWHERE: string): TChainSelectSQL;
    function GROUP_BY(aGROUP: string): TChainSelectSQL;
    function ORDER_BY(aORDER: string): TChainSelectSQL;
    function HAVING(aHAVING: string): TChainSelectSQL;
    function UNION(aUNION: string): TChainSelectSQL;
    procedure Init;
    function Term(Terminate: Boolean = False): string;
   end;

   { TChainInsertSQL }
   TChainInsertSQL = record
    SQL: string;
    function INSERT_INTO(aINSERT_INTO: string; aFIELDS: string = ''): TChainInsertSQL;
    function VALUES(aVALUES: string): TChainInsertSQL;
    function RETURNING(aRETURNING: string): TChainInsertSQL;
    procedure Init;
    function Term(Terminate: Boolean = False): string;
   end;

   { TChainUpdateSQL }
   TChainUpdateSQL = record
    SQL: string;
    function UPDATE(aUPDATE: string): TChainUpdateSQL;
    function SET_(aSET: string): TChainUpdateSQL;
    function WHERE(aWHERE: string): TChainUpdateSQL;
    procedure Init;
    function Term(Terminate: Boolean = False): string;
   end;

   { TChainUpdateSQL }
   TChainDeleteSQL = record
    SQL: string;
    function DELETE_FROM(aDELETE: string): TChainDeleteSQL;
    function WHERE(aWHERE: string): TChainDeleteSQL;
    procedure Init;
    function Term(Terminate: Boolean = False): string;
   end;




源代码下载

20200523

(免费下载)

 


更多教程、资源、源码可以关注QQ群:   682628230






联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678