tigrisdata-archive / tigris-client-ts

TypeScript client for Tigris
https://www.tigrisdata.com/docs/sdkstools/typescript/
Apache License 2.0
15 stars 10 forks source link

Update operations do not allow object/array fields to be updated #271

Closed ovaistariq closed 1 year ago

ovaistariq commented 1 year ago

Given a class definition as follows:

  public id?: number;
  public name: string | undefined;
  public goal: string | undefined;
  public owner: string | undefined;
  public champion: string | undefined;
  public adminEmails: string[] | undefined;
  public habitsScheduleTemplate: WeeklyHabitTemplate | undefined;

  public constructor(init?: Partial<ProjectValues>) {
    Object.assign(this, init);
  }
}

It is not possible to do an update of the value of the field habitsScheduleTemplate. Trying to do an update as follows:

const update: UpdateQuery<Project> = {
          filter: {
            id: project.id,
          },
          fields: {
            name: projectUpdateRequest.name,
            goalDescription: projectUpdateRequest.goal,
            habitsScheduleTemplate: projectUpdateRequest.habitsScheduleTemplate,
          },
        };

Image

Is this because update fields are restricted to basic types:

export type FieldTypes = string | boolean | NumericType | BigInteger | Date;
ovaistariq commented 1 year ago

@leggetter found this issue as part of the development of https://github.com/leggetter/habitdabit

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.0.0-beta.38 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: