Skip to content

Commit bbd701a

Browse files
author
MPCoreDeveloper
committed
documentation updated
1 parent b37b5a9 commit bbd701a

File tree

1 file changed

+53
-6
lines changed

1 file changed

+53
-6
lines changed

README.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Build Status](https://github.com/MPCoreDeveloper/SharpCoreDB/workflows/CI/badge.svg)](https://github.com/MPCoreDeveloper/SharpCoreDB/actions)
66
[![codecov](https://codecov.io/gh/MPCoreDeveloper/SharpCoreDB/branch/master/graph/badge.svg)](https://codecov.io/gh/MPCoreDeveloper/SharpCoreDB)
77

8-
A lightweight, encrypted, file-based database engine for .NET that supports SQL operations with built-in security features. Perfect for time-tracking, invoicing, and project management applications.
8+
A lightweight, encrypted, file-based database engine for .NET 10 that supports SQL operations with built-in security features. Perfect for time-tracking, invoicing, and project management applications.
99

1010
## Quickstart
1111

@@ -77,10 +77,31 @@ var result = db.ExecuteSQL("SELECT * FROM users");
7777

7878
SharpCoreDB provides a SQL-compatible interface over encrypted file-based storage, with optional connection pooling and auto-maintenance features.
7979

80+
## Project Components
81+
82+
This repository contains several components:
83+
84+
- **SharpCoreDB**: Core database engine library
85+
- **SharpCoreDB.EntityFrameworkCore**: Entity Framework Core provider for SharpCoreDB
86+
- **SharpCoreDB.Extensions**: Additional extensions and utilities
87+
- **SharpCoreDB.Demo**: Console application demonstrating SharpCoreDB usage
88+
- **SharpCoreDB.Benchmarks**: Performance benchmarks comparing with SQLite and LiteDB
89+
- **SharpCoreDB.Tests**: Unit tests and integration tests
90+
8091
## Installation
8192

8293
Add the SharpCoreDB project to your solution and reference it from your application.
8394

95+
For the core database engine:
96+
```bash
97+
dotnet add package SharpCoreDB
98+
```
99+
100+
For Entity Framework Core support:
101+
```bash
102+
dotnet add package SharpCoreDB.EntityFrameworkCore
103+
```
104+
84105
## Usage
85106

86107
### Setting Up the Database
@@ -388,10 +409,36 @@ db.ExecuteSQL("CREATE INDEX idx_user_email ON users (email)");
388409

389410
// Create a unique index
390411
db.ExecuteSQL("CREATE UNIQUE INDEX idx_user_id ON users (id)");
412+
```
391413

392-
````````
414+
### Entity Framework Core Support
415+
416+
SharpCoreDB provides an Entity Framework Core provider for ORM-style database access:
417+
418+
```csharp
419+
using Microsoft.EntityFrameworkCore;
420+
using SharpCoreDB.EntityFrameworkCore;
421+
422+
// Install package: dotnet add package SharpCoreDB.EntityFrameworkCore
423+
424+
// Define your DbContext
425+
public class MyDbContext : DbContext
426+
{
427+
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
428+
{
429+
optionsBuilder.UseSharpCoreDB("Data Source=mydb.db;Password=MySecret123");
430+
}
431+
}
432+
433+
// Use it like any EF Core context
434+
using var context = new MyDbContext();
435+
context.Database.EnsureCreated();
436+
437+
var user = new User { Name = "Alice", Email = "alice@example.com" };
438+
context.Users.Add(user);
439+
context.SaveChanges();
440+
441+
var users = context.Users.Where(u => u.Name == "Alice").ToList();
442+
```
393443

394-
⚠️ **Current Implementation Notes**:
395-
- Optimized for DummyTimeProject and time-tracking use cases
396-
- Query execution leverages SharpCoreDB's native SQL engine
397-
- Some advanced EF Core features (lazy loading, change tracking optimization) use default implementations
444+
**Note**: The EF Core provider is in active development. Some advanced features like complex LINQ queries and lazy loading may use default implementations.

0 commit comments

Comments
 (0)