Commit 52c1c2f4 authored by Sandro Camata Santana's avatar Sandro Camata Santana

Suporte postgre

parent 1c46e551
......@@ -30,7 +30,7 @@ const cBASE_USECASE_CLASS_FULL_PATH = MODELO + '::FrameworkModel::acuFrameworkPa
type
TDataBaseVendor = (dbvSQLServer, dbvOracle, dbvDB2);
TDataBaseVendor = (dbvSQLServer, dbvOracle, dbvDB2, dbvPostgre);
//////////////////////////////////////////////////////////////////////////////
TCodeGenParams = class(TObject);
......@@ -284,20 +284,31 @@ begin
else if SameText(piDBColumnMap.AttributeTicket.DBType, 'text') then
case piDBVendor of
dbvSQLServer: lSQLColumnDBType := piDBColumnMap.AttributeTicket.DBType;
dbvOracle: lSQLColumnDBType := 'clob';
dbvDB2: lSQLColumnDBType := 'clob';
else
lSQLColumnDBType := 'clob';
lSQLColumnDBType := piDBColumnMap.AttributeTicket.DBType;
end
else if SameText(piDBColumnMap.AttributeTicket.DBType, 'datetime') then
case piDBVendor of
dbvSQLServer: lSQLColumnDBType := piDBColumnMap.AttributeTicket.DBType;
dbvOracle: lSQLColumnDBType := 'date';
dbvDB2: lSQLColumnDBType := 'timestamp';
dbvPostgre: lSQLColumnDBType := 'timestamp';
end
else if SameText(piDBColumnMap.AttributeTicket.DBType, 'image') then
case piDBVendor of
dbvSQLServer: lSQLColumnDBType := piDBColumnMap.AttributeTicket.DBType;
dbvOracle: lSQLColumnDBType := 'blob';
dbvDB2: lSQLColumnDBType := 'blob';
dbvPostgre: lSQLColumnDBType := 'bytea';
else
lSQLColumnDBType := 'blob';
lSQLColumnDBType := piDBColumnMap.AttributeTicket.DBType;
end
else if SameText(piDBColumnMap.AttributeTicket.DBType, 'blob') then
case piDBVendor of
dbvPostgre: lSQLColumnDBType := 'bytea';
else
lSQLColumnDBType := piDBColumnMap.AttributeTicket.DBType;
end
else
lSQLColumnDBType := piDBColumnMap.AttributeTicket.DBType;
......
This diff is collapsed.
......@@ -28,18 +28,23 @@ type
TCodeGen = class(TForm)
memCode: TSynEdit;
memSQLPostgre: TSynEdit;
memXSDIn: TSynEdit;
memXSDOut: TSynEdit;
memSQLServer: TSynEdit;
memSQLOracle: TSynEdit;
memSQLDB2: TSynEdit;
PageControl1: TPageControl;
Panel16: TPanel;
Panel17: TPanel;
SpeedButton9: TSpeedButton;
SynCppSyn1: TSynCppSyn;
SynFreePascalSyn1: TSynFreePascalSyn;
SynJavaSyn1: TSynJavaSyn;
SynSQLSyn1: TSynSQLSyn;
SynSQLSyn2: TSynSQLSyn;
SynSQLSyn3: TSynSQLSyn;
SynSQLSyn4: TSynSQLSyn;
SynXMLSyn1: TSynXMLSyn;
TabSheet1: TTabSheet;
Panel3: TPanel;
......@@ -50,6 +55,7 @@ type
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
PageControl2: TPageControl;
TabSheet12: TTabSheet;
TabSheet2: TTabSheet;
Panel5: TPanel;
Panel6: TPanel;
......@@ -108,6 +114,7 @@ type
procedure edtJavaPackageNameChange(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
procedure SpeedButton8Click(Sender: TObject);
procedure SpeedButton9Click(Sender: TObject);
private
{ Private declarations }
fUtil: TUtil;
......@@ -348,6 +355,17 @@ begin
end;
end;
procedure TCodeGen.SpeedButton9Click(Sender: TObject);
begin
Screen.Cursor := crHourGlass;
try
memSQLPostgre.Clear;
memSQLPostgre.Lines.Text := Util.GerarFullSQLPreview(dbvPostgre);
finally
Screen.Cursor := crDefault;
end;
end;
function TCodeGen.SuggestFileName(piValue: string; piExtension: boolean = false): string;
var lFileName: string;
begin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment