Notes/src/becca/entities/bblob.ts
2024-02-17 13:32:43 +02:00

35 lines
941 B
TypeScript

import { BlobRow } from "./rows";
// FIXME: Why this does not extend the abstract becca?
class BBlob {
static get entityName() { return "blobs"; }
static get primaryKeyName() { return "blobId"; }
static get hashedProperties() { return ["blobId", "content"]; }
blobId: string;
content: string | Buffer;
contentLength: number;
dateModified: string;
utcDateModified: string;
constructor(row: BlobRow) {
this.blobId = row.blobId;
this.content = row.content;
this.contentLength = row.contentLength;
this.dateModified = row.dateModified;
this.utcDateModified = row.utcDateModified;
}
getPojo() {
return {
blobId: this.blobId,
content: this.content,
contentLength: this.contentLength,
dateModified: this.dateModified,
utcDateModified: this.utcDateModified
};
}
}
export = BBlob;