losfair / mvsqlite

Distributed, MVCC SQLite that runs on FoundationDB.
https://github.com/losfair/mvsqlite/wiki
Apache License 2.0
1.35k stars 38 forks source link

feat: auto namespace creation #110

Closed 5cat closed 1 year ago

5cat commented 1 year ago

Implemented a solution for for #109 in mvstore so the creation happens at the server side.

I thought about doing it in the mvsqlite (client) side but I didnt know how to pass variables there and it looked messy when I thought about it.

The flag for the feature in mvstore is --auto-create-namespace, if someone want some clients using this features and others dont, they can run two instances of mvstore with different prefixes.

Tried my best to keep it minimal and mostly copy pasted stuff, not a rust expert so let me know if there is something wrong i made.

Also a side question, is there a way to get the ns_id with the information in the create_namespace function so I dont have to call lookup_nskey after create_namespace? I tried so hard to know where can I get the ns_id from the variables inside create_namespace but sadly I coudint without doing a txn.get inside create_namespace after the commit

5cat commented 1 year ago

Hey @losfair any update on this?

losfair commented 1 year ago

I temporarily removed mention of the auto-creation feature from readme because it is insecure (with data plane exposed to internet everyone can create namespaces) - we need to figure out a better security strategy here.