оптимизон от нейронки, доделал автоматические действия, добавил глобальный лог, сделал реконекты к ДА

This commit is contained in:
PC1\PTyTb
2025-08-08 14:57:56 +03:00
parent 1936c9c9c0
commit 71cdcc9909
23 changed files with 721 additions and 249 deletions
+4 -12
View File
@@ -445,7 +445,6 @@ begin
if not CheckTableExists(TableName) then
begin
Context := TRttiContext.Create;
try
RttiType := Context.GetType(RecordTypeInfo);
FieldDefs := '';
for Field in RttiType.GetFields do
@@ -455,14 +454,11 @@ begin
FieldDefs := FieldDefs + Field.Name + ' ' + GetSQLType(Field);
end;
FConnection.ExecSQL(Format('CREATE TABLE %s (%s)', [TableName, FieldDefs]));
finally
Context.Free;
end;
end
else
begin
Context := TRttiContext.Create;
try
RttiType := Context.GetType(RecordTypeInfo);
Query := TFDQuery.Create(nil);
try
@@ -478,9 +474,7 @@ begin
finally
Query.Free;
end;
finally
Context.Free;
end;
end;
end;
@@ -507,7 +501,7 @@ begin
EnsureTableForRecord(TableName, TypeInfo(T));
Context := TRttiContext.Create;
try
RttiType := Context.GetType(TypeInfo(T));
Fields := RttiType.GetFields;
@@ -598,9 +592,7 @@ begin
finally
Query.Free;
end;
finally
Context.Free;
end;
end;