Skip to content

Commit 2ac7e85

Browse files
Merge pull request #34 from engineering87/develop
Add ArangoDB support
2 parents c323825 + c6106de commit 2ac7e85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1724
-340
lines changed

.github/workflows/commit-lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
on:
2+
push:
3+
branches:
4+
- '*' # Runs on any push to any branch
5+
pull_request:
6+
branches:
7+
- '*' # Runs on any pull request targeting any branch
8+
9+
name: Lint commits
10+
jobs:
11+
lint-commits:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
- name: Fixup git permissions
18+
shell: bash
19+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
20+
- uses: actions/[email protected]
21+
with:
22+
node-version: 20
23+
- name: Install commitlint dependencies
24+
run: npm install --save-dev @commitlint/cli @commitlint/config-conventional
25+
- name: Check commit messages
26+
run: npx commitlint --from HEAD~${{ github.event.pull_request.commits || 1 }} --to HEAD

.github/workflows/dotnet.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,29 @@ on:
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615

1716
steps:
1817
- uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
24+
- name: Install Commitlint dependencies
25+
run: npm install --save-dev @commitlint/config-conventional
26+
1927
- name: Setup .NET
2028
uses: actions/setup-dotnet@v4
2129
with:
2230
dotnet-version: 8.0.x
31+
2332
- name: Restore dependencies
2433
run: dotnet restore src/SharpConnector/SharpConnector.csproj
34+
2535
- name: Build
2636
run: dotnet build src/SharpConnector/SharpConnector.csproj --no-restore
37+
2738
- name: Test
2839
run: dotnet test src/SharpConnector.Tests/SharpConnector.Tests.csproj --no-build --verbosity normal

README.md

Lines changed: 98 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SharpConnector is a .NET library designed to streamline integration with NoSQL d
1414
## Features
1515

1616
- Unified interface for CRUD operations across various NoSQL databases.
17-
- Supports key-value stores (Redis, EnyimMemcached) and document-oriented databases (MongoDB, LiteDB, RavenDB, Couchbase).
17+
- Supports key-value stores (Redis, EnyimMemcached, DynbamoDb) and document-oriented databases (MongoDB, LiteDB, RavenDB, Couchbase).
1818
- Facilitates streamlined database operations without the need for custom connectors.
1919
- Simplified integration using configuration files and dependency injection.
2020
- Easy integration for various payload types.
@@ -33,24 +33,111 @@ SharpConnector offers a unified interface for performing CRUD operations on vari
3333
Through SharpConnector, you can use a consistent interface to perform Insert, Get, Delete, and Update operations across multiple NoSQL systems, currently supporting:
3434

3535
* **Redis (key-value)**
36-
* **MongoDB (document-oriented)**
36+
* **MongoDB (key-value or document-oriented)**
3737
* **LiteDB (embedded document database)**
3838
* **EnyimMemcached (key-value)**
3939
* **RavenDB (document-oriented)**
4040
* **Couchbase (document-oriented)**
41+
* **DynbamoDb (key-value or document-oriented)**
42+
* **ArangoDB (multi-model)**
4143

4244
SharpConnector thus simplifies the development process, providing flexibility and compatibility across diverse NoSQL paradigms without the need to handle specific database implementations.
4345

