https://github.com/ivmazurenko/finch
Database connection mapping extension methods generator
https://github.com/ivmazurenko/finch
Last synced: 6 months ago
JSON representation
Database connection mapping extension methods generator
- Host: GitHub
- URL: https://github.com/ivmazurenko/finch
- Owner: ivmazurenko
- Created: 2024-03-09T18:38:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T17:45:48.000Z (over 2 years ago)
- Last Synced: 2025-08-12T03:01:16.394Z (12 months ago)
- Language: C#
- Homepage:
- Size: 105 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- RSCG_Examples - https://github.com/ivmazurenko/finch
README
# Finch - database mapping extension methods source generator
## Introduction
Finch is c# source generator designed to simplify database interactions by generating concise extension methods for
database queries mappings.
## Getting Started
1. Install the Finch NuGet packages:
```bash
$ dotnet add package Finch.Abstractions
$ dotnet add package Finch.Generators
```
2. Mark the required type with an [attribute](https://github.com/ivmazurenko/Finch/tree/master/Finch.Abstractions) corresponding to your desired database:
```c#
[GenerateSqlserverConnectionExtensions]
public class TbUser
{
public int id { get; set; }
public string name { get; set; }
}
```
3. Use the extension method for your type:
```c#
var connection = new SqlConnection(connectionString);
var items = await connection.QueryAsync("select * from tb_user");
```
## Contribution
Contributions to Finch are welcome! If you encounter any issues or have ideas for improvement, feel free to open an
issue or submit a pull request on GitHub.
## License
Finch is licensed under the MIT License.