Skip to content

Commit 40d2f02

Browse files
committed
Merge branch 'develop' of https://github.com/engineering87/SharpConnector into develop
2 parents 8d2c02e + b825133 commit 40d2f02

File tree

1 file changed

+67
-25
lines changed

1 file changed

+67
-25
lines changed

README.md

Lines changed: 67 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,31 @@
1111

1212
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.
1313

14+
✅ Now targeting .NET 9.
15+
16+
## Table of Contents
17+
18+
- [Features](#features)
19+
- [Installation](#installation)
20+
- [How it works](#how-it-works)
21+
- [How to use it](#how-to-use-it)
22+
- [API Overview](#api-overview)
23+
- [Contributing](#contributing)
24+
- [Extending](#extending)
25+
- [License](#license)
26+
- [External References](#external-references)
27+
- [Contact](#contact)
28+
1429
## Features
1530

16-
- Unified interface for CRUD operations across various NoSQL databases.
17-
- Supports key-value stores (Redis, EnyimMemcached, DynbamoDb) and document-oriented databases (MongoDB, LiteDB, RavenDB, Couchbase).
18-
- Facilitates streamlined database operations without the need for custom connectors.
19-
- Simplified integration using configuration files and dependency injection.
20-
- Easy integration for various payload types.
21-
- Allows extension with new connectors by implementing the IOperations interface.
31+
- A single, generic client API for CRUD across multiple NoSQL engines
32+
- Supported stores:
33+
- Key–value: Redis, EnyimMemcached, DynamoDb
34+
- Document: MongoDB, LiteDB, RavenDB, Couchbase
35+
- Multi-model: ArangoDB
36+
- Simple configuration via `appsettings.json` and DI-friendly
37+
- Sync and async operations (with CancellationToken support)
38+
- Easy to extend: implement `IOperations<T>` for new connectors
2239

2340
## Installation
2441

@@ -38,7 +55,7 @@ Through SharpConnector, you can use a consistent interface to perform Insert, Ge
3855
* **EnyimMemcached (key-value)**
3956
* **RavenDB (document-oriented)**
4057
* **Couchbase (document-oriented)**
41-
* **DynbamoDb (key-value or document-oriented)**
58+
* **DynamoDb (key-value or document-oriented)**
4259
* **ArangoDB (multi-model)**
4360

4461
SharpConnector thus simplifies the development process, providing flexibility and compatibility across diverse NoSQL paradigms without the need to handle specific database implementations.
@@ -114,7 +131,7 @@ Then, add the specif `ConnectorConfig` node within your *appsettings.json* file:
114131
}
115132
```
116133

117-
- DynbamoDb
134+
- DynamoDb
118135
```json
119136
{
120137
"ConnectorConfig": {
@@ -156,23 +173,48 @@ builder.Services.AddSharpConnectorServices<string>();
156173
```
157174
This setup provides flexibility in working with different payload types and makes SharpConnector easy to use within dependency injection configurations.
158175

159-
### Contributing
160-
Thank you for considering to help out with the source code!
161-
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.
162-
If you want to add new connectors, please follow these three rules:
163-
164-
1) Each new connector must implement the **IOperations** interface.
165-
2) For each new connector the relevant **UnitTest** class must be present.
166-
3) 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.
167-
168-
* [Setting up Git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git)
169-
* [Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
170-
* [Open an issue](https://github.com/engineering87/SharpConnector/issues) if you encounter a bug or have a suggestion for improvements/features
171-
172-
### License
176+
## API Overview
177+
The main entry point is the generic `ISharpConnectorClient<T>`:
178+
- `T Get(string key)`
179+
- `Task<T> GetAsync(string key, CancellationToken ct = default)`
180+
- `IEnumerable<T> GetAll()`
181+
- `Task<IEnumerable<T>> GetAllAsync(CancellationToken ct = default)`
182+
- `bool Insert(string key, T value)`
183+
- `bool Insert(string key, T value, TimeSpan expiration)`
184+
- `Task<bool> InsertAsync(string key, T value, CancellationToken ct = default)`
185+
- `Task<bool> InsertAsync(string key, T value, TimeSpan expiration, CancellationToken ct = default)`
186+
- `bool InsertMany(Dictionary<string,T> values)`
187+
- `bool InsertMany(Dictionary<string,T> values, TimeSpan expiration)`
188+
- `Task<bool> InsertManyAsync(IEnumerable<T> values, CancellationToken ct = default)`
189+
- `bool Update(string key, T value)`
190+
- `Task<bool> UpdateAsync(string key, T value, CancellationToken ct = default)`
191+
- `bool Delete(string key)`
192+
- `Task<bool> DeleteAsync(string key, CancellationToken ct = default)`
193+
- `bool Exists(string key)`
194+
- `Task<bool> ExistsAsync(string key, CancellationToken ct = default)`
195+
- `IEnumerable<T> Query(Func<T,bool> filter)`
196+
- `Task<IEnumerable<T>> QueryAsync(Func<T,bool> filter, CancellationToken ct = default)`
197+
198+
## Contributing
199+
Thanks for considering a contribution! Please fork, branch, and open a PR.
200+
- Add unit tests for new features or connectors
201+
- Keep third-party dependencies compatible with MIT and document their licenses
202+
- Useful links:
203+
- [Setting up Git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git)
204+
- [Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
205+
- [Open an issue](https://github.com/engineering87/SharpConnector/issues) if you encounter a bug or have a suggestion for improvements/features
206+
207+
## Extending
208+
To add a new connector:
209+
- Implement `IOperations<T>` for your backend.
210+
- Provide a wrapper/access layer (connection management, collection/table handles).
211+
- Add configuration binding under ConnectorConfig.
212+
- Include unit tests.
213+
214+
## License
173215
SharpConnector source code is available under MIT License, see license in the source.
174216

175-
#### External References
217+
### External References
176218
The SharpConnector library relies on several third-party libraries to deliver advanced functionality.
177219
Each 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:
178220

@@ -187,5 +229,5 @@ Each of these libraries operates under a specific license, which governs its usa
187229

188230
Each library is included to enhance the functionality of SharpConnector while adhering to its licensing terms.
189231

190-
### Contact
191-
Please contact at francesco.delre[at]protonmail.com for any details.
232+
## Contact
233+
Please contact at francesco.delre[at]protonmail.com for any details.

0 commit comments

Comments
 (0)