Inital commit with most of the completed code
This commit is contained in:
58
__history/Main.dpr.~9~
Normal file
58
__history/Main.dpr.~9~
Normal file
@@ -0,0 +1,58 @@
|
||||
program Main;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
{$R *.res}
|
||||
|
||||
uses
|
||||
System.SysUtils,
|
||||
ZConnection,
|
||||
ZDataset,
|
||||
DatabaseTestExecutor in 'DatabaseTestExecutor.pas',
|
||||
DataGenerator in 'DataGenerator.pas';
|
||||
|
||||
var
|
||||
Connection: TZConnection;
|
||||
Query: TZQuery;
|
||||
|
||||
begin
|
||||
Connection := TZConnection.Create(nil);
|
||||
Connection.LibraryLocation := ExtractFilePath(ParamStr(0)) + 'libpq.dll';
|
||||
|
||||
try
|
||||
Connection.Protocol := 'postgresql';
|
||||
Connection.HostName := 'localhost';
|
||||
Connection.Port := 5433;
|
||||
Connection.Database := 'test_db';
|
||||
Connection.User := 'postgres';
|
||||
Connection.Password := 'postgres';
|
||||
|
||||
Writeln('Connecting to PostgreSQL...');
|
||||
Connection.Connect;
|
||||
Writeln('Connected successfully!');
|
||||
Writeln('-------------------------');
|
||||
|
||||
|
||||
|
||||
var DatabaseManager: TDatabaseManager;
|
||||
DatabaseManager := TDatabaseManager.Create(Connection, 1234);
|
||||
var SetupSuccess: Boolean;
|
||||
|
||||
SetupSuccess := DatabaseManager.SetupDatabase();
|
||||
|
||||
if SetupSuccess then
|
||||
begin
|
||||
Writeln('Done!');
|
||||
end
|
||||
else
|
||||
begin
|
||||
Writeln('Failed to setup database connection!');
|
||||
end;
|
||||
finally
|
||||
|
||||
end;
|
||||
|
||||
Writeln('-------------------------');
|
||||
Writeln('Press Enter to exit...');
|
||||
Readln;
|
||||
end.
|
||||
Reference in New Issue
Block a user