Table of Contents

Struct StorageRevision

Namespace
Foundation.Data.Doublets.Cli
Assembly
Foundation.Data.Doublets.Cli.dll

Cheap fingerprint of a database file, used to answer "has anyone else written since I last looked?" without reparsing the database.

public readonly record struct StorageRevision : IEquatable<StorageRevision>
Implements
Inherited Members

Constructors

StorageRevision(long, long)

Cheap fingerprint of a database file, used to answer "has anyone else written since I last looked?" without reparsing the database.

public StorageRevision(long Length, long ModifiedTicks)

Parameters

Length long

Size of the database file in bytes (0 when it does not exist).

ModifiedTicks long

Last write time in UTC ticks (0 when the file does not exist).

Properties

Length

Size of the database file in bytes (0 when it does not exist).

public long Length { get; init; }

Property Value

long

ModifiedTicks

Last write time in UTC ticks (0 when the file does not exist).

public long ModifiedTicks { get; init; }

Property Value

long

Methods

HasChanged(string)

Whether databaseFilename has changed since this revision was taken.

public bool HasChanged(string databaseFilename)

Parameters

databaseFilename string

Returns

bool

Of(string)

Reads the current revision of databaseFilename. A missing file is reported as the default revision rather than an error, so a database can be fingerprinted before it is created.

public static StorageRevision Of(string databaseFilename)

Parameters

databaseFilename string

Returns

StorageRevision

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.