MyOddWeb.Data.SQLiteServer
0.1.2.1
dotnet add package MyOddWeb.Data.SQLiteServer --version 0.1.2.1
NuGet\Install-Package MyOddWeb.Data.SQLiteServer -Version 0.1.2.1
<PackageReference Include="MyOddWeb.Data.SQLiteServer" Version="0.1.2.1" />
paket add MyOddWeb.Data.SQLiteServer --version 0.1.2.1
#r "nuget: MyOddWeb.Data.SQLiteServer, 0.1.2.1"
// Install MyOddWeb.Data.SQLiteServer as a Cake Addin #addin nuget:?package=MyOddWeb.Data.SQLiteServer&version=0.1.2.1 // Install MyOddWeb.Data.SQLiteServer as a Cake Tool #tool nuget:?package=MyOddWeb.Data.SQLiteServer&version=0.1.2.1
MyOddWeb.com SQLiteServer
A library to allow multiple applications/processes to share a single SQLite database
Why?
A common issue with SQLite is that, by design, only one process can connect to the database, while this is a perfectly normal use case, (and by design), there are some cases where more than one applications might want to share some data, (one does all the insert while another does the queries.)
Sample
Sample application
In the folder \console\
there is a sample application, start one or more instance of this app and you can run queries.
Application #1
var connection = new SQLiteServerConnection($"Data Source={source};Version=3;", Address, Port, Backlog, HeartBeatTimeOut);
connection.Open();
try
{
using (var command = new SQLiteServerCommand(s, connection))
{
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine($"\t{reader[0]}");
}
}
}
}
catch (SQLiteServerException e)
{
Console.WriteLine( e.Message );
}
connection.Close();
Application #2
Basically do the same thing...
var connection = new SQLiteServerConnection($"Data Source={source};Version=3;", Address, Port, Backlog, HeartBeatTimeOut);
connection.Open();
try
{
using (var command = new SQLiteServerCommand(s, connection))
{
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine($"\t{reader[0]}");
}
}
}
}
catch (SQLiteServerException e)
{
Console.WriteLine( e.Message );
}
connection.Close();
Performance
The initial tests showed that server was as fast as the default libraries, (but of course slower than the C++ library itself)
Data files are either similar speed or a tiny bit slower, (see the results below)
:memory:
datasource, is, of course, a lot slower.
Please see the performance app to run your own tests, \performance\SQLiteServerPerformance.sln
.
Past results
Todo
Performance
While 'similar' performance will never be achieved, I am aiming for a degradation of no more than 5%.
I am using the \performance\SQLiteServerPerformance.sln
application to run comparaison tests.
A couple of common SQLite commands are missing.
- <s>
BackupDatabase
</s> 0.1.2.1 - <s>
IsDBNull( idx )
</s> 0.1.1.0 - <s>
HasRows
</s> 0.1.1.0 - <s>
FieldCount
</s> 0.1.1.0 - <s>
GetName( idx )
</s> 0.1.1.0 - <s>
GetTableName( idx )
</s> 0.1.1.0
A little less important, (but still need to be added)
- <s>
GetBoolean( idx )
</s> 0.1.1.2 - <s>
GetGuid( idx )
</s> 0.1.2.1 - <s>
GetByte( idx )
</s> 0.1.2.1 - <s>
GetChar( idx )
</s> 0.1.2.1 GetDateTime( idx )
- <s>
GetDataTypeName( idx )
</s> 0.1.1.3 - <s>
GetDecimal( idx )
</s> 0.1.1.2 - <s>
GetDouble( idx )
</s> 0.1.1.0 - <s>
GetFloat( idx )
</s> 0.1.1.2 - <s>
NextResult()
</s> 0.1.1.3
Other
- Namepipe might be faster, need to investigate more.
- Create Nuget package
- Some code cleanup
- <s>
Performance testing/report.
</s> 0.1.1.0 - <s>
SQLiteServerConnection
should implementDbConnection
</s> 0.1.1.1 SQLiteServerCommand
should implementDbCommand
- Need to implement
DbCommand CreateDbCommand(){}
when this is done
- Need to implement
SqliteServerDataReader
should implementDbDataReader
- <s>
SQLiteServerTransaction
should implementDbTransaction
</s> 0.1.1.1
Acknowledgement
- sqlite.org (duh!)
- System.Data.SQLite
If I forgot someone, please let me know and I will gladly add them here 😃
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- System.Data.SQLite (>= 1.0.108)
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.2.1 | 1,032 | 6/19/2018 |