Disable quoting

How can I disable completely the quoting of identifiers in Data Abstract ?

I have seen the post where you suggest to create a descendent of a driver to disable quoting in the
auto-generated update SQL statements,

But this private driver is not available in the schema editor.

Hi,

you can easily add custom driver to DASM.
DASM can load only drivers in format DAxxxxDrv.dad

  • create DAMyCustomDriverDrv.dpr :
library DAMyCustomDriverDrv;

uses
  ShareMem,
  uDAServerInterfaces,
  MyCustomDriver in 'MyCustomDriver.pas';

{$E dad}

{$R *.res}
{$R MyCustomDriverHtml.res}

exports GetDriverObject name func_GetDriverObject;

end.

compile it and put generated .dad to DASM folder

P.S. you can use DAADODrv.dpr for reference.
P.S.S: you should recompile your .dad after installing each new version of DAD


you can implement QuoteIdentifier in your driver and override default method

This is not a very satisfying answer.

It means I must recreate a driver for every database connection type I work with (at least 3 at this point), and recompile my drivers after every release ?
I work with various versions of Delphi and DA in various virtual machines, so you can imagine this is not a small amount of work.

Why not make this a flag in the connection string ?
If I look in the code, it’s a simple property in an object which is requested from the connection, so that can be set from the connection string, I would think.

Hi,

to be honest, you should spend a some time only once - for creating .cmd and .train file, similar to we use for [re]compiling sources. check C:\Program Files (x86)\RemObjects Software\Build forlder. you need this only if you need to have your own driver in DASM.

also is possible to use your own driver in run-time only.
it can replace existing driver.
for example, if you want to replace UniDAC driver:

code
unit uDAEFixedUniDACDriver;

interface

uses 
  uDAUniDACDriver, uDAEConnection, uDAServerInterfaces, uDADriverManager, SysUtils;

type
  TDAEFixedUniDACDriver = class (TDAEUniDACDriver)
  protected
    function GetConnectionClass: TDAEConnectionClass; override;
  end;

  TDAEFixedUniDACConnection = class (TDAEUniDACConnection)
  protected
    function QuoteIdentifier(const iIdentifier: string): string; override; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF}
  end;

function GetDriverObject: IDADriver; stdcall;

implementation
var
  _driver: TDAEDriver = nil;

function TDAEFixedUniDACDriver.GetConnectionClass: TDAEConnectionClass;
begin
  Result := TDAEFixedUniDACConnection;
end;

function TDAEFixedUniDACConnection.QuoteIdentifier(const iIdentifier: string): string;
begin
  Result := iIdentifier;
end;

function GetDriverObject: IDADriver;
begin
  if (_driver = nil) then _driver := TDAEFixedUniDACDriver.Create(nil);
  result := _driver;
end;

initialization
  _driver := nil;
  UnregisterDriverProc(uDAUniDACDriver.GetDriverObject);
  RegisterDriverProc(GetDriverObject);
finalization
  UnregisterDriverProc(GetDriverObject);
  FreeAndNIL(_driver);
end.

In this case, you can just use this driver instead of std Unidac driver in your server-side datamodule.