Simple.Sqlite
0.4.79
A simple to use SqliteWrapper
Install-Package Simple.Sqlite -Version 0.4.79
dotnet add package Simple.Sqlite --version 0.4.79
<PackageReference Include="Simple.Sqlite" Version="0.4.79" />
paket add Simple.Sqlite --version 0.4.79
SqliteWrapper
A very simple Sqlite wrapper to plug spiders with it
How to use:
// Create a new instance
SqliteDB db = new SqliteDB("myStuff.db");
// Create a DB Schema
db.CreateTables()
.Add<MyData>()
.Commit();
var d = new MyData()
{
//fill your object
};
// call INSERT
db.Insert(d);
// use GetAll to retrieve all data
var allData = db.GetAll<MyData>();
// Use queries to get back data
var allBobs = db.ExecuteQuery<MyData>("SELECT * FROM MyData WHERE MyName = @name ", new { name = "bob" });
What this library automates ?
Auto fill parameters
This library provides a Query operation similar to Dapper, it can return a query as an Enumerable of your class
var allData = db.GetAll<MyData>();
And supports objects (even anonymous) as parameters
var allBobs = db.ExecuteQuery<MyData>("SELECT * FROM MyData WHERE MyName = @name ", new { name = "bob" });
Also, it supports easy Insertion
var d = new MyData()
{
//fill your object
};
// call INSERT
db.Insert(d);
And a VERY efficient, transaction based BulkInsertion
MyData[] lotsOfData = getLotsOfData();
// call INSERT
db.BulkInsert(lotsOfData);
Tip: For multi-million insertion, 5k blocks are a good start point
Migration
This library has a very simple Migration tah can:
- Create new tables
- Add columns to existing tables
To update your db schema just call CreateTables() and add your classes with Add<T>
and then Commit()
// Create a new instance
SqliteDB db = new SqliteDB("myStuff.db");
// Create a DB Schema
var migrationResult = db.CreateTables()
.Add<MyData>()
.Commit();
A TableCommitResult
will be returned with all changes made
This command will not migrate DATA only the schema
You can make changes on the table definition before it commits with:
db.CreateTables()
.Add<MyData>()
.ConfigureTable(t => { /* change last added table here */ })
.Add<NextTable>()
.Commit();
SqliteWrapper
A very simple Sqlite wrapper to plug spiders with it
How to use:
// Create a new instance
SqliteDB db = new SqliteDB("myStuff.db");
// Create a DB Schema
db.CreateTables()
.Add<MyData>()
.Commit();
var d = new MyData()
{
//fill your object
};
// call INSERT
db.Insert(d);
// use GetAll to retrieve all data
var allData = db.GetAll<MyData>();
// Use queries to get back data
var allBobs = db.ExecuteQuery<MyData>("SELECT * FROM MyData WHERE MyName = @name ", new { name = "bob" });
What this library automates ?
Auto fill parameters
This library provides a Query operation similar to Dapper, it can return a query as an Enumerable of your class
var allData = db.GetAll<MyData>();
And supports objects (even anonymous) as parameters
var allBobs = db.ExecuteQuery<MyData>("SELECT * FROM MyData WHERE MyName = @name ", new { name = "bob" });
Also, it supports easy Insertion
var d = new MyData()
{
//fill your object
};
// call INSERT
db.Insert(d);
And a VERY efficient, transaction based BulkInsertion
MyData[] lotsOfData = getLotsOfData();
// call INSERT
db.BulkInsert(lotsOfData);
Tip: For multi-million insertion, 5k blocks are a good start point
Migration
This library has a very simple Migration tah can:
- Create new tables
- Add columns to existing tables
To update your db schema just call CreateTables() and add your classes with Add<T>
and then Commit()
// Create a new instance
SqliteDB db = new SqliteDB("myStuff.db");
// Create a DB Schema
var migrationResult = db.CreateTables()
.Add<MyData>()
.Commit();
A TableCommitResult
will be returned with all changes made
This command will not migrate DATA only the schema
You can make changes on the table definition before it commits with:
db.CreateTables()
.Add<MyData>()
.ConfigureTable(t => { /* change last added table here */ })
.Add<NextTable>()
.Commit();
Release Notes
Paired with commit d03e7bc
https://github.com/RafaelEstevamReis/SqliteWrapper
Dependencies
-
.NETCoreApp 3.1
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Data.SQLite.Core (>= 1.0.113.7)
-
.NETFramework 4.5
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Data.SQLite.Core (>= 1.0.113.7)
-
.NETStandard 2.0
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Data.SQLite.Core (>= 1.0.113.7)
-
net5.0
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Data.SQLite.Core (>= 1.0.113.7)
Used By
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Simple.Sqlite:
Package | Downloads |
---|---|
RafaelEstevam.Simple.Spider.SqliteStorage
Sqlite-based storage engine to the SimpleSpider
See examples and documentation on the GitHub page
|
GitHub repositories
This package is not used by any popular GitHub repositories.