Create a Table in the Data Store

Let’s now create a table in the Data Store in the WorkDriveSync project. This table stores the details of the files that are uploaded through the client application. This data is fetched to be displayed in the client, and is updated or deleted whenever the corresponding actions are performed.

To create a table:

  1. Navigate to Data Store under Develop.
    catalyst_workdrive_datastore

  2. Click Create a new Table.

  3. Enter the table’s name as “WorkDriveFileID” and click Create.
    catalyst_workdrive_create_table

Note: Ensure that you enter the name exactly as instructed, because the application's code contains the same name.

The table is now created and displayed in the Data Store page.

Create Columns

Next, let’s create columns in the table to store the metadata of the files.

  1. Click New Column in the Schema View section for the table.
    catalyst_workdrive_create_column_1

  2. Enter the column’s name as “FileID”. Select the data type as BigInt.catalyst_workdrive_create_column_2
    You can learn about the various data types supported by Catalyst and the other properties of a column from the Data Store help page.

Note: Ensure that you enter the name exactly as instructed, because the application's code contains the same name.
  1. Click Create.

You must now create 5 other columns in the same way. The table must contain 6 columns in total with the following mandatory properties:

Column Name Data Type Max Length
FileID BigInt -
WorkDriveSync Var Char 255
FileName Var Char 255
UploadedTime Var Char 255
FileSize Int -
WorkDriveFileID Text -

Create these columns and configure the specified values. You can ignore the other properties of the columns.

The columns will be created and listed in the Schema View section.

catalyst_workdrive_columns_created

Configure Scopes and Permissions

Catalyst Data Store enables you to configure scopes and permissions for accessing each table by end users based on their user roles.

Because this application involves viewing, inserting, updating, and deleting rows from this table, we must enable all these permissions for the role App User. This will enable all authenticated users to perform these actions through the client application. They will be enabled for the role App Administrator by default.

Click the Scopes & Permissions tab, then enable all permissions for App User.

catalyst_workdrive_datastore_permissions

The Data Store is now configured for the application

Last Updated 2023-12-14 16:25:23 +0530 +0530

RELATED LINKS

Data Store