I am trying to create a mini database that may have to be dynamic in workers. I have a workers backend going and a couple kv namespaces. When the app is live I would like the ability to create a new space and then populate it or delete a namespace and its items. I know how to add, read and delete kv-pairs in existing namespaces within the script using NAMESPACE.get and so on. However I do not know how to create or delete a namespace within the script. I know I can go onto the workers dashboard or do it from wrangler CLI but I really need the application to make its own namespaces when its live.
How can I do this?
Was told to post here from webmaster.stackexchange.