4446
### How to use it
45-
To get started with SharpConnector, configure your *connectionString* and specify the connector *instance* type.
46-
Then, add the ConnectorConfig node within your appsettings.json file. Here’s an example configuration for a Redis connector:
47-
47+
To get started with SharpConnector, configure the connector *instance* type.
48+
Then, add the specif `ConnectorConfig` node within your *appsettings.json* file:
49+
50+
- Redis
51+
```json
52+
{
53+
"ConnectorConfig": {
54+
"Instance": "Redis",
55+
"DatabaseNumber": 0,
56+
"ConnectionString": "redisServer:6380,password=password,ssl=True,abortConnect=False"
57+
}
58+
}
59+
```
60+
- MongoDb
61+
```json
62+
{
63+
"ConnectorConfig": {
64+
"Instance": "MongoDb",
65+
"DatabaseName": "test",
66+
"CollectionName": "test",
67+
"ConnectionString": "mongodb_connectionstring_here"
68+
}
69+
}
70+
```
71+
72+
- LiteDB
73+
```json
74+
{
75+
"ConnectorConfig": {
76+
"Instance": "LiteDb",
77+
"CollectionName": "test",
78+
"ConnectionString": "LiteDbTest.db"
79+
}
80+
}
81+
```
82+
83+
- Memcached
84+
```json
85+
{
86+
"ConnectorConfig": {
87+
"Instance": "Memcached",
88+
"ConnectionString": "127.0.0.1:11211"
89+
}
90+
}
91+
```
92+
93+
- RavenDB
94+
```json
95+
{
96+
"ConnectorConfig": {
97+
"Instance": "RavenDb",
98+
"DatabaseName": "test",
99+
"ConnectionString": "http://live-test.ravendb.net"
100+
}
101+
}
102+
```
103+
104+
- Couchbase
105+
```json
106+
{
107+
"ConnectorConfig": {
108+
"Instance": "Couchbase",
109+
"ConnectionString": "couchbase://localhost",
110+
"Username": "Administrator",
111+
"Password": "password",
112+
"BucketName": "example_bucket",
113+
}
114+
}
115+
```
116+
117+
- DynbamoDb
118+
```json
119+
{
120+
"ConnectorConfig": {
121+
"Instance": "DynamoDb",
122+
"AccessKey": "your-access-key-here",
123+
"SecretKey": "your-secret-key-here",
124+
"Region": "us-west-2",
125+
"ServiceUrl": "https://dynamodb.us-west-2.amazonaws.com",
126+
"UseHttp": false,
127+
"TableName": "MyTableName"
128+
}
129+
}
130+
```
131+
132+
- ArangoDB
48133
```json
49134
{
50135
"ConnectorConfig": {
51-
"Instance": "Redis",
52-
"DatabaseNumber": 0,
53-
"ConnectionString": "redisServer:6380,password=password,ssl=True,abortConnect=False"
136+
"Instance": "ArangoDb",
137+
"ConnectionString": "http://localhost:8529",
138+
"Username": "username",
139+
"Password": "password",
140+
"CollectionName": "test"
54141
}
55142
}
56143
```
@@ -95,8 +182,10 @@ Each of these libraries operates under a specific license, which governs its usa
95182
* **EnyimMemcached**, a C# Memcached client, see **license** [here](https://github.com/enyim/EnyimMemcached/blob/develop/LICENSE)
96183
* **RavenDB**, ACID Document Database, see **license** [here](https://github.com/ravendb/ravendb/blob/v6.2/LICENSE.txt)
97184
* **Couchbase**, the official Couchbase SDK for .NET Core and Full Frameworks, see **license** [here](https://github.com/couchbase/couchbase-net-client/blob/master/LICENSE)
185+
* **DynamoDb**, the official AWS SDK for .NET, see **license** [here](https://github.com/aws/aws-sdk-net/blob/main/License.txt)
186+
* **ArangoDB**, a consistent, comprehensive, minimal driver for ArangoDB, see **license** [here](https://github.com/ArangoDB-Community/arangodb-net-standard/blob/master/LICENSE)
98187

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

101190
### Contact
102-
Please contact at francesco.delre[at]protonmail.com for any details.
191+
Please contact at francesco.delre[at]protonmail.com for any details.

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
};

src/SharpConnector.Api/SharpConnector.Api.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<ItemGroup>
1111
<Content Remove="appsettings.couchbase.json" />
12+
<Content Remove="appsettings.dynamodb.json" />
1213
<Content Remove="appsettings.litedb.json" />
1314
<Content Remove="appsettings.memcached.json" />
1415
<Content Remove="appsettings.mongodb.json" />
@@ -17,6 +18,9 @@
1718
</ItemGroup>
1819

1920
<ItemGroup>
21+
<None Include="appsettings.dynamodb.json">
22+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
23+
</None>
2024
<None Include="appsettings.couchbase.json">
2125
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
2226
</None>
@@ -38,7 +42,7 @@
3842
</ItemGroup>
3943

4044
<ItemGroup>
41-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
45+
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.0.0" />
4246
</ItemGroup>
4347

4448
<ItemGroup>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"ConnectorConfig": {
3+
"Instance": "ArangoDb",
4+
"ConnectionString": "http://localhost:8529",
5+
"Username": "username",
6+
"Password": "password",
7+
"CollectionName": "test"
8+
}
9+
}

src/SharpConnector.Api/appsettings.couchbase.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
"SearchTimeout": 5000,
1414
"ManagementTimeout": 10000
1515
}
16-
}
16+
}
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"ConnectorConfig": {
3+
"Instance": "DynamoDb",
4+
"AccessKey": "your-access-key-here",
5+
"SecretKey": "your-secret-key-here",
6+
"Region": "us-west-2",
7+
"ServiceUrl": "https://dynamodb.us-west-2.amazonaws.com",
8+
"UseHttp": false,
9+
"TableName": "MyTableName"
10+
}
11+
}

src/SharpConnector.Api/appsettings.json

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
{
22
"ConnectorConfig": {
3-
"Instance": "Couchbase",
4-
"ConnectionString": "couchbase://localhost",
5-
"Username": "username",
6-
"Password": "password",
7-
"BucketName": "example_bucket",
8-
"Options": {
9-
"EnableTls": false,
10-
"KvTimeout": 2500,
11-
"QueryTimeout": 7500,
12-
"AnalyticsTimeout": 10000,
13-
"SearchTimeout": 5000,
14-
"ManagementTimeout": 10000
15-
}
3+
"Instance": "DynamoDb",
4+
"AccessKey": "your-access-key-here",
5+
"SecretKey": "your-secret-key-here",
6+
"Region": "us-west-2",
7+
"ServiceUrl": "https://dynamodb.us-west-2.amazonaws.com",
8+
"UseHttp": false,
9+
"TableName": "MyTableName"
1610
},
1711
"Logging": {
1812
"LogLevel": {

src/SharpConnector.Tests/SharpConnector.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
</PropertyGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
28+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
2929
<PackageReference Include="Moq" Version="4.20.72" />
30-
<PackageReference Include="MSTest.TestAdapter" Version="3.6.2" />
31-
<PackageReference Include="MSTest.TestFramework" Version="3.6.2" />
32-
<PackageReference Include="coverlet.collector" Version="6.0.2">
30+
<PackageReference Include="MSTest.TestAdapter" Version="3.8.3" />
31+
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
32+
<PackageReference Include="coverlet.collector" Version="6.0.4">
3333
<PrivateAssets>all</PrivateAssets>
3434
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3535
</PackageReference>

0 commit comments

Comments
 (0)