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.
SharpConnector provides access to CRUD operations to NoSQL databases with <Key, Value>, abstracting the interface from the implementation. Insert, Get, Delete, Update operations are currently exposed to the following databases:
- Redis
- MongoDB
- LiteDB
- EnyimMemcached
- RavenDB
other connectors and operations are under development.
To use SharpConnector simply configure the connectionString to the desired connector and the instance type. Add the ConnectorConfig node configuration within the appsettings.json file, here is the example for Redis connector:
{
"ConnectorConfig": {
"Instance": "Redis",
"DatabaseNumber": 0,
"ConnectionString": "redisServer:6380,password=password,ssl=True,abortConnect=False"
}
}
and instantiate a new client specifying the type of data (for example string):
SharpConnectorClient<string> client = new SharpConnectorClient<string>()
SharpConnector works with any object that is serializable.
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
SharpConnector source code is available under MIT License, see license in the source.
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
Please contact at francesco.delre[at]protonmail.com for any details.