{"id":21066087,"url":"https://github.com/levg34/typescript-nedb-orm","last_synced_at":"2025-05-16T03:31:35.430Z","repository":{"id":64799122,"uuid":"578297098","full_name":"levg34/typescript-nedb-orm","owner":"levg34","description":"ORM for @seald-io/nedb written in TypeScript","archived":false,"fork":false,"pushed_at":"2023-12-02T18:43:43.000Z","size":189,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-12T10:48:37.966Z","etag":null,"topics":["nedb","odm","orm","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/typescript-nedb-orm","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/levg34.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-12-14T18:08:06.000Z","updated_at":"2024-11-09T12:12:58.000Z","dependencies_parsed_at":"2023-10-03T21:53:08.595Z","dependency_job_id":"e3421ac8-e554-451a-b217-9642501b6f2b","html_url":"https://github.com/levg34/typescript-nedb-orm","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.13636363636363635","last_synced_commit":"e3f578d0507fbd4a3e3649b41d6f8254a8772483"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levg34%2Ftypescript-nedb-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levg34%2Ftypescript-nedb-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levg34%2Ftypescript-nedb-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levg34%2Ftypescript-nedb-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levg34","download_url":"https://codeload.github.com/levg34/typescript-nedb-orm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225402309,"owners_count":17468830,"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":["nedb","odm","orm","typescript"],"created_at":"2024-11-19T17:58:02.067Z","updated_at":"2024-11-19T17:58:02.824Z","avatar_url":"https://github.com/levg34.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typescript-nedb-orm\n\nORM for [@seald-io/nedb](https://github.com/seald/nedb) written in TypeScript\n\n[![E2E Tests](https://github.com/levg34/typescript-nedb-orm/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/levg34/typescript-nedb-orm/actions/workflows/e2e-tests.yml)\n[![Node.js CI](https://github.com/levg34/typescript-nedb-orm/actions/workflows/node.js.yml/badge.svg)](https://github.com/levg34/typescript-nedb-orm/actions/workflows/node.js.yml)\n[![codecov](https://codecov.io/gh/levg34/typescript-nedb-orm/graph/badge.svg?token=MDFK0S9ZBB)](https://codecov.io/gh/levg34/typescript-nedb-orm)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n![linter: ESLint](https://img.shields.io/badge/linter-ESLint-purple?logo=ESLint)\n\n## How to install\n\n```bash\nnpm install typescript-nedb-orm\n```\n\nor\n\n```bash\nyarn add typescript-nedb-orm\n```\n\nor\n\n```bash\npnpm add typescript-nedb-orm\n```\n\n## How to use\n\nCreate an objet extending ORM, parametrised with your class fields interface\n\nExample:\n\n```typescript\nimport { IID, ORM } from 'typescript-nedb-orm'\n\ninterface IPerson extends IID {\n    name: string\n    email: string\n}\n\nclass Person extends ORM\u003cIPerson\u003e implements IPerson {\n    name: string\n    email: string\n    constructor(person: IPerson) {\n        super(person)\n        this.name = person.name\n        this.email = person.email\n    }\n}\n```\n\nThen, you can use it.\n\nCreate your object as you would normaly:\n\n```typescript\nconst person = new Person({\n    name: 'Luc',\n    email: 'luc@luc.fr'\n})\n```\n\nSave your object:\n\n```typescript\nconst savedPerson: IPerson = await person.save()\n```\n\nFetch your objects in db:\n\n```typescript\nconst retrievedPersons: IPerson[] = await Person.find\u003cIPerson\u003e({\n    email: 'luc@luc.fr'\n})\n```\n\nDelete your object:\n\n```typescript\nawait person.delete()\n```\n\nUpdate your objects in db:\n\n```typescript\nconst updated: number = await Person.update\u003cIPerson\u003e(\n    {\n        name: 'Luc'\n    },\n    {\n        email: 'luc@new.fr'\n    }\n)\n```\n\nRemove your objects in db:\n\n```typescript\nconst removed: number = await Person.remove\u003cIPerson\u003e({\n    email: 'luc@new.fr'\n})\n```\n\nFind one object in db:\n\n```typescript\nconst found: IPerson | null = await Person.findOne\u003cIPerson\u003e({\n    name: 'Luc'\n})\n```\n\nFind an object by id in db:\n\n```typescript\nconst foundById: IPerson | null = await Person.findById\u003cIPerson\u003e('kpOBxczJlr2R5S68')\n```\n\nCount the number of objects in db:\n\n```typescript\nconst count: number = await Person.count\u003cIPerson\u003e()\n```\n\nHave fun! :)\n\n## Project Roadmap\n\nThis roadmap outlines the vision I have for the future of TypeScript-NEDB-ORM. It provides insights into my current focus and the improvements I'm planning. While I aim to stick to this roadmap, priorities might shift based on feedback and challenges that arise.\n\n### Planned Features \u0026 Improvements\n\n#### 1. **Support for Multiple Classes**\n\n**Issue**: [#2](https://github.com/levg34/typescript-nedb-orm/issues/2)\n\nDescription: I'm looking to enhance the ORM to allow usage with multiple classes. This would provide developers with more flexibility to create complex data structures and relationships.\n\nPossible Approaches:\n\n-   Using multiple databases (files) and maintaining a map of the databases within the ORM class.\n-   Having a single database system with a protected class keyword or other distinguishing parameters.\n\nI'm still considering the best approach to implement this. If you have any feedback or insights, your input would be invaluable. Please share your thoughts on the issue thread.\n\n### Future Considerations\n\n-   **Enhanced Documentation**: I plan to add more tutorials, examples (ready to run in StackBlitz), and in-depth guides.\n-   **Extended Query Capabilities**: Aiming to provide more tools and flexibility in data retrieval and manipulation.\n\n### Your Input Matters\n\nFeedback and ideas from the community are always welcome. If you have suggestions or want to contribute to a feature on the roadmap, please follow the contribution guidelines or open a new issue for discussion.\n\n## Contributing\n\nThank you for your interest in contributing to the TypeScript-NEDB-ORM! Contributions are valued and help enhance this project.\n\n### How to Contribute\n\n1. Fork the repository and create your branch from `main`.\n2. Clone the forked repository to your local machine.\n3. Install the required dependencies using `npm install`.\n4. Make your changes, following these coding style guidelines:\n    - No semicolon at the end of lines.\n    - Use single quotes instead of double quotes.\n    - Indent with 4 spaces for TS and JS files, and 2 spaces for JSON or HTML.\n    - You can run `npm run format` to format your code before pushing.\n5. Ensure that the code passes the coverage requirements:\n    - Add tests for the changes made.\n    - Run `npx jest -- --coverage` to check if the code passes the coverage requirements.\n6. Ensure that the code passes the linting requirements:\n    - Run `npm run lint`\n7. Update the documentation (`README.md`) to reflect your changes.\n8. Commit your changes and push them to your forked repository.\n9. Create a pull request to the `main` branch of the original repository.\n\n### Reporting Issues\n\nIf you encounter any issues or have suggestions, please [open an issue](https://github.com/levg34/typescript-nedb-orm/issues) on GitHub.\n\nThank you for your contributions! This project is maintained by one person, and your efforts are greatly appreciated.\n\n## License\n\nThis project is licensed under the [GNU General Public License v3.0 (GPLv3)](https://www.gnu.org/licenses/gpl-3.0.en.html) - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevg34%2Ftypescript-nedb-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevg34%2Ftypescript-nedb-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevg34%2Ftypescript-nedb-orm/lists"}