GooseDBMS 1.4.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package GooseDBMS --version 1.4.11                
NuGet\Install-Package GooseDBMS -Version 1.4.11                
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="GooseDBMS" Version="1.4.11" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GooseDBMS --version 1.4.11                
#r "nuget: GooseDBMS, 1.4.11"                
#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 GooseDBMS as a Cake Addin
#addin nuget:?package=GooseDBMS&version=1.4.11

// Install GooseDBMS as a Cake Tool
#tool nuget:?package=GooseDBMS&version=1.4.11                

GooseDBMS

GooseDBMS. Free cloud DBMS based on Google products

<p align="center"> <img width="640" alt="github" src="https://github.com/gttrcr/GooseDBMS/assets/48126017/8cd57f03-a623-4230-96f0-22d830522e47"> </p>

GooseDMBS was created to get around the problem of building cloud database-based applications. The data entry takes place through the automatic sending of a Google form. The solution is particularly useful for all those push only applications such as MQTT or one-way communications (weather stations, IoT devices, sending status data, ...). The entire solution does not require writing specific code but only configuring a file.

Usings

using Goose;
using Goose.Type.Config;
using Goose.Type.DBMS;

Example of goose.json Configuration file

Consider the following configuration file

{
  "ClientSecretFilePath": "client_secret.json",
  "ApiKey": null,
  "Tables": [
    {
      "Name": "list_of_devices_table",
      "Columns": [
        {
          "Entry": 467582135,
          "Value": "device_number",
          "Key": "th38sjj2"
        },
        {
          "Entry": 545400028,
          "Value": "mac_address",
          "Key": "0vbcgdv3"
        }
      ],
      "FormID": "582ufbefRRJT4t28h65h26jJg-hjh83HHFH36j6j",
      "PrefilledFormID": "ghjrkelkjwTHSKHJR54y52yTSHETRH25u25u-w5j5ju5STs55",
      "Dynamic": {              // this is a dynamic object
        "Domain":"database",    // this field is just an example
        "Policy": "tutygh5753", // this field is just an example
        "ID": 676758920656      // this field is just an example
      }
    }
  ]
}
Key Value Optional?
ClientSecretFilePath path of the json client secret file YES
ApiKey google ApiKey YES
Tables list of table object NO
Tables.Name name of the table NO
Tables.Columns list of columns for every table NO
Tables.FormID id of the form corresponding to the table YES
Tables.PrefilledFormID id of the prefilled form for the form corresponding to the table NO
Tables.Columns.Entry entry number corresponding to the prefilled field of the form NO
Tables.Columns.Value string value of the column (column name) NO
Tables.Columns.Key string representing the question id of the form NO
Tables.Dynamic a dynamic object used to store everything you will need to use GooseDBMS YES

The configuration file can be automatically generated by a utility function in GooseDBMS. Consider the following example

Config.CreateConfig("goose_config.json",
                "client_secret.json",
                new List<string>() { "https://docs.google.com/forms/d/e/ghjrkelkjwTHSKHJR54y52yTSHETRH25u25u-w5j5ju5STs55/viewform?usp=pp_url&entry.5497120025=name&entry.223105871=surname" },
                new List<string>() { "582ufbefRRJT4t28h65h26jJg-hjh83HHFH36j6j" });

The static function GooseConfig.CreateConfig takes as arguments

  1. the path of the configuration json file you want for your GooseDBMS application
  2. the path of the json client secret file
  3. the list of prefilled url for every form
  4. the list of form id

Pay attention that in GooseDBMS, every form is a table. When the goose_config.json is saved, then GooseDBMS instance can be created.

User application (client)

In the case of client application, the user can only just push data to DB. So, ClientSecretFilePath and FormID should be null and just PrefilledFormID will be used to create the link to push data.

User goose = new("goose_config_new.json");  //instance of GooseDBMS user
goose.Insert("tablename", new List<string>() { "colum1 value", "column2 value" });  //this equivalent to: INSERT INTO tablename (name, surname) VALUES ('column1 value', 'column2 value')

Owner application (server)

In the case of server application or master application, the user is able to push and pull data to DB. So ClientSecretFilePath and FormID must be not null and valid to create a Google service able to read form body and responses. In any case, the data entered into the database cannot be modified in form response but soon there will be the possibility of replacing previous data with updated data so as to also implement the update functionality as in a real database.

Owner goose = new("goose_config_new.json");  //instance of GooseDBMS owner
GooseTable? gooseTable = goose.Select("SELECT * FROM tablename WHERE name = 'some name value'");  //literally the sql SELECT statement
Owner.Insert("tablename", new List<string>() { "colum1 value", "column2 value" });  //this equivalent to: INSERT INTO tablename (name, surname) VALUES ('column1 value', 'column2 value')

goose.DataReceivedCallback = (gooseDB, previousGooseDB, differenceGooseDB) =>  //callback triggered by new data on DB
{
    Console.WriteLine(differenceGooseDB);
};

GooseDBMS library

Pack with

rm -rf bin
rm -rf obj
dotnet pack -c Release
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.4.17 157 1/11/2024
1.4.16 165 1/9/2024
1.4.15 144 1/2/2024
1.4.14 124 12/21/2023
1.4.13 123 12/21/2023 1.4.13 is deprecated because it has critical bugs.
1.4.12 122 12/21/2023 1.4.12 is deprecated because it has critical bugs.
1.4.11 95 12/19/2023
1.4.10 100 12/19/2023