Skip to content

[Feature Request] Simple key-value lookup #253

Open

Description

@tacman

Great project, thanks for creating and sharing it.

My needs are pretty simple, I want a portable key/value lookup. I realize I can do this with sleek db already, but I'm wondering if there's an even more elegant way.

My psuedo-code for a web scraper, based on the way the Symfony cache interface works:

$url = 'http....';
$_id = md5($urll);
if (!$data = $store->findById($_id)) {
    $data['html'] = file_get_contents($url);
    $data['_id'] = $_id; 
    $store->insert($data);
}

Obviously, I can use a key and do a FindOneBy, but it seems like the experience would be optimized if the user can set their own key.

Activity

  1. Timu57 commented on May 15, 2023

    @Timu57
    Member

    Hi @tacman to ensure compatibility with SleekDB v1 we decided to not lift that restriction for now. Setting your own ID is a frequently requested feature. We will implement that with the next major update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions