CloudFlareD1NetCoreTool 1.0.0
dotnet add package CloudFlareD1NetCoreTool --version 1.0.0
NuGet\Install-Package CloudFlareD1NetCoreTool -Version 1.0.0
<PackageReference Include="CloudFlareD1NetCoreTool" Version="1.0.0" />
paket add CloudFlareD1NetCoreTool --version 1.0.0
#r "nuget: CloudFlareD1NetCoreTool, 1.0.0"
// Install CloudFlareD1NetCoreTool as a Cake Addin #addin nuget:?package=CloudFlareD1NetCoreTool&version=1.0.0 // Install CloudFlareD1NetCoreTool as a Cake Tool #tool nuget:?package=CloudFlareD1NetCoreTool&version=1.0.0
What is this project about?
CloudFlareD1NetCoreTool is a class library implemented in c#. It contains several methods for the most common interactions between Cloudflare D1 and .Net apps.
Dependencies
In current version
- net8.0
How it works?
After installing the Nuget package we will be able to use the Handler class. Through this, the most common CRUD operations can be performed.
using CloudFlareD1NetCoreTool;
...
CRUD examples
Multiple Insert example
string database_id = "########################";
string account_id = "########################";
string bearer = "########################";
RequestParameters requestParameters = new RequestParameters(account_id, database_id, bearer);
Handler handler = Handler.GetInstance(requestParameters);
public class Names: CloudFlareD1NetCoreTool.IAR
{
public string Name { get; set; }
}
List<Names> names = new List<Names>();
names.Add(new Names() { Name = "Giorgio" });
names.Add(new Names() { Name = "Yolanda" });
var ss = await handler.Insert(names);
public async Task InsertListAsyn(List<User> users)
{
DataGather dg = DataGather.GetInstance(ConnectionString);
await dg.InsertListAsync(users);
}
Simple update example
We don't need to specify the name of the table if it matches the object type. Table must have a primary key
await handler.UpdateObject(new Names() { Id = "70b40e29-f95f-4b65-aeab-32a4b6d24bfc", Name = "Ariel" });
Delete range example
Removes a ragne of rows. The table must have a primary key
await handler.DeleteList(names);
Summary
Other examples can be found on GitHub.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 123 | 5/20/2024 |
First version