Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

InspectDb

Scan a database to generate code automatically. Generate models, classes and forms processing macros for each field of a given table

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

InspectDb

Scan a database to generate code automatically. Generate models, classes and forms processing macros for each field of a given table

pascal
TMyModel = class(TDataModule)
{$Loop Example}
 f{$item.name} : {$item.type};//Item{$item.no} : {$item.type};
{$EndLoop Example}
{$Loop SecondExample}
    property {{$item.name}} {$item}  :  {$item.type} read get{$item} write f{$item.name}; //Simple {$item}
{$EndLoop SecondExample}
end;
pascal
implementation
{$Loop Nome}
function TMyModel.set{$item}: {$item.type};
begin
    result := {$item.empty};
end;{$EndLoop Nome}
{Summary}
end.

will generate something like that

pascal
TMyModel = class(TDataModule)
pascal
{$REGION 'Gerado automaticamente para cada item {$$item}'}
pascal
fID : String;//Item1 : String;
pascal
fCodigo : Integer;//Item2 : Integer;
pascal
fNome : String;//Item3 : String;
pascal
fDescricao : String;//Item4 : String;
pascal
fRegras : String;//Item5 : String;
pascal
fEndereco : String;//Item6 : String;
pascal
fHistoria : String;//Item7 : String;
pascal
fRegiao : String;//Item8 : String;
pascal
fBanner : Blob;//Item9 : Blob;
pascal
fAvatar : Blob;//Item10 : Blob;
pascal
{$ENDREGION}
    {$REGION 'Gerado automaticamente para cada item {$$item}'}
pascal
property {ID} ID  :  String read getID write fID; //Simple ID
pascal
property {Codigo} Codigo  :  Integer read getCodigo write fCodigo; //Simple Codigo
pascal
property {Nome} Nome  :  String read getNome write fNome; //Simple Nome
pascal
property {Descricao} Descricao  :  String read getDescricao write fDescricao; //Simple Descricao
pascal
property {Regras} Regras  :  String read getRegras write fRegras; //Simple Regras
pascal
property {Endereco} Endereco  :  String read getEndereco write fEndereco; //Simple Endereco
pascal
property {Historia} Historia  :  String read getHistoria write fHistoria; //Simple Historia
pascal
property {Regiao} Regiao  :  String read getRegiao write fRegiao; //Simple Regiao
pascal
property {Banner} Banner  :  Blob read getBanner write fBanner; //Simple Banner
pascal
property {Avatar} Avatar  :  Blob read getAvatar write fAvatar; //Simple Avatar
pascal
{$ENDREGION}
    end;
pascal
implementation
{$REGION 'Gerado automaticamente para cada item {$$item}'}
pascal
function TMyModel.setID: String;
begin
    result := {};
end;
pascal
function TMyModel.setCodigo: Integer;
begin
    result := -1;
end;
pascal
function TMyModel.setNome: String;
begin
    result := '';
end;
pascal
function TMyModel.setDescricao: String;
begin
    result := '';
end;
pascal
function TMyModel.setRegras: String;
begin
    result := '';
end;
pascal
function TMyModel.setEndereco: String;
begin
    result := '';
end;
pascal
function TMyModel.setHistoria: String;
begin
    result := '';
end;
pascal
function TMyModel.setRegiao: String;
begin
    result := '';
end;
pascal
function TMyModel.setBanner: Blob;
begin
    result := null;
end;
pascal
function TMyModel.setAvatar: Blob;
begin
    result := null;
end;
pascal
{$ENDREGION}
    {Summary}
    end.