Giter VIP home page Giter VIP logo

k-value's Introduction


Logo

K-Value

Node.js Map-like API based key-value storage with multiple persistent backend adapters.

Explore our Documentation »

Report Bug . Request Feature

Contributors Forks Stargazers Issues License

Table Of Contents

About The Project

Node.js Map-like API based key-value storage with multiple persistent backend adapters.

Join our Community Discord Server for real-time support and developer feedback.

Built With

The latest and greatest up-to-date technologies allow us to ensure that your project flows unhindered by upstream dependencies. With full strict testing protocol and release cycles, you can entrust your reliance on our technology stacks.

Getting Started

Getting started with any of our libraries is extremely easy! Just download the library from npm or even build it from source right with npm. You just plug it in and get to work.

Prerequisites

You'll obviously need the starting components of your project. This guide assumes that you already have an underlying project with Node.js installed and npm ready to use.

This package is officially compatible with Node.js v16.0.0 or higher, and NPM v7.24.2 or higher. Earlier versions of each may work, but are not officially supported and will not be delved into deeply for support should issues arise.

Installation

  1. Install the package with NPM using one of the two methods listed below.

    # Install from npmjs.org.
    > npm install k-value
    
    # Install from github.com and build from source. This method allows you to target commits, which is recommended for production pinning.
    > npm install git+https://github.com/amethyst-studio/k-value
  2. Require or Import the package in the method used by your language. Below are examples of both methods.

    const { MemoryAdapter, MySQLAdapter, PostgreSQLAdapter, SQLiteAdapter } = require('k-value');
    import { MemoryAdapter, MySQLAdapter, PostgreSQLAdapter, SQLiteAdapter } from 'k-value';

Usage

For examples of usage, please refer to the Documentation or GitHub Wiki.

If you need more assistance, please open a Discussion to chat with us or join our Community Discord Server for real-time support.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are absolutely appreciated.

If you have suggestions for adding or removing from the project, please open a discussion with us first to ensure the scope of the project is upheld. If you want to work on an issue, look for the "State: Help Wanted" label and leave a comment saying you are going to try and take it on!

Some tips for the smooth flow of contribution:

  1. Take a look at our Code of Conduct and Contributing Guidelines before starting to make your contributions. This will help smooth the workflow and adjustments needed to submitted contributions.
  2. Please make sure you check your spelling and grammar and ensure that your code is clean and formatted to the project standard (Airbnb).
  3. Ensure that you create an individual pull request for each suggestion. Lumping large changes together will require you to rework them into individual changes.

Creating A Pull Request

  1. Create a fork of the project.
  2. Check into your feature, fix, or refactor branch. The /issue_id is optional if no issue is related to this branch's work.
    1. git checkout -b feat/username/issue_id
    2. git checkout -b fix/username/issue_id
    3. git checkout -b refactor/username/issue_id
  3. Commit your changes incrementally, or as a single commit. Incremental commits are preferred for reviewability.
    1. git commit -m "feat: some new feature"
    2. git commit -m "fix: fixed some issue"
  4. Push to the branch you are working in.
    1. git push origin <branch_name_from_above>

Finally, open a pull request and fill out the supplied template. After that, one of our contributors will review or approve your changes. Following that, your contribution will land in a later commit once a release window is ready. Usually, this is within 5 days of the contribution being officially accepted.

License

Distributed under the MIT License. See LICENSE for more information.

Authors

  • Samuel Voeller - Organization Owner - Samuel Voeller - Initial Champion / Planner

Acknowledgements

k-value's People

Contributors

xcykrix avatar dependabot[bot] avatar

Stargazers

Daniel Newell avatar Willow (GHOST) avatar

Watchers

James Cloos avatar Patricio Silva avatar

k-value's Issues

[FEATURE] Allow selecting multiple keys with the `Adapter#get` action,

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
Selecting multiple keys with an Adapter#get action to return multiple entries in an Array when present. Entries that do not exist will provide a response that explicitly states the lack of existance.

Describe alternatives you've considered
Wrapping multiple Adapter#get actions in one request, but using that can prove to be unintuitive and clunky to new users.

Additional context
Requires test modifications.
Requires adapter modifications.

Minor-level release.

[FEATURE] Single-Connector Caching

Is your feature request related to a problem? Please describe.
Data consistency for a single-connection application required calls for each request.

Describe the solution you'd like
Design a mode that will cache selected requests in memory, invalidating them on a set operation. This will only function consistently if only one application is connected to the database backend storage table or namespace. If the stored data changes, it will only be available until the cached items are manually invalidated or expire due to requests being routed to memory instead of the database and will not be merged correctly when #23 is implemented.

The purpose of this feature is to handle high loads on a single application service that may have a higher number of reading vs writing operations.

Feature requested by @ghostdevv

Describe alternatives you've considered
N/A

Additional context
N/A

[FEATURE] Add entries() and values() to adapters going forward.

Is your feature request related to a problem? Please describe.
SELECT * from 'table';
Fetch all keys and values, remove encoding, and return as an indexed list of [ ['key', 'value' ] pairs, and [ 'value1', 'value2' ]
Add option for limiting number of results for keys() entries() and value()

Describe the solution you'd like
Update api.ts and all current adapters to implement entries() and values()

Describe alternatives you've considered
The current solution is keys() and get(keys) to fetch all keys and values.

Additional context
N/A

[FEATURE] Merge Objects in Adapters

Is your feature request related to a problem? Please describe.
Requiring a full get and set to merge objects together.

Describe the solution you'd like
Add { merge: true } option to set to allow copying user input into the original stored value to allow simple updates. Perhaps instead of .set() use .update()

Describe alternatives you've considered
N/A

Additional context
N/A

[FEATURE] Redis Adapter

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
Internal Mapping Adapter for Redis

Describe alternatives you've considered
N/A

Additional context
keys("namespace:*") if return all index, will be fine. Otherwise, this will require some form of duplexing for keys and keys/value.
https://www.npmjs.com/package/redis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.