{"id":21670496,"url":"https://github.com/engineering87/sharpconnector","last_synced_at":"2026-03-11T15:14:20.103Z","repository":{"id":48322499,"uuid":"314794372","full_name":"engineering87/SharpConnector","owner":"engineering87","description":"A flexible solution that accelerates integrations with multiple NoSQL databases","archived":false,"fork":false,"pushed_at":"2025-06-30T17:09:20.000Z","size":533,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-06-30T18:25:05.123Z","etag":null,"topics":["arangodb","couchdb","dotnet","dotnet-standard","dynamodb","general-purpose","litedb","memcached","mongodb","nosql-databases","ravendb","redis"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/engineering87.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-21T11:18:57.000Z","updated_at":"2025-06-30T17:09:23.000Z","dependencies_parsed_at":"2024-08-22T11:06:09.187Z","dependency_job_id":"8f5c3e2c-a051-4251-85dd-946ab34b3883","html_url":"https://github.com/engineering87/SharpConnector","commit_stats":{"total_commits":28,"total_committers":4,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"acf3c6f38dc17ebca5abb361e7dfca63464aa84f"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/engineering87/SharpConnector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineering87%2FSharpConnector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineering87%2FSharpConnector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineering87%2FSharpConnector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineering87%2FSharpConnector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/engineering87","download_url":"https://codeload.github.com/engineering87/SharpConnector/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineering87%2FSharpConnector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263105375,"owners_count":23414641,"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":["arangodb","couchdb","dotnet","dotnet-standard","dynamodb","general-purpose","litedb","memcached","mongodb","nosql-databases","ravendb","redis"],"created_at":"2024-11-25T12:32:39.056Z","updated_at":"2026-03-11T15:14:20.098Z","avatar_url":"https://github.com/engineering87.png","language":"C#","readme":"# SharpConnector\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Nuget](https://img.shields.io/nuget/v/SharpConnector?style=plastic)](https://www.nuget.org/packages/SharpConnector)\n![NuGet Downloads](https://img.shields.io/nuget/dt/SharpConnector)\n[![issues - dotnet-design-patterns](https://img.shields.io/github/issues/engineering87/SharpConnector)](https://github.com/engineering87/SharpConnector/issues)\n[![Build](https://github.com/engineering87/SharpConnector/actions/workflows/dotnet.yml/badge.svg)](https://github.com/engineering87/SharpConnector/actions/workflows/dotnet.yml)\n[![stars - dotnet-design-patterns](https://img.shields.io/github/stars/engineering87/SharpConnector?style=social)](https://github.com/engineering87/SharpConnector)\n\n\u003cimg src=\"https://github.com/engineering87/SharpConnector/blob/main/sharpconnector_logo.jpg\" width=\"300\"\u003e\n\nSharpConnector is a .NET library designed to streamline integration with NoSQL databases. It provides a unified interface that simplifies database operations, eliminating the need to develop custom logic for each specific database connector. Since each NoSQL database has its own unique characteristics, such as being document-oriented or key-value-based, SharpConnector abstracts these differences, providing a consistent and simplified access layer to accelerate development.\n\n✅ Now targeting .NET 9.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n  - [How it works](#how-it-works)\n  - [How to use it](#how-to-use-it)\n- [API Overview](#api-overview)\n- [Contributing](#contributing)\n- [Extending](#extending)\n- [License](#license)\n- [External References](#external-references)\n- [Contact](#contact)\n\n## Features\n\n- A single, generic client API for CRUD across multiple NoSQL engines\n- Supported stores:\n\t- Key–value: Redis, EnyimMemcached, DynamoDb\n\t- Document: MongoDB, LiteDB, RavenDB, Couchbase\n\t- Multi-model: ArangoDB\n- Simple configuration via `appsettings.json` and DI-friendly\n- Sync and async operations (with CancellationToken support)\n- Easy to extend: implement `IOperations\u003cT\u003e` for new connectors\n\n## Installation\n\nYou can install the library via the NuGet package manager with the following command:\n\n```bash\ndotnet add package SharpConnector\n```\n\n### How it works\nSharpConnector offers a unified interface for performing CRUD operations on various types of NoSQL databases. While NoSQL databases often differ in their internal structures (e.g., key-value stores, document databases), this library abstracts these distinctions, enabling streamlined key-value-based CRUD operations.\nThrough SharpConnector, you can use a consistent interface to perform Insert, Get, Delete, and Update operations across multiple NoSQL systems, currently supporting:\n\n* **Redis (key-value)**\n* **MongoDB (key-value or document-oriented)**\n* **LiteDB (embedded document database)**\n* **EnyimMemcached (key-value)**\n* **RavenDB (document-oriented)**\n* **Couchbase (document-oriented)**\n* **DynamoDb (key-value or document-oriented)**\n* **ArangoDB (multi-model)**\n\nSharpConnector thus simplifies the development process, providing flexibility and compatibility across diverse NoSQL paradigms without the need to handle specific database implementations.\n\n### How to use it\nTo get started with SharpConnector, configure the connector *instance* type. \nThen, add the specif `ConnectorConfig` node within your *appsettings.json* file:\n\n- Redis\n\t```json\n\t{\n\t  \"ConnectorConfig\": {\n\t\t\"Instance\": \"Redis\",\n\t\t\"DatabaseNumber\": 0,\n\t\t\"ConnectionString\": \"redisServer:6380,password=password,ssl=True,abortConnect=False\"\n\t  }\n\t}\n\t```\n- MongoDb\n\t```json\n\t{\n\t  \"ConnectorConfig\": {\n\t\t\"Instance\": \"MongoDb\",\n\t\t\"DatabaseName\": \"test\",\n\t\t\"CollectionName\": \"test\",\n\t\t\"ConnectionString\": \"mongodb_connectionstring_here\"\n\t  }\n\t}\n\t```\n\t\n- LiteDB\n\t```json\n\t{\n\t  \"ConnectorConfig\": {\n\t\t\"Instance\": \"LiteDb\",\n\t\t\"CollectionName\": \"test\",\n\t\t\"ConnectionString\": \"LiteDbTest.db\"\n\t  }\n\t}\n\t```\n\n- Memcached\n\t```json\n\t{\n\t  \"ConnectorConfig\": {\n\t\t\"Instance\": \"Memcached\",\n\t\t\"ConnectionString\": \"127.0.0.1:11211\"\n\t  }\n\t}\n\t```\n\t\n- RavenDB\n\t```json\n\t{\n\t  \"ConnectorConfig\": {\n\t\t\"Instance\": \"RavenDb\",\n\t\t\"DatabaseName\": \"test\",\n\t\t\"ConnectionString\": \"http://live-test.ravendb.net\"\n\t  }\n\t}\n\t```\n\n- Couchbase\n\t```json\n\t{\n\t  \"ConnectorConfig\": {\n\t\t\"Instance\": \"Couchbase\",\n\t\t\"ConnectionString\": \"couchbase://localhost\",\n\t\t\"Username\": \"Administrator\",\n\t\t\"Password\": \"password\",\n\t\t\"BucketName\": \"example_bucket\",\n\t  }\n\t}\n\t```\n\n- DynamoDb\n\t```json\n\t{\n\t  \"ConnectorConfig\": {\n\t\t\"Instance\": \"DynamoDb\",\n\t\t\"AccessKey\": \"your-access-key-here\",\n\t\t\"SecretKey\": \"your-secret-key-here\",\n\t\t\"Region\": \"us-west-2\",\n\t\t\"ServiceUrl\": \"https://dynamodb.us-west-2.amazonaws.com\",\n\t\t\"UseHttp\": false,\n\t\t\"TableName\": \"MyTableName\"\n\t  }\n\t}\n\t```\n\n- ArangoDB\n\t```json\n\t{\n\t\t\"ConnectorConfig\": {\n\t\t\t\"Instance\": \"ArangoDb\",\n\t\t\t\"ConnectionString\": \"http://localhost:8529\",\n\t\t\t\"Username\": \"username\",\n\t\t\t\"Password\": \"password\",\n\t\t\t\"CollectionName\": \"test\"\n\t\t}\n\t}\n\t```\n\nOnce configured, create a new SharpConnector client, specifying the payload type (e.g., string):\n\n```csharp\nSharpConnectorClient\u003cstring\u003e client = new SharpConnectorClient\u003cstring\u003e()\n```\n\nAlternatively, you can integrate SharpConnector client using dependency injection. Here how to register the SharpConnector service with a simple string payload type:\n\n```csharp\n// Register the SharpConnector services with string payload type.\nbuilder.Services.AddSharpConnectorServices\u003cstring\u003e();\n```\nThis setup provides flexibility in working with different payload types and makes SharpConnector easy to use within dependency injection configurations.\n\n## API Overview\nThe main entry point is the generic `ISharpConnectorClient\u003cT\u003e`:\n- `T Get(string key)`\n- `Task\u003cT\u003e GetAsync(string key, CancellationToken ct = default)`\n- `IEnumerable\u003cT\u003e GetAll()`\n- `Task\u003cIEnumerable\u003cT\u003e\u003e GetAllAsync(CancellationToken ct = default)`\n- `bool Insert(string key, T value)`\n- `bool Insert(string key, T value, TimeSpan expiration)`\n- `Task\u003cbool\u003e InsertAsync(string key, T value, CancellationToken ct = default)`\n- `Task\u003cbool\u003e InsertAsync(string key, T value, TimeSpan expiration, CancellationToken ct = default)`\n- `bool InsertMany(Dictionary\u003cstring,T\u003e values)`\n- `bool InsertMany(Dictionary\u003cstring,T\u003e values, TimeSpan expiration)`\n- `Task\u003cbool\u003e InsertManyAsync(IEnumerable\u003cT\u003e values, CancellationToken ct = default)`\n- `bool Update(string key, T value)`\n- `Task\u003cbool\u003e UpdateAsync(string key, T value, CancellationToken ct = default)`\n- `bool Delete(string key)`\n- `Task\u003cbool\u003e DeleteAsync(string key, CancellationToken ct = default)`\n- `bool Exists(string key)`\n- `Task\u003cbool\u003e ExistsAsync(string key, CancellationToken ct = default)`\n- `IEnumerable\u003cT\u003e Query(Func\u003cT,bool\u003e filter)`\n- `Task\u003cIEnumerable\u003cT\u003e\u003e QueryAsync(Func\u003cT,bool\u003e filter, CancellationToken ct = default)`\n\n## Contributing\nThanks for considering a contribution! Please fork, branch, and open a PR.\n- Add unit tests for new features or connectors\n- Keep third-party dependencies compatible with MIT and document their licenses\n- Useful links:\n\t- [Setting up Git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git)\n\t- [Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)\n\t- [Open an issue](https://github.com/engineering87/SharpConnector/issues) if you encounter a bug or have a suggestion for improvements/features\n\n## Extending\nTo add a new connector:\n- Implement `IOperations\u003cT\u003e` for your backend.\n- Provide a wrapper/access layer (connection management, collection/table handles).\n- Add configuration binding under ConnectorConfig.\n- Include unit tests.\n\n## License\nSharpConnector source code is available under MIT License, see license in the source.\n\n### External References\nThe SharpConnector library relies on several third-party libraries to deliver advanced functionality. \nEach of these libraries operates under a specific license, which governs its usage. To ensure transparency and compliance, the libraries and their licenses are listed in this repository:\n\n* **StackExchange.Redis**, a General purpose redis client, see **license** [here](https://github.com/StackExchange/StackExchange.Redis/blob/main/LICENSE)\n* **MongoDB.Driver**, the Official C# .NET Driver for MongoDB, see **license** [here](https://github.com/mongodb/mongo-csharp-driver/blob/main/LICENSE.md)\n* **LiteDB**, a .NET NoSQL Document Store in a single data file, see **license** [here](https://github.com/mbdavid/LiteDB/blob/master/LICENSE)\n* **EnyimMemcached**, a C# Memcached client, see **license** [here](https://github.com/enyim/EnyimMemcached/blob/develop/LICENSE)\n* **RavenDB**, ACID Document Database, see **license** [here](https://github.com/ravendb/ravendb/blob/v6.2/LICENSE.txt)\n* **Couchbase**, the official Couchbase SDK for .NET Core and Full Frameworks, see **license** [here](https://github.com/couchbase/couchbase-net-client/blob/master/LICENSE)\n* **DynamoDb**, the official AWS SDK for .NET, see **license** [here](https://github.com/aws/aws-sdk-net/blob/main/License.txt)\n* **ArangoDB**, a consistent, comprehensive, minimal driver for ArangoDB, see **license** [here](https://github.com/ArangoDB-Community/arangodb-net-standard/blob/master/LICENSE)\n\nEach library is included to enhance the functionality of SharpConnector while adhering to its licensing terms.\n\n## Contact\nPlease contact at francesco.delre[at]protonmail.com for any details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineering87%2Fsharpconnector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineering87%2Fsharpconnector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineering87%2Fsharpconnector/lists"}