Namespace Azos.Data
Classes
AbsentValue
Represents a special value that signifies the absence of any entity/state/value/data. The instances may be stored in a cache to indicate that the key exists, but points to a non-existing "absent" entity. This is useful for DB lookups, not to touch the backend for values that don't exist. Use AbsentValue.Instance singleton
AmorphousDynamicDoc
Represents a data document which has a schema only known at run-time that also implements IAmorphousData interface that allows this row to store "extra" data that does not comply with the current schema. Dynamic docs store data in object[] internally, providing better flexibility(ability to define schema at runtime) than TypedDocs at the expense of performance. This class is not sealed so implementors may override configuration persistence
AmorphousTypedDoc
Represents a type-safe data document when schema is known at compile-time that also implements IAmorphousData interface that allows this row to store "extra" data that does not comply with the current schema. Typed docs store data in instance fields, providing better performance and schema definition compile-time checking than DynamicDocs at the expense of inability to define schema at runtime
DataException
Base exception thrown by the data-related functionality
Doc
Base class for any data document. This class has two direct subtypes - DynamicDoc and TypedDoc. Documents are NOT THREAD SAFE by definition
DocEqualityComparer
Checks for document equality using doc.Equals() method. Use DocEqualityComparer.Instance
DocValidationException
Thrown by data document validation
DynamicDoc
Represents a data document having schema only known at run-time. Dynamic docs store data in object[] internally, providing better flexibility(ability to define schema at runtime) than TypedDocs at the expense of performance. This class is not sealed so implementors may override configuration persistence
ELink
Represents an Electronic Link which is an alpha-encoded identifier along with metadata information. Warning! This class MAY generate fragments of profanity, however any ID can be regenerated using a different seed passed to Encode(seed)
FieldAttribute
Provides information about table schema that this typed row is a part of
FieldValidationException
Thrown by data document field-level validation
Form
Represents a "model" (in MVC terms) of a data-entry form. Form models are statically typed - contain fields and can contain "extra amorphous" data
GDIDRangeComparer
Compares GDID regardless of authority. This is useful for range checking, when authorities generating GDIDs in the same range should be disregarded. Use GDIDRangeComparer.Instance. Only relative range comparison can be made. The Equality returned by this comparer can not be relied upon for GDID comparison as it disregards authority. Equality can only be tested for range comparison.
JSONMappings
Facilitates mapping of CRUD/CLR types/values to JSON and back to CLR/CRUD
ObjectValueConversion
Provides extension methods for converting object values to different scalar types
Rowset
Implements a rowset that supports row doc change logging and CRUD operations. Rowsets are not optimal for data replication as they perform linear search which is slow, however Rowset class supports sorting. In contrast, Tables are kind of rowsets that keep data pre-sorted by key thus facilitating quick searching
RowsetBase
Provides base for rowsets. Rowsets are mutable lists of documents where all documents(rows) must adhere to the same same schema (hence called "rows"), however a rowset may contain a mix of dynamic and typed documents as long as they have the same schema. Rowsets are not thread-safe
Schema
Describes a schema for data documents: TypedDocs and DynamicDocs. DynamicDocs are "shaped" in memory from schema, whereas, TypedDocs define schema. Schema for TypedDocs is cached in static dictionary for speed
Schema.FieldDef
Provides a definition for a single field of a row
StringValueConversion
Provides extension methods for converting string values to different scalar types
Table
Implements a master table. Tables are rowsets that are pre-sorted by keys. They are used in scenarios when in-memory data replication is needed. A table supports efficient FindKey() operation but does not support sorting. This class is not thread-safe.
TableAttribute
Provides information about table schema that this row is a part of
TargetedAttribute
Provides a base for attributes which are targeted for particular technology (e.g. "ORACLE", "RIAK" etc.)
TypedDoc
Represents a type-safe data document with schema known at compile-time. Typed docs store data in instance fields, providing better performance and schema definition compile-time checking than DynamicDocs at the expense of inability to define schema at runtime
UniqueSequenceAttribute
Provides information for unique sequence gen: scope and name
ValidationException
Thrown by dataclasses when validation does not pass
Structs
DocChange
Describes data document modification
GDID
Represents a Global Distributed ID key (key field) used in distributed databases that identify entities with a combination of unsigned 32 bit integer 'Era' and unsigned 64 bit integer 'ID'. The first 32 bit integer is an 'era' in which the 'ID' (64 bit) was created, consequently a GDID is a 12 byte = 96 bit integer that can hold 2^96 = 79,228,162,514,264,337,593,543,950,336 combinations. The ID consists of two segments: 4 bit authority + 60 bits counter. Authority segment occupies the most significant 4 bits of uint64, so the system may efficiently query the data store to identify the highest stored ID value in a range. Authorities identify one of 16 possible ID generation sources in the global distributed system, therefore ID duplications are not possible between authorities. Within a single era, GDID structure may identify 2^60 = 1,152,921,504,606,846,976(per authority) * 16(authorities) = 2^64 = 18,446,744,073,709,551,616 total combinations. Because of such a large number of combinations supported by GDID.ID alone (having the same Era), some systems may always use Era=0 and only store the ID part (i.e. as UNSIGNED BIGINT in SQL datastores). Note GDID.Zero is never returned by generators as it represents the absence of a value (special value)
GDIDSymbol
Represents a tuple of GDID and its symbolic representation (framework usualy uses an ELink as symbolic representation). This struct is needed to pass GDID along with its ELink representation together. Keep in mind that string poses a GC load, so this stuct is not suitable for beiing used as a pile cache key
UpdateResult
Interfaces
IAmorphousData
Denotes an entity, which is typically a row-derivative, that has extra data fields that are not defined by particular schema and get represented as {name:value} map instead (schema-less data). This interface is usually implemented by rows that support version changing between releases, i.e. when structured storage (such as Mongo DB) stores more fields than are currently declared in the row the extra fields will be placed in the AmorphousData collection. This interface also provides hook BeforeSave()/AfterLoad() that allow for transforms between Amorphous and "hard-schema" data models
ICacheParams
Supplies caching params
IValidatable
Denotes an entity that supports validation
Enums
CharCase
Types of char casing
ConvertErrorHandling
Specifies how to handle errors during object value conversion
DataKind
Provides hint/classification for field textual data
DocChangeType
Describes what kind of modification was done
FormMode
Denotes form modes: unspecified | insert | edit
ObjectValueConversion.TriStateBool
A "hack" enum used to provide tri-state checkbox functionality in some systems, i.e. HTML checkmarks do not understand "nulls". This is a surrogate type not used in server-side programming
StoreFlag
Determines whether entity should be loaded/stored from/to storage
StoreLogLevel
Defines log level for DataStores
Delegates
FieldFilterFunc
Provides filter predicate for CRUD operations. Return true to include the specified field
SetFieldFunc
Injects function that tries to set document field value. May elect to skip the set and return false to indicate failure(instead of throwing exception)