br41nslug / directus-websocket-subscribe

An extension to subscribe to directus updates over a websocket.
MIT License
106 stars 13 forks source link

Collection does not exist in schema #18

Closed michalwolas closed 1 year ago

michalwolas commented 1 year ago

Hi I am trying to use this extension to get updates of items created in a collection over a web socket.

I used npm to install this extension..

I can connect to the websocket successfully but even with admin permissions I get "Collection does not exist in schema" image image

I tried different collections but I get the same result. Any idea what could be causing this?

cliqer commented 1 year ago

That is because you are using uppercase for your collection names, and this extension only works with lowercase named collections.

michalwolas commented 1 year ago

would you know of any work-around, or is the only solution to re-name my table?

cliqer commented 1 year ago

Unfortunately, directus does not support renaming collections, and as such, you are left with two options:

  1. Delete and recreate all your tables, making sure they are all lowercase
  2. Try to figure out which part in this extension reads the collections, remove any 'tolowercase' references and then recompile.

Maybe someone has a better solution, though I couldn't find any and re-created the database.

michalwolas commented 1 year ago

image looks like its in src/utils.ts I removed the .toLowerCase() and now it recognizes my collection names.

br41nslug commented 1 year ago

Lol I do consider it bad practice to use capitalization in databases but hey I'm not gonna start a new tabs vs spaces argument 😂