Bug in TSQLiteSQLGenerator related to

TSQLiteSQLGenerator does not properly escape field names. Field names atrting with a number needs to be escaped.

The following code corrects that problem. All 3 methods are override from ancestor classes:

function TSQLiteSQLGenerator.IdName(const AName: string): string;
begin
  result := inherited;
  if pos(copy(result, 1, 1), '0123456789') > 0 then
    result := QuoteId(result);
end;

function TSQLiteSQLGenerator.OpenQuote: string;
begin
  result := '`';
end;

function TSQLiteSQLGenerator.CloseQuote: string;
begin
  result := '`';
end;


Is there a way to inject a different generator ? I found a lot of issues with the ones provided with Aurelius and I'd like to be able to provide my fixes without having to change code of the library.

You can change the generator, yes, using a simple code like this (suppose you have created TMySQLiteSQLGenerator inheriting from the default TSQLiteSQLGenerator):




Uses  
 Aurelius.Sql.SQLite, Aurelius.Sql.Register;  
  
Var  
 SQLiteGenerator: TSQLiteSQLGenerator;  
begin  
 SQLiteGenerator := TMySQLiteSQLGenerator.Create;   
 TSQLGeneratorRegister.GetInstance.RegisterGenerator(SQLiteGenerator);