Skip to main content

Project Operations

The projects in Hexabase belong under a workspace. A single workspace can contain multiple projects.

Within a single project, there can be multiple datastores. A datastore is a set of tables where data is stored.

Retrieve all projects

Retrieve all projects in a workspace

const projects = await client.currentWorkspace!.projects();

Retrieve a specific project

Specify the project ID

const project = await client.currentWorkspace!.project('PROJECT_ID');

Create new project

To create a new project, execute project without any arguments.

const newProject = await client.currentWorkspace!.project();
project.name = {
ja: '新しいプロジェクト',
en: 'new project'
};

Save a project

To save a project, execute the save method.

await project.save();

Delete a project

To delete a project, execute the delete method.

await project.delete();

Execute project action scripts

To execute an action script (FaaS) configured for the project, use the execute method. The first argument is the action script ID, and the second argument is the parameters received through as_params.

const res = await project
.execute<{[key: string]: string}>('func', { a: 'b' });