https://github.com/kalilistic/fluentdapperlite
A small helper library to use with SQLite, Dapper, FluentMigrator, and AutoMapper.
https://github.com/kalilistic/fluentdapperlite
automapper dapper database fluentmigrator sqlite
Last synced: 2 months ago
JSON representation
A small helper library to use with SQLite, Dapper, FluentMigrator, and AutoMapper.
- Host: GitHub
- URL: https://github.com/kalilistic/fluentdapperlite
- Owner: kalilistic
- License: mit
- Created: 2023-09-09T00:13:12.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-27T03:05:50.000Z (4 months ago)
- Last Synced: 2025-01-08T01:38:23.739Z (4 months ago)
- Topics: automapper, dapper, database, fluentmigrator, sqlite
- Language: C#
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FluentDapperLite
[](https://www.nuget.org/packages/FluentDapperLite/)A small helper library to use with [SQLite](https://www.sqlite.org), [Dapper](https://github.com/DapperLib/Dapper), [FluentMigrator](https://github.com/fluentmigrator/fluentmigrator), and [AutoMapper](https://github.com/AutoMapper/AutoMapper).
## Features
- Provide SQLite FluentMigrator Runner with common PRAGMA settings and normalized version naming scheme.
- Provide base data repository class providing fundamental methods for data access with AutoMapper.
- Provide FluentMigrator & Dapper extensions for UInt16, UInt32, and UInt64 column types.
- Provide utility to check if a file is a valid SQLite database based on its binary signature.
- Provide FluentMigrator extensions for adding standard 'Id' and timestamp columns.## Example
```csharp
// Check if valid SQLite database
bool isValid = SQLiteFileValidator.IsValidDatabase(dataSource);// Run FluentMigrator to execute migrations found in calling assembly
SQLiteFluentMigratorRunner.Run(dataSource);// Build database connection
var databse = SQLiteDbConnectionBuilder.Build(dataSource);// Build mapper with AutoMapper profile
var mapper = new MapperConfiguration(cfg =>
{
cfg.AddProfile();
}).CreateMapper();// Build repository that inherits from BaseRepository
var myRepository = new MyRepository(database, mapper);
```