Blog

All Blog Posts  |  Next Post  |  Previous Post

TMS WEB Core with StellarDS.io backend: unparalleled productivity

Bookmarks: 

Tuesday, March 26, 2024

Last week, we had the first public reveal and opening of the closed beta phase of our brand new service StellarDS.io

TMS Software Delphi  Components

Stellar DataStore is our fast and easy solution to let your application use a backend as a service. Using the power of our REST API, you can easily fetch and manipulate data in the cloud. stellards.io even enables you to set up a whole database with only a few API calls. We handle everything a backend might need, from data storage and manipulation to security and privacy. There is no need anymore for hosting servers or implementing new security measures. Stellar DataStore will handle this for you, leaving more room for implementing the things you want.

TMS WEB Core & StellarDS.io

In this blog, we'd like to dive deeper in how TMS WEB Core new components will make working with StellarDS.io backend will give you unparalleled productivity to create full-stack web applications. 

TStellarDataStore class

A first way to work with Stellar DataStore from a TMS WEB Core web client application is via the TStellarDataStore class. This os an Object Pascal wrapper class for the Stellar DataStore REST API. It basically allows to fully manipulate the metadata of your data in the backend and of course also perform CRUD operations on data (entities).

The hierarchy is:

TMS Software Delphi  Components

Via the TStellarDataStore class, you have access to the collection of tables TStellarDataStoreTables. In turn each table in this collection provides access to a collection of fields TStellarDataStoreFields and collection of entities TStellarDataStoreEntities. You can access each individual field in the Fields collection as TStellarDataStoreField and each entity in the Entities collection as TStellarDataStoreEntity. This way, you can add, delete, modify fields as well as add, delete, modify entities. 

This is a code snippet that shows you can use these classes to verify if a database is setup correct for a user and if not, initialize it with the fields needed:

    sdb := TStellarDataStore.Create(Self);
    // set the access token to connect directly
    sdb.AccessToken := edAccessToken.Text;
    // get the default project ID
    await(boolean, sdb.GetProject);    
    // check if the needed table exists
    res := await(boolean, sdb.HasTable(sdb_tablename));    if not res then
    begin
      ShowMessage('Table not found, trying to create table automatically');
      // create the needed table
      res := await(boolean,  sdb.CreateTable(sdb_tablename));
      // successful creation
      if res then
      begin
        // refresh the tables list
        await(boolean, sdb.GetTables);
        // find the new create table reference by name
        tbl := sdb.Tables.FindTable(sdb_tablename);
        // insert the needed fields for this table
        await(boolean, tbl.CreateField(sdb_fieldstatus, ftString, 50));
        await(boolean, tbl.CreateField(sdb_fielddescr, ftString, 50));
        await(boolean, tbl.CreateField(sdb_fielddate, ftDate, 50));
      end
      else
      begin
        sdb.Free;
        ShowMessage('Failed to create table. Check account quota and/or permissions and retry.');
        Exit;
      end;
    end;

    sdb.Free;

TWebStellarDataStoreClientDataSet component

Much easier is to start working with the TWebStellarDataStoreClientDataSet, especially with its strong design-time integration. Connect a TWebDataSource to a TWebStellarDataStoreClientDataSet and then connect the datasource to DB-aware controls and you are up & running. 
To initialize the dataset, invoke the design-time editor via the context menu:

TMS Software Delphi  Components

And from here, you can add, delete, update tables and for each table, you can add, delete, update fields:

TMS Software Delphi  Components

When you select a table, it will automatically initialize all fields in the dataset, making it actually immediately ready to be used from DB-aware controls in the TMS WEB Core client application.

To make it all more clear, watch this video, where we take on the challenge to create a full working web application with data in the backend with unparalleled productivity:



Closed Beta

Sign up here to get a chance to enter the closed beta and get a head start developing full-stack applications. We will invite people at regular intervals to the Closed Beta. When you are eligible to join, you will receive an invitation through e-mail with you credentials.

What's next?

We will release shortly an update of TMS FNC Cloud Pack that will include similar seamless integration components for StellarDS.io but this time for native Windows VCL applications as well as FMX cross-platform applications. Watch this blog series for more information when we released it! 

Follow us now!

Show us support and follow us on our social media to always be up to date about stellards.io

TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

Bruno Fierens


Bookmarks: 

This blog post has received 2 comments. Add a comment.



All Blog Posts  |  Next Post  |  Previous Post