Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidDelphiDemoFiremonkeyIOSLibraryLiveBindingsOSXShowcaseWindows

Auto Tables Logger REST Client And RAD Server Sample For Delphi 10.2 Tokyo On Android And IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSAuto Tables for RAD Server is a client server solution which auto generates a REST API client/server/OpenAPI for your databases. The sample application and database that comes Auto Tables for RAD Server is called Logger and uses InterBase. You can swap out InterBase for any other database supported by FireDAC. I went ahead and generated the Logger sample project in the Auto Tables Editor and it is provided with this post. The client project should run on Android, IOS, OSX, Windows, and Linux (through FMXLinux). The server should run on Windows and Linux but has only been tested on Windows. I hooked up the LiveBindings in the client to some TStringGrids and some buttons to execute the REST API calls. There are three REST endpoints which are correspond to GET POST and DELETE. GetLogger for requesting the list of records from the Logger database table. PostLogger for posting a new record into the Logger database table. And finally DeleteLogger for deleting a recording out of the Logger database table. All of the REST API are made to the included RAD Server project. As you will see in the RAD Server project the endpoints are contained within a TFDMemTable. The Auto Tables Editor also generates a FireDAC JSON file which can be loaded into the TFDMemTable inside the sample RAD Server project. This allows you to make changes to the REST API endpoints without having to entirely re-generate the server project. As you will see in the sample the documentation for the REST API is provided via Swagger-UI in the Docs directory of the sample. Here is the entire source code that I added to the sample project after the auto generation of the client and server were complete.

//
//
//
procedure TMainForm.GetStringGridSelChanged(Sender: TObject);
begin
  DeleteIdEdit.Text := GetStringGrid.Cells[0,GetStringGrid.Selected];
end;

procedure TMainForm.GetBTNClick(Sender: TObject);
begin
  AutoTablesClientDM.getloggerExecute;
end;

procedure TMainForm.PostBTNClick(Sender: TObject);
begin
  AutoTablesClientDM.postloggerExecute;
  GetBTNClick(Self);
end;

procedure TMainForm.DeleteBTNClick(Sender: TObject);
begin
  if DeleteIdEdit.Text<>'' then
   begin
     AutoTablesClientDM.deleteloggerExecute(DeleteIdEdit.Text);
     DeleteMemo.Lines.Append('Delete ' + DeleteIdEdit.Text + ' sent successfully!');
     DeleteIdEdit.Text := '';
     GetBTNClick(Self);
   end;
end;

Download the full source for the Auto Tables For RAD Server Sample Logger solution.

Browse and download the full source code for the Auto Tables For RAD Server Sample Logger solution on GitHub.

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
DelphiDemoFiremonkeyLinuxOSXShowcaseWindows

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging

DelphiFiremonkeyShowcaseUtilityWindows

Unleashing Creativity With Song Writer AI: A Deep Dive

DelphiFiremonkeyShowcaseWindows

How To Build Stable Diffusion Text To Image Prompts

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

Leave a Reply