Da linq

Is there any chance for DALINQ to be ported to DA for mac and usable from elements/Toffee?

Hello

We have some plans on this, yet no ETA or prototype for now

Thanks for the quick reply, Anton. I believe Toffee already supports the LINQ syntax and functionality (compared to .NET), doesn’t it?

If it means anything, I, as a faithful RemObjects customer would, love to see the implementation of DALINQ in Toffee elevated in priority.

Thanks much!

Alan

Toffe supports LINQ and sequences, but it doesn’t support queryable sequences (yet), which is what DA LINQ is based on; we only have those on .NET. And of course DA/Cocoa doesn’t implement the right methods yet for LINQ to be applicable, but that’d be the easier part.

That said, i agree DA LINQ would be beneficial to have across platforms, and we’re exploring two different options what would get us that eventually, and hopefully better cross-Elements-platforms API parity and compatibility in general. In the mean time, the DA SQL APIs are your best bet for now.

Thanks for the explanation, marc. I agree there are options w/ the DA SQL API, but the code using DA LINQ in Oxygene is just so damn clean it makes me NOT want to use any other option!

1 Like

I have a .NET DA server complied, and I complied a .NET class library that my client apps uses. Everything I’ve done so far in .NET uses DALINQ just because its the most elegant way, IMHO, to write DA Code.

IF I need to make a macOS client, I am assuming I should compile a dynamic library for macOS clients, correct?

Also, how does the MacOS DA SQL API compare to the .NET DA SQL API?

Could someone show me some sample code using DASQL to query a DA server from both .NET and macOS?

For start please take a look at these samples:

https://docs.dataabstract.com/Cocoa/Samples/DASQL/

and

https://docs.dataabstract.com/NET/Samples/DASQL/ (note that there is an error in the .NET samples path, it should be c:\Users\Public\Documents\RemObjects Samples\Data Abstract for .NET\Oxygene\DASQL instead).

Need to say that DA LINQ already works via DA SQL (unsless the server is written in Delphi and doesn’t support DA SQL so a legacy mode should be activated)

When I go to do a new project, there is no Cocoa/Data Abstract/Console application template available. should there be?

Why is this generating an ROException on the first line??? Invalid URL specified???

namespace console1;

interface

uses
  RemObjects.Elements.RTL,
  DataAbstract,
  RemObjectsSDK,
  Foundation;

type
  Program = public static class
  public
    method Main(aArguments: array of String): Int32;
  end;

implementation

method Program.Main(aArguments: array of String): Int32;
begin
  var fDataAdapter: DARemoteDataAdapter := new DARemoteDataAdapter WithTargetURL(new NSURL('http://my.serveraddress.com:4071'));
  NSLog('Test Cocoa DataAbstract Console App #1');
  var SQLString := 'select * from client where AdExec=''020''';
  NSLog(SQLString);
  NSLog('---------------------------------------------------------------------');

  try
    var MyData:DADataTable := fDataAdapter.getDataTableWithSQL(SQLString);
    for each rec in MyData.rows do
      NSLog(rec.fieldByName('ClientName').ToString);
  except
    on ex:ROException do
      begin
        NSLog(ex.Message);
        NSLog(ex.StackTrace);
      end;
  end;  
end;

end.

nevermind, I figured it out.

that should be NSURL.URLWithString, no?