-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Hi all!
The following query error occurs when attempting to name the attachments table anything other than attachments
per this Readme.
[PowerSyncDatabase] [Error: [react-native-quick-sqlite] SQL execution error: no such table: attachments]
Ran into this issue when building out support for saving attachments to more than one storage bucket. I have two storage buckets named items
and `avatars and set my attachments table schemas with:
items: new AttachmentTable({
name: 'items',
}),
avatars: new AttachmentTable({
name: 'avatars',
})
And have set this.options.attachmentDirectoryName
in each related attachment queue class. But I still get the same error.
Looking at the source for @powersync/attachments
, I see that this line is hardcoded to always use the attachments
db table.
Updating it to this fixes the issue:
return this.options.attachmentDirectoryName || ATTACHMENT_TABLE;
Should I open a PR for this update?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request