Topic: Datatype translation rules
Thanks for the framework and for making it public. I've found it quite useful already.
However, I have a couple questions that I can't quite figure out by myself.
1. How do I add additional translation rules. I tried handling the datatype conversion event,
and setting the translationtype to dmCustom, but the event never got raised. I also tried
adding additional translation rules, as follows, but this doesn't seem to work either:
PROCEDURE TForm1.AddMappingRule(const TypeName: String; FieldType: TFieldType);
VAR
Rule : TSqlitePassFieldTypeTranslationRule;
BEGIN
Rule := Nil;
TRY
Rule := TSqlitePassFieldTypeTranslationRule.Create;
Rule.DatatypeName := mgLowerCase(Trim(TypeName));
Rule.MappingMode := mmExactNoCase;
Rule.FieldType := FieldType;
SqlitePassDatabase1.DatatypeOptions.TranslationRules.Add(Rule);
EXCEPT
FreeAndNil(Rule);
END;
END;
What is the correct procedure to dynamically add more translation rules at runtime?
2. Related to the above, I tried setting the database's DataTypeOptions.DefaultFieldType to ftString, but this doesn't seem to occur, either.