Repository navigation
Expand file tree
/
Copy pathDatabaseConstants.cs
More file actions
62 lines (51 loc) · 1.66 KB
/
Copy pathDatabaseConstants.cs
File metadata and controls
62 lines (51 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
namespace OutWit.Database.Core;
/// <summary>
/// Database format constants
/// </summary>
public static class DatabaseConstants
{
/// <summary>
/// Magic bytes identifying WitDB format (16 bytes)
/// </summary>
public static ReadOnlySpan<byte> MAGIC_BYTES => "WitDB Format 1\0\0"u8;
/// <summary>
/// Current format version (major.minor as ushort)
/// </summary>
public const ushort FORMAT_VERSION = 0x0101; // 1.1 - provider metadata grew to record cache, journal and cache size
/// <summary>
/// Default page size in bytes (4KB)
/// </summary>
public const int DEFAULT_PAGE_SIZE = 4096;
/// <summary>
/// Minimum supported page size
/// </summary>
public const int MIN_PAGE_SIZE = 512;
/// <summary>
/// Maximum supported page size
/// </summary>
public const int MAX_PAGE_SIZE = 65536;
/// <summary>
/// Size of the database file header in bytes
/// </summary>
public const int DATABASE_HEADER_SIZE = 128;
/// <summary>
/// Size of a page header in bytes
/// </summary>
public const int PAGE_HEADER_SIZE = 16;
/// <summary>
/// File extension for WitDatabase database files
/// </summary>
public const string FILE_EXTENSION = ".witdb";
/// <summary>
/// File extension for WAL (Write-Ahead Log) files
/// </summary>
public const string WAL_EXTENSION = ".witdb-wal";
/// <summary>
/// Default number of pages to cache in memory
/// </summary>
public const int DEFAULT_CACHE_SIZE = 1000;
/// <summary>
/// Page number indicating null/no page reference
/// </summary>
public const uint NULL_PAGE_NUMBER = 0;
}