SharpConnector 3.2.0
See the version list below for details.
dotnet add package SharpConnector --version 3.2.0
NuGet\Install-Package SharpConnector -Version 3.2.0
<PackageReference Include="SharpConnector" Version="3.2.0" />
<PackageVersion Include="SharpConnector" Version="3.2.0" />
<PackageReference Include="SharpConnector" />
paket add SharpConnector --version 3.2.0
#r "nuget: SharpConnector, 3.2.0"
#:package SharpConnector@3.2.0
#addin nuget:?package=SharpConnector&version=3.2.0
#tool nuget:?package=SharpConnector&version=3.2.0
SharpConnector
<img src="https://github.com/engineering87/SharpConnector/blob/main/sharpconnector_logo.jpg" width="300">
SharpConnector 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.
Features
- Unified interface for CRUD operations across various NoSQL databases.
- Supports key-value stores (Redis, EnyimMemcached) and document-oriented databases (MongoDB, LiteDB, RavenDB, Couchbase).
- Facilitates streamlined database operations without the need for custom connectors.
- Simplified integration using configuration files and dependency injection.
- Easy integration for various payload types.
- Allows extension with new connectors by implementing the IOperations interface.
Installation
You can install the library via the NuGet package manager with the following command:
dotnet add package SharpConnector
How it works
SharpConnector 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. Through SharpConnector, you can use a consistent interface to perform Insert, Get, Delete, and Update operations across multiple NoSQL systems, currently supporting:
- Redis (key-value)
- MongoDB (document-oriented)
- LiteDB (embedded document database)
- EnyimMemcached (key-value)
- RavenDB (document-oriented)
- Couchbase (document-oriented)
SharpConnector thus simplifies the development process, providing flexibility and compatibility across diverse NoSQL paradigms without the need to handle specific database implementations.
How to use it
To get started with SharpConnector, configure your connectionString and specify the connector instance type. Then, add the ConnectorConfig node within your appsettings.json file. Here’s an example configuration for a Redis connector:
{
"ConnectorConfig": {
"Instance": "Redis",
"DatabaseNumber": 0,
"ConnectionString": "redisServer:6380,password=password,ssl=True,abortConnect=False"
}
}
Once configured, create a new SharpConnector client, specifying the payload type (e.g., string):
SharpConnectorClient<string> client = new SharpConnectorClient<string>()
Alternatively, you can integrate SharpConnector client using dependency injection. Here’s how to register the SharpConnector service with a string payload type:
// Register the SharpConnector services with string payload type.
builder.Services.AddSharpConnectorServices<string>();
This setup provides flexibility in working with different payload types and makes SharpConnector easy to use within dependency injection configurations.
Contributing
Thank you for considering to help out with the source code! If you'd like to contribute, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you want to add new connectors, please follow these three rules:
- Each new connector must implement the IOperations interface.
- For each new connector the relevant UnitTest class must be present.
- Any third party libraries added in the code must be compatible with the MIT license, and the license must also be made explicit in the code.
- Setting up Git
- Fork the repository
- Open an issue if you encounter a bug or have a suggestion for improvements/features
Licensee
SharpConnector source code is available under MIT License, see license in the source.
External references
SharpConnector uses the following externals references:
- StackExchange.Redis see license here
- MongoDB.Driver see license here
- LiteDB see license here
- EnyimMemcached see license here
- RavenDB see license here
- Couchbase see license here
Contact
Please contact at francesco.delre[at]protonmail.com for any details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CouchbaseNetClient (>= 3.6.4)
- EnyimMemcachedCore (>= 3.2.4)
- LiteDB (>= 5.0.21)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Configuration.Json (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- MongoDB.Driver (>= 3.0.0)
- Newtonsoft.Json (>= 13.0.3)
- RavenDB.Client (>= 6.2.1)
- StackExchange.Redis (>= 2.8.16)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.