StreamStore.Sql.Sqlite
0.1.0
dotnet add package StreamStore.Sql.Sqlite --version 0.1.0
NuGet\Install-Package StreamStore.Sql.Sqlite -Version 0.1.0
<PackageReference Include="StreamStore.Sql.Sqlite" Version="0.1.0" />
paket add StreamStore.Sql.Sqlite --version 0.1.0
#r "nuget: StreamStore.Sql.Sqlite, 0.1.0"
// Install StreamStore.Sql.Sqlite as a Cake Addin #addin nuget:?package=StreamStore.Sql.Sqlite&version=0.1.0 // Install StreamStore.Sql.Sqlite as a Cake Tool #tool nuget:?package=StreamStore.Sql.Sqlite&version=0.1.0
StreamStore.Sql.Sqlite
SQLite backend database for StreamStore event stream library.
Installation
To install the package, you can use the following command from the command line:
dotnet add package StreamStore
dotnet add package StreamStore.Sql.Sqlite
or from Nuget Package Manager Console:
Install-Package StreamStore
Install-Package StreamStore.Sql.Sqlite
Usage
Storage
By default the library provisioning tables automatically, however you must create database or provide connection string to existing database.
If you want to create table manually, you can use the following script:
CREATE TABLE IF NOT EXISTS main.Events (
Id TEXT NOT NULL,
StreamId TEXT NOT NULL,
Timestamp datetime2 NOT NULL,
Revision INTEGER NOT NULL,
Data BLOB NOT NULL,
PRIMARY KEY (Id, StreamId)
);
CREATE INDEX IF NOT EXISTS main.ix_streams_stream_id ON Events(StreamId);
CREATE INDEX IF NOT EXISTS main.ix_streams_stream_revision ON Events(Revision);
CREATE UNIQUE INDEX IF NOT EXISTS main.ix_streams_stream_id_revision ON Events(StreamId, Revision);
Configuration
You can define configuration of the library in appsettings.json
file:
{
"ConnectionStrings": {
"StreamStore": "Data Source=streamstore.db" // Required
},
"StreamStore": { // Optional
"Sqlite": {
"SchemaName": "main", // Optional
"TableName": "Events", // Optional
"ProvisionSchema": true, // Optional
"ProfilingEnabled": false // Optional
}
}
}
Register in DI container
// Adding StreamStore
services.ConfigureStreamStore();
// Adding Sqlite stream database and getting configuration from appsettings.json
services.UseSqliteStreamDatabase(Configuration);
// Or configuring it manually
services
.ConfigureSqliteStreamDatabase()
.WithSchema("main")
.WithTableName("Events")
.ProvisioningSchema(true)
.EnableProfiling()
.Configure();
Use in application code
How to use StreamStore in your application code you can find on StreamStore page.
Example
You can find an example of usage in the StreamStore.Sql.Example project.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Dapper.Extensions.SQLite (>= 5.1.4)
- StreamStore.Contracts (>= 0.6.0)
- StreamStore.Sql (>= 1.0.0)
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 |
---|---|---|
0.1.0 | 82 | 10/20/2024 |