{"id":16226204,"url":"https://github.com/ghostdevv/mykv","last_synced_at":"2025-03-19T13:30:30.748Z","repository":{"id":37930723,"uuid":"364186380","full_name":"ghostdevv/MyKV","owner":"ghostdevv","description":"MyKV is a SQL Key - Value wrapper with some extra features.","archived":false,"fork":false,"pushed_at":"2023-07-11T09:23:39.000Z","size":1415,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T07:11:42.001Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostdevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ghostdevv","patreon":"onlyspaceghost","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://ghostdev.xyz/donate"}},"created_at":"2021-05-04T08:17:03.000Z","updated_at":"2022-05-04T15:15:46.000Z","dependencies_parsed_at":"2024-10-27T20:34:26.922Z","dependency_job_id":"2fa27039-9944-4b6f-bd5f-f6b1d679c22c","html_url":"https://github.com/ghostdevv/MyKV","commit_stats":{"total_commits":209,"total_committers":2,"mean_commits":104.5,"dds":0.3732057416267942,"last_synced_commit":"15f715bafa94aba4f6831f672be20abcac8f9e1d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2FMyKV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2FMyKV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2FMyKV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2FMyKV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostdevv","download_url":"https://codeload.github.com/ghostdevv/MyKV/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244434666,"owners_count":20452230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-10-10T12:48:27.046Z","updated_at":"2025-03-19T13:30:30.331Z","avatar_url":"https://github.com/ghostdevv.png","language":"TypeScript","readme":"# MyKV\n\n[![](https://img.shields.io/npm/v/mykv?label=Latest%20Version\u0026style=for-the-badge\u0026logo=npm\u0026color=informational)](https://www.npmjs.com/package/mykv)\n[![](https://img.shields.io/static/v1?label=Project%20Creator\u0026message=GHOST\u0026color=informational\u0026style=for-the-badge)](https://ghostdev.xyz)\n[![](https://img.shields.io/github/workflow/status/ghostdevv/mykv/Tests/main?style=for-the-badge)](https://github.com/ghostdevv/mykv)\n\nMyKV started out as a wrapper for only MySQL but with the power of knex we support most sql variations.\n\n# How to use/connect\n\nSee [knexjs connecting](https://knexjs.org/#Installation-client)\n\n```js\nconst { MyKV } = require('mykv');\n// or\nimport { MyKV } from 'mykv';\n\nconst db = new MyKV({\n    connection: {\n        host: '',\n        database: '',\n        username: '',\n        password: '',\n    }\n});\n\ndb.connect()\n    .then(() =\u003e console.log('Connected'))\n    .catch((e) =\u003e console.error(`Unable to connect: ${e.message}`));\n```\n\n# Methods\n\nThese are the methods used on your created db\n\n-   ### Get\n\n    `await db.get(key);`\u003cbr /\u003e\n\n    ```js\n    const item = await db.get('1234');\n    ```\n\n    TypeScript:\n\n    ```ts\n    interface Result {\n        id: string;\n        username: string;\n    }\n\n    const item = await db.get\u003cResult\u003e('1234');\n    ```\n\n-   ### Set\n\n    `await db.set(key, value);`\u003cbr /\u003e\n\n    ```js\n    await db.set('1234', { id: '1234', username: 'GHOST' });\n    ```\n\n-   ### Delete\n\n    `await db.del(key);`\u003cbr /\u003e\n\n    ```js\n    await db.del('1234');\n    ```\n\n-   ### Has\n\n    `await db.has(key);`\u003cbr /\u003e\n\n    ```js\n    const has = await db.has('1234'); // true or false\n    ```\n\n-   ### Clear\n\n    `await db.clear();`\u003cbr /\u003e\n\n    ```js\n    await db.clear();\n    ```\n\n-   ### Keys\n\n    `await db.keys(limit?: number);`\u003cbr /\u003e\n    Returns all keys in the db, you can optionally provide a limit of the number of keys returned\u003cbr /\u003e\n\n    ```js\n    const keys = await db.keys();\n    const tenKeys = await db.keys(10); // Optional limit\n    ```\n\n-   ### Values\n\n    `await db.values(limit?: number);`\u003cbr /\u003e\n    Returns all items in the db (without their keys), you can optionally provide a limit of the number of values returned\u003cbr /\u003e\n\n    ```js\n    const values = await db.values();\n    const tenValues = await db.values(10); // Optional limit\n    ```\n\n-   ### Entries\n\n    `await db.entries(limit?: number);`\u003cbr /\u003e\n    Returns all keys and values in an array, like [Map.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries)\u003cbr /\u003e\n\n    ```js\n    const entries = await db.entries();\n    const tenEntries = await db.entries(10); // Optional limit\n    ```\n\n# Support\n-   Join the [discord](https://discord.gg/2Vd4wAjJnm)\u003cbr\u003e\n-   Create a issue on the [github](https://github.com/ghostdevv/mykv)\n","funding_links":["https://github.com/sponsors/ghostdevv","https://patreon.com/onlyspaceghost","https://ghostdev.xyz/donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Fmykv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostdevv%2Fmykv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Fmykv/lists"}