SqliteParser is a .NET class library to parse SQLite database .db
files using only binary file read operations.
using (var reader = new SqliteFileReader(dbFilePath))
{
reader.MasterTableRecordRead += (s, e) => Console.WriteLine($"{e.Record.Type}\t{e.Record.Name}\t{e.Record.TableName}\t{e.Record.RootPage}\t{e.Record.Sql}");
reader.ReadMasterTable();
}
using (var reader = new SqliteFileReader(dbFilePath))
{
reader.TableRecordRead += (s, e) =>
{
foreach (var field in e.Fields)
{
Console.Write($"{field.Value}\t");
}
Console.WriteLine();
};
reader.ReadTable(tableName);
}
using (var parser = new SqliteFileParser(dbFilePath))
{
parser.FieldRead += (s, e) =>
{
if (FieldType.String == e.Type)
{
Console.WriteLine(e.Value as String);
}
};
parser.Parse();
}
- Supports
SQLITE_UTF8
,SQLITE_UTF16LE
andSQLITE_UTF16BE
text encodings. - By default only blob sizes are reported. Set
ReportBlobSizesOnly
property tofalse
to receive blobs themselves.
SqliteParser
library is distributed under the MIT license.