CloudFlareD1NetCoreTool 1.0.0

dotnet add package CloudFlareD1NetCoreTool --version 1.0.0
NuGet\Install-Package CloudFlareD1NetCoreTool -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CloudFlareD1NetCoreTool" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CloudFlareD1NetCoreTool --version 1.0.0
#r "nuget: CloudFlareD1NetCoreTool, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 86 5/20/2024

First version