succulent_SQLiteFramework 1.0.0
dotnet add package succulent_SQLiteFramework --version 1.0.0
NuGet\Install-Package succulent_SQLiteFramework -Version 1.0.0
<PackageReference Include="succulent_SQLiteFramework" Version="1.0.0" />
<PackageVersion Include="succulent_SQLiteFramework" Version="1.0.0" />
<PackageReference Include="succulent_SQLiteFramework" />
paket add succulent_SQLiteFramework --version 1.0.0
#r "nuget: succulent_SQLiteFramework, 1.0.0"
#:package succulent_SQLiteFramework@1.0.0
#addin nuget:?package=succulent_SQLiteFramework&version=1.0.0
#tool nuget:?package=succulent_SQLiteFramework&version=1.0.0
SQLite Framework
An extremely versatile framework for SQLite. This framework allows you to designate classes as a Schema or Template for your SQLite tables.
Limitations
- Any time you modify a tables parameters, such as adding a
public int accountAget {get; set;}
for example you will have to drop the table it is added to using an extension or app. - Nullable statements must be explicitly stated using the
DBEmpty
attribute
Creation
To create the database it requires some setup. In you program file you should put:
string path = @"Path/to/your/database/your_database_name.db";
SQLiteDatabase database = SQLiteDatabase.New(path,<use new on all of your tables. e.g (new TestEntry())>);
await database.ConnectAsync();
this will create the database and start it, after this you can start to use your database entries.
Table Methods
Please remember all of these functions WILL throw an error if they are not included in the SQLiteDatabase.New()
as you have not told the database that this is a table and it has not made a table for it.
- Exists (returns
true
if a entry with the specifiedid
exists)
SQLiteDatabaseTable.Exists<TestEntry>(<id>);
- Get (returns the table with the matching
id
, will throw an error if it doesn't exist (use in conjunction withSQLiteDatabaseTable.Exists
))
SQLiteDatabaseTable.Get<TestEntry>(<id>);
- GetAll (returns all entries under this table)
SQLiteDatabaseTable.GetAll<TestEntry>();
- Upload (throws an error if it already exists (its a default error due to non-unique id))
SQLiteDatabaseTable.Upload<TestEntry>(<testentry as a variable>);
- Update
SQLiteDatabaseTable.Update<TestEntry>(<testentry as a variable>);
- Delete (throws an error if it doesnt exist)
SQLiteDatabaseTable.Delete<TestEntry>(<testentry as a variable>);
Examples
First to use this package you need to designate a Template/Schema, the following are correct and incorrect examples
Incorrect Usage
public class TestEntry : SQLiteDatabaseTable
{
[DB_ID]
public string ID { get; set; }
public string Name { get; set; }
public string? nullableValue { get; set; } //This will cause an error as this value must be provided
public override TestEntry Clone() => (TestEntry)this.MemberwiseClone();
}
Correct Usage
public class TestEntry : SQLiteDatabaseTable
{
[DB_ID]
public string ID { get; set; }
public string Name { get; set; }
[DBEmpty] //This marks the property below it as nullable
public string? nullableValue { get; set; }
public override TestEntry Clone() => (TestEntry)this.MemberwiseClone();
}
Note:
There are a number of attributes used throughout, those being:
- DB_ID
- Marks the property below it as the ID of the table and is how you aquire this entry
- DBEmpty
- Marks the property as a value that can be null.
- DBEntryName
- Renames the table, usually the name of the class is what the table is called unless this value is provided in which it uses this one instead
- DBIgnore
- Marks that this value will be ignored during upload, update or get requests of this table
License
CC BY-SA 2.0
You are free to:
Share � copy and redistribute the material in any medium or format for any purpose, even commercially.
Adapt � remix, transform, and build upon the material for any purpose, even commercially.
Under the following terms:
Attribution � You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike � If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions � You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.EntityFrameworkCore.Sqlite (>= 8.0.10)
- 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 | 119 | 11/27/2024 |