Skip to content

Commit c95fae1

Browse files
committed
updating typos on readme
1 parent b11767a commit c95fae1

1 file changed

Lines changed: 54 additions & 55 deletions

File tree

README.md

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
21
<p align="center">
3-
<img src="https://github.com/proxfield/Proxfield.Extensions.Caching.SQLite/assets/7343019/967483a9-c62e-4730-99a3-5f1b1aa0e358" />
2+
<img src="https://github.com/proxfield/Proxfield.Extensions.Caching.SQLite/assets/7343019/967483a9-c62e-4730-99a3-5f1b1aa0e358" alt="Proxfield.Extensions.Caching.SQLite Logo" />
43
</p>
54

5+
# Proxfield.Extensions.Caching.SQLite
66

7+
The SQLite Caching Library is a layer for caching data on SQLite to be used as a secondary database in case of failures and network inconsistencies.
78

8-
The SQLite Caching Library is layer for caching data on SQLite to be used as a secondary database in case of failures and network inconsistences.
9+
This library is based on `Microsoft.Extensions.Caching.StackExchangeRedis` for memory caching, but uses SQLite as the data store. It serves as a persistent cache layer, leveraging `Microsoft.Data.Sqlite`.
910

1011
![GitHub License](https://img.shields.io/github/license/proxfield/Proxfield.Extensions.Caching.SQLite)
1112
![Actions](https://github.com/proxfield/Proxfield.Extensions.Caching.SQLite/actions/workflows/build.yml/badge.svg)
@@ -15,35 +16,30 @@ The SQLite Caching Library is layer for caching data on SQLite to be used as a s
1516

1617
## Packages
1718

18-
Packages and versions available at the Nuget Galery.
19-
19+
Packages and versions available at the Nuget Gallery.
2020

2121
| Package | Version | Downloads |
2222
| - | - | - |
23-
| <b>Proxfield.Extensions.Caching.SQLite</b> | [![Nuget version](https://img.shields.io/nuget/v/Proxfield.Extensions.Caching.SQLite)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite/) | [![Nuget downloads](https://img.shields.io/nuget/dt/Proxfield.Extensions.Caching.SQLite)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite/) |
24-
| <b>Proxfield.Extensions.Caching.SQLite.DependencyInjection</b> | [![Nuget version](https://img.shields.io/nuget/v/Proxfield.Extensions.Caching.SQLite)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite.DependencyInjection/) | [![Nuget downloads](https://img.shields.io/nuget/dt/Proxfield.Extensions.Caching.SQLite.DependencyInjection)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite.DependencyInjection/) |
23+
| **Proxfield.Extensions.Caching.SQLite** | [![Nuget version](https://img.shields.io/nuget/v/Proxfield.Extensions.Caching.SQLite)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite/) | [![Nuget downloads](https://img.shields.io/nuget/dt/Proxfield.Extensions.Caching.SQLite)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite/) |
24+
| **Proxfield.Extensions.Caching.SQLite.DependencyInjection** | [![Nuget version](https://img.shields.io/nuget/v/Proxfield.Extensions.Caching.SQLite)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite.DependencyInjection/) | [![Nuget downloads](https://img.shields.io/nuget/dt/Proxfield.Extensions.Caching.SQLite.DependencyInjection)](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite.DependencyInjection/) |
2525

26-
## Nuget
26+
## Installation
2727

2828
```bash
2929
PM> Install-Package Proxfield.Extensions.Caching.SQLite
3030
```
3131

32-
For application who uses Microsoft.Extensions.DependencyInjection there is a package available for using the library with DI:
32+
For applications using `Microsoft.Extensions.DependencyInjection`, use the DI package:
3333

3434
```bash
3535
PM> Install-Package Proxfield.Extensions.Caching.SQLite.DependencyInjection
3636
```
3737

38-
Visit out project at the [Nuget Repository Page](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite) to know more.
39-
40-
## How
41-
42-
This caching library is based on the "Microsoft.Extensions.Caching.Redis" for memory caching, but instead of using Redis it uses the SQLite as a data layer. The ideia is to be a library for persistence cache in case of failures. This library uses the "Microsoft.Data" and acts as a layer above the SQLite.
38+
Visit the [Nuget Repository Page](https://www.nuget.org/packages/Proxfield.Extensions.Caching.SQLite) to learn more.
4339

4440
## Usage
4541

46-
The initialization can be either by using Microsoft's dependency injection or a common initialization.
42+
Initialization can be done via standard instantiation or through Dependency Injection.
4743

4844
### Common Initialization
4945

@@ -62,88 +58,91 @@ services.AddSQLiteCache(options => {
6258
});
6359
```
6460

65-
### Database file location
66-
If the `options.Location` is not provided the database will be stored on the
67-
same folder as the projet which implement the library is running.
61+
### Configuration
62+
63+
#### Database File Location
64+
65+
If `options.Location` is not provided, the database will be stored in the same folder as the running application.
6866

67+
#### Encryption
6968

70-
### Encryption
71-
To enable the encryption of all the data on the caching database one's just need to set the `UseEncryption` to `true` and set the `EncryptionKey` to any string, as shown bellow:
69+
To enable data encryption, set `UseEncryption` to `true` and provide an `EncryptionKey`:
7270

7371
```csharp
7472
services.AddSQLiteCache(options => {
7573
options.UseEncryption = true;
76-
options.EncryptionKey = "d5644e8105ad77c3c3324ba693e83d8fffd54950"
74+
options.EncryptionKey = "d5644e8105ad77c3c3324ba693e83d8fffd54950";
7775
});
7876
```
7977

80-
## Cache Methods available
78+
## Caching Methods
8179

82-
The caching can be recorded/retrieved as a simple string
80+
Data can be stored/retrieved as simple strings or complex objects.
81+
82+
### Basic Usage
8383

8484
```csharp
85+
// Store as string
8586
this.cache.SetAsString("users/1", "jose");
86-
var user = this.cache.GetAsString("users/1");
87-
```
88-
89-
Or either as a complex object:
87+
var userName = this.cache.GetAsString("users/1");
9088

91-
```csharp
89+
// Store as object
9290
this.cache.SetAsObject<User>("users/1", new User() { Name = "Jose" });
9391
var user = this.cache.GetAsObject<User>("users/1");
9492
```
9593

96-
The following list constains all caching methods avaliable currently on the library.
97-
94+
### Available Methods
9895

9996
| Method | Description |
10097
| - | - |
101-
| byte[] Get(string key); | Retrieves a cached resource from the database |
102-
| Task<byte[]> GetAsync(string key); | Retrieves a cached resource from the database as async |
103-
| void Set(string key, byte[] value); | Sets a cached resource to the database |
104-
| Task SetAsync(string key, byte[] value); | Sets a cached resource to the database async |
105-
| void Remove(string key); | Removes a cached resource to the database |
106-
| Task RemoveAsync(string key); | Removes a cached resource to the database as async |
107-
| void SetAsString(string key, string value); | Sets an string into the the database |
108-
| void SetAsObject<T>(string key, T value); | Sets an object into the the database |
109-
| string GetAsString(string key); | Retrieves a string from the database |
110-
| T? GetAsObject<T>(string key); | Retrieves an object from the database |
111-
| List\<T\> GetAsObjectStartsWith<T>(this ISQLiteCache cache, string key) | Get a list of objects when the key starts with something |
112-
| List\<string\> GetAsStringStartsWith(this ISQLiteCache cache, string key) | Get a list of strings when the key starts with something |
98+
| `byte[] Get(string key)` | Retrieves a cached resource from the database. |
99+
| `Task<byte[]> GetAsync(string key)` | Retrieves a cached resource asynchronously. |
100+
| `void Set(string key, byte[] value)` | Sets a cached resource in the database. |
101+
| `Task SetAsync(string key, byte[] value)` | Sets a cached resource asynchronously. |
102+
| `void Remove(string key)` | Removes a cached resource from the database. |
103+
| `Task RemoveAsync(string key)` | Removes a cached resource asynchronously. |
104+
| `void SetAsString(string key, string value)` | Sets a string in the database. |
105+
| `void SetAsObject<T>(string key, T value)` | Sets an object in the database. |
106+
| `string GetAsString(string key)` | Retrieves a string from the database. |
107+
| `T? GetAsObject<T>(string key)` | Retrieves an object from the database. |
108+
| `List<T> GetAsObjectStartsWith<T>(this ISQLiteCache cache, string key)` | Gets a list of objects where the key starts with the specified string. |
109+
| `List<string> GetAsStringStartsWith(this ISQLiteCache cache, string key)` | Gets a list of strings where the key starts with the specified string. |
113110

114111
## Collections and Indexes
115112

116-
It is now possible to cache objects/strings by using an index, for example, the following code on a newly created database would save the object with the key as being <strong>vehicles/1</strong>.
113+
You can index cached objects/strings. For example, saving an object with key **vehicles/1**:
117114

118115
```csharp
119-
cache.SetAsObject("vehicles|", new { Name = "bycicle" }) ;
116+
cache.SetAsObject("vehicles/1", new { Name = "bicycle" });
120117
```
121118

122-
Making possible to query more than one object at once, every document on a collection.
119+
This makes it possible to query multiple objects at once (e.g., every document in a collection):
123120

124121
```csharp
125122
cache.GetAsObjectStartsWith<Vehicle>("vehicles");
126123
```
127124

128-
The following list constains all indexing methods avaliable currently on the library. They can be acessed by the Maintenance property of cache (<strong>cache.Maintenance.</strong>)
125+
### Index Management Methods
129126

127+
Accessed via `cache.Maintenance`.
130128

131129
| Method | Description |
132130
| - | - |
133-
| List\<SQLiteCacheIndex\> GetAllIndexes() | Returns all indexes on the database |
134-
| SQLiteCacheIndex? GetIndex(string name | Returns an index from the database |
135-
| void ClearAllIndexers() | Purge all indexes from the database |
136-
| void ResetIndex(string name, long? value = null) | Reset an index to an specific value |
131+
| `List<SQLiteCacheIndex> GetAllIndexes()` | Returns all indexes in the database. |
132+
| `SQLiteCacheIndex? GetIndex(string name)` | Returns a specific index. |
133+
| `void ClearAllIndexers()` | Purges all indexes from the database. |
134+
| `void ResetIndex(string name, long? value = null)` | Resets an index to a specific value. |
137135

138136
## Platform Support
139137

140-
SQLite Caching is compiled for the following versions of frameworks:
138+
SQLite Caching is compiled for:
141139

142-
- [X] DotNet 6
143-
- [x] DotNet 5
144-
- [x] DotNet Core 3.1
140+
- [x] .NET 6
141+
- [x] .NET 5
142+
- [x] .NET Core 3.1
145143

146144
## License
145+
147146
![GitHub License](https://img.shields.io/github/license/proxfield/Proxfield.Extensions.Caching.SQLite)
148147

149-
The MIT License ([MIT](LICENSE.md)) - Copyright (c) 2022-2023 Proxfield Consulting Group and its affiliates
148+
The MIT License ([MIT](LICENSE.md)) - Copyright (c) 2022-2023 Proxfield Consulting Group and its affiliates.

0 commit comments

Comments
 (0)