Filebase icon indicating copy to clipboard operation
Filebase copied to clipboard

Assigning unique ID's to a record

Open joemottershaw opened this issue 4 years ago • 3 comments

Don't know if I'm just missing something here, but in the readme, you mention:

// my user id
$userId = '92832711';

// get the user information by id
$item = $db->get($userId);

How would you actually go about creating that ID in a real world example? When you call$database->get('92832711'), is there some sort of auto incrementing ID stored somewhere in a separate record that you reference every time or is this up to us to generate ourselves?

I've written some wrappers and helper functions in my project for now that do this for me, but just wanted to know if there was a simpler way of having each record in a database directory unique like in a standard database.

Or are you using generating a UUID for each entry?

joemottershaw avatar Apr 03 '20 00:04 joemottershaw

@joemottershaw Currently you have to come up with your own ID, Filebase just stores the data. That is a good feature for the future though for auto-incrementing if we had that setting in place.

timothymarois avatar Apr 12 '20 18:04 timothymarois

https://github.com/tmarois/Filebase/pull/60

There is a WIP on this idea.

tsmgeek avatar Apr 13 '20 17:04 tsmgeek

@tsmgeek Good find there, I believe it originally had conflicts, but I'll look that over and see if it can be merged in.

timothymarois avatar Apr 13 '20 18:04 timothymarois