Skip to content

Commit

Permalink
fix: empty options for AttachmentTable
Browse files Browse the repository at this point in the history
  • Loading branch information
Manrich121 committed Oct 31, 2023
1 parent 6e874c1 commit 688efd5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
9 changes: 2 additions & 7 deletions packages/powersync-attachments/src/AbstractAttachmentQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ import {
AbstractPowerSyncDatabase,
Transaction,
} from "@journeyapps/powersync-sdk-common";
import {
EncodingType,
ATTACHMENT_TABLE,
StorageAdapter,
AttachmentRecord,
AttachmentState,
} from "./definitions";
import { ATTACHMENT_TABLE, AttachmentRecord, AttachmentState } from "./Schema";
import { EncodingType, StorageAdapter } from "./StorageAdapter";

export interface AttachmentQueueOptions {
powersync: AbstractPowerSyncDatabase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export class AttachmentTable extends Table {
constructor(options?: AttachmentTableOptions) {
super({
...options,
name: options.name ?? ATTACHMENT_TABLE,
name: options?.name ?? ATTACHMENT_TABLE,
columns: [
new Column({ name: "filename", type: ColumnType.TEXT }),
new Column({ name: "local_uri", type: ColumnType.TEXT }),
new Column({ name: "timestamp", type: ColumnType.INTEGER }),
new Column({ name: "size", type: ColumnType.INTEGER }),
new Column({ name: "media_type", type: ColumnType.TEXT }),
new Column({ name: "state", type: ColumnType.INTEGER }), // Corresponds to AttachmentState
...(options.additionalColumns ?? []),
...(options?.additionalColumns ?? []),
],
});
}
Expand Down
2 changes: 0 additions & 2 deletions packages/powersync-attachments/src/definitions/index.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/powersync-attachments/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./definitions";
export * from "./Schema";
export * from "./StorageAdapter";

export * from "./AbstractAttachmentQueue";

0 comments on commit 688efd5

Please sign in to comment.