private convertBlobModelToDbModel()

in src/blob/persistence/SqlBlobMetadataStore.ts [3250:3285]


  private convertBlobModelToDbModel(blob: BlobModel): any {
    const contentProperties = this.convertBlobContentPropertiesToDbModel(
      blob.properties
    );

    const lease = this.convertLeaseToDbModel(new BlobLeaseAdapter(blob));
    return {
      accountName: blob.accountName,
      containerName: blob.containerName,
      blobName: blob.name,
      snapshot: blob.snapshot,
      blobType: blob.properties.blobType,
      blobSequenceNumber: blob.properties.blobSequenceNumber || null,
      isCommitted: blob.isCommitted,
      lastModified: blob.properties.lastModified,
      creationTime: blob.properties.creationTime || null,
      etag: blob.properties.etag,
      accessTier: blob.properties.accessTier || null,
      accessTierChangeTime: blob.properties.accessTierChangeTime || null,
      accessTierInferred: blob.properties.accessTierInferred || null,
      leaseBreakExpireTime: blob.leaseBreakTime || null,
      leaseExpireTime: blob.leaseExpireTime || null,
      leaseId: blob.leaseId || null,
      leasedurationNumber: blob.leaseDurationSeconds || null,
      leaseDuration: blob.properties.leaseDuration || null,
      leaseStatus: blob.properties.leaseStatus || null,
      leaseState: blob.properties.leaseState || null,
      ...lease,
      persistency: this.serializeModelValue(blob.persistency) || null,
      committedBlocksInOrder:
        this.serializeModelValue(blob.committedBlocksInOrder) || null,
      metadata: this.serializeModelValue(blob.metadata) || null,
      blobTags: this.serializeModelValue(blob.blobTags) || null,
      ...contentProperties
    };
  }