Skip to content

Commit 688efd5

Browse files
committed
fix: empty options for AttachmentTable
1 parent 6e874c1 commit 688efd5

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

packages/powersync-attachments/src/AbstractAttachmentQueue.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@ import {
22
AbstractPowerSyncDatabase,
33
Transaction,
44
} from "@journeyapps/powersync-sdk-common";
5-
import {
6-
EncodingType,
7-
ATTACHMENT_TABLE,
8-
StorageAdapter,
9-
AttachmentRecord,
10-
AttachmentState,
11-
} from "./definitions";
5+
import { ATTACHMENT_TABLE, AttachmentRecord, AttachmentState } from "./Schema";
6+
import { EncodingType, StorageAdapter } from "./StorageAdapter";
127

138
export interface AttachmentQueueOptions {
149
powersync: AbstractPowerSyncDatabase;

packages/powersync-attachments/src/definitions/Schema.ts renamed to packages/powersync-attachments/src/Schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ export class AttachmentTable extends Table {
3535
constructor(options?: AttachmentTableOptions) {
3636
super({
3737
...options,
38-
name: options.name ?? ATTACHMENT_TABLE,
38+
name: options?.name ?? ATTACHMENT_TABLE,
3939
columns: [
4040
new Column({ name: "filename", type: ColumnType.TEXT }),
4141
new Column({ name: "local_uri", type: ColumnType.TEXT }),
4242
new Column({ name: "timestamp", type: ColumnType.INTEGER }),
4343
new Column({ name: "size", type: ColumnType.INTEGER }),
4444
new Column({ name: "media_type", type: ColumnType.TEXT }),
4545
new Column({ name: "state", type: ColumnType.INTEGER }), // Corresponds to AttachmentState
46-
...(options.additionalColumns ?? []),
46+
...(options?.additionalColumns ?? []),
4747
],
4848
});
4949
}

packages/powersync-attachments/src/definitions/StorageAdapter.ts renamed to packages/powersync-attachments/src/StorageAdapter.ts

File renamed without changes.

packages/powersync-attachments/src/definitions/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
export * from "./definitions";
1+
export * from "./Schema";
2+
export * from "./StorageAdapter";
23

34
export * from "./AbstractAttachmentQueue";

0 commit comments

Comments
 (0)