Realm Xamarin
v0.78.0
Realm for Xamarin
|
Realm configuration specifying settings that affect your Realm behaviour. More...
Public Member Functions | |
RealmConfiguration (string optionalPath=null, bool shouldDeleteIfMigrationNeeded=false) | |
Constructor allowing path override. More... | |
RealmConfiguration | ConfigWithPath (string newConfigPath) |
Clone method allowing you to override or customise the current path. More... | |
override bool | Equals (Object rhs) |
Generic override determines whether the specified System.Object is equal to the current RealmConfiguration. More... | |
bool | Equals (RealmConfiguration rhs) |
Determines whether the specified RealmConfiguration is equal to the current RealmConfiguration. More... | |
override int | GetHashCode () |
Serves as a hash function for a RealmConfiguration based on its path. More... | |
delegate void | MigrationCallbackDelegate (Migration migration, UInt64 oldSchemaVersion) |
In order to handle manual migrations, you need to supply one of these to your RealmConfiguration . It will be called with a Migration instance containing the pre- and the post-migration realm. You should make sure that the NewRealm property on it contains a database that is up to date when returning. The oldSchemaVersion parameter will tell you which version the user is migrating from. They should always be migrating to the current version. More... | |
Static Public Member Functions | |
static string | PathToRealm (string optionalPath=null) |
Utility to build a path in which a realm will be created so can consistently use filenames and relative paths. More... | |
Public Attributes | |
bool | ReadOnly |
Flag to indicate Realm is opened readonly so can open from locked locations such as bundled with an application. More... | |
readonly bool | ShouldDeleteIfMigrationNeeded |
Flag mainly to help with temp databases and testing, indicates content can be abandoned when you change the schema. More... | |
Static Public Attributes | |
static string | DefaultRealmName => "default.realm" |
Standard filename to be combined with the platform-specific document directory. More... | |
Properties | |
string | DatabasePath [get] |
The full path of any realms opened with this configuration, may be overriden by passing in a separate name. More... | |
static RealmConfiguration | DefaultConfiguration [get, set] |
Configuration you can override which is used when you create a new Realm without specifying a configuration. More... | |
byte [] | EncryptionKey [get, set] |
Specify the key used to encrypt the entire Realm. Once set, must be specified each time file is used. More... | |
MigrationCallbackDelegate | MigrationCallback [get, set] |
Gets or sets the migration callback. More... | |
Type [] | ObjectClasses [get, set] |
The list of classes persisted in a Realm opened with this configuration. More... | |
UInt64 | SchemaVersion [get, set] |
Number indicating the version, can be used to arbitrarily distinguish between schemas even if they have the same objects and properties. More... | |
Realm configuration specifying settings that affect your Realm behaviour.
Main role is generating a canonical path from whatever absolute, relative subdir or just filename user supplies.
RealmConfiguration | ( | string | optionalPath = null , |
bool | shouldDeleteIfMigrationNeeded = false |
||
) |
Constructor allowing path override.
optionalPath | Path to the realm, must be a valid full path for the current platform, relative subdir, or just filename. |
shouldDeleteIfMigrationNeeded | Optional Flag mainly to help with temp databases and testing, indicates content can be abandoned when you change the schema. |
References RealmConfiguration.DatabasePath, and RealmConfiguration.PathToRealm().
Referenced by RealmConfiguration.ConfigWithPath().
RealmConfiguration ConfigWithPath | ( | string | newConfigPath | ) |
Clone method allowing you to override or customise the current path.
newConfigPath | Path to the realm, must be a valid full path for the current platform, relative subdir, or just filename. |
References RealmConfiguration.DatabasePath, and RealmConfiguration.RealmConfiguration().
Referenced by Realm.GetInstance().
override bool Equals | ( | Object | rhs | ) |
Generic override determines whether the specified System.Object is equal to the current RealmConfiguration.
rhs | The System.Object to compare with the current RealmConfiguration. |
true
if the specified System.Object is equal to the current Realms.RealmConfiguration; otherwise, false
.Referenced by Realm.Equals().
bool Equals | ( | RealmConfiguration | rhs | ) |
Determines whether the specified RealmConfiguration is equal to the current RealmConfiguration.
rhs | The System.Object to compare with the current RealmConfiguration. |
true
if the specified System.Object is equal to the current Realms.RealmConfiguration; otherwise, false
.References RealmConfiguration.DatabasePath, RealmConfiguration.EncryptionKey, and RealmConfiguration.ShouldDeleteIfMigrationNeeded.
override int GetHashCode | ( | ) |
Serves as a hash function for a RealmConfiguration based on its path.
References RealmConfiguration.DatabasePath.
delegate void MigrationCallbackDelegate | ( | Migration | migration, |
UInt64 | oldSchemaVersion | ||
) |
In order to handle manual migrations, you need to supply one of these to your RealmConfiguration
. It will be called with a Migration
instance containing the pre- and the post-migration realm. You should make sure that the NewRealm
property on it contains a database that is up to date when returning. The oldSchemaVersion
parameter will tell you which version the user is migrating from. They should always be migrating to the current version.
|
static |
Utility to build a path in which a realm will be created so can consistently use filenames and relative paths.
optionalPath | Path to the realm, must be a valid full path for the current platform, relative subdir, or just filename. |
References RealmConfiguration.DefaultRealmName.
Referenced by RealmConfiguration.RealmConfiguration().
|
static |
Standard filename to be combined with the platform-specific document directory.
A string representing a filename only, no path.
Referenced by RealmConfiguration.PathToRealm().
bool ReadOnly |
Flag to indicate Realm is opened readonly so can open from locked locations such as bundled with an application.
Referenced by Realm.GetInstance().
readonly bool ShouldDeleteIfMigrationNeeded |
Flag mainly to help with temp databases and testing, indicates content can be abandoned when you change the schema.
Referenced by RealmConfiguration.Equals(), and Realm.GetInstance().
|
get |
The full path of any realms opened with this configuration, may be overriden by passing in a separate name.
Referenced by RealmConfiguration.ConfigWithPath(), Realm.DeleteRealm(), RealmConfiguration.Equals(), RealmConfiguration.GetHashCode(), Realm.GetInstance(), and RealmConfiguration.RealmConfiguration().
|
staticgetset |
Configuration you can override which is used when you create a new Realm without specifying a configuration.
Referenced by Realm.GetInstance().
|
getset |
Specify the key used to encrypt the entire Realm. Once set, must be specified each time file is used.
Full 64byte (512bit) key for AES-256 encryption.
Referenced by RealmConfiguration.Equals(), and Realm.GetInstance().
|
getset |
Gets or sets the migration callback.
Referenced by Realm.GetInstance().
|
getset |
The list of classes persisted in a Realm opened with this configuration.
Specify classes by type. Searched linearly so order in decreasing frequency of creating objects.
eg: config.ObjectClasses = new Type[] { typeof(CommonClass), typeof(RareClass) };
Typically left null so by default all RealmObjects will be able to be stored in all realms.
Referenced by Realm.GetInstance().
|
getset |
Number indicating the version, can be used to arbitrarily distinguish between schemas even if they have the same objects and properties.
0-based value initially set to zero so all user-set values will be greater.
Referenced by Realm.GetInstance().