On this page
Use the Configuration class to control the specifics of the realm you would like to open, including schema.
Pass your configuration to the Realm constructor to generate an instance of that realm:
var config = Configuration([Car.schema]); var realm = Realm(config);
You can now use that realm instance to work with objects in the database.
You can open an existing realm in read-only mode. To open a read-only realm,
readOnly: true to your
You can only open existing realms in read-only mode. If you try to write to a read-only realm, it throws an error.
var config = Configuration([Car.schema], readOnly: true); realm = Realm(config);
To create a realm that runs entirely in memory without being written to a file,
inMemory: true to your
In-memory realms cannot also be read-only.
var config = Configuration([Car.schema], inMemory: true); var realm = Realm(config);
Set a value for Realm's FIFO special files location.
Opening a realm creates a number of lightweight FIFO special files
that coordinate access to the realm across threads and processes.
If the realm file is in a location that doesn't allow for the creation of
FIFO special files (such as FAT32 filesystems), then the realm cannot be opened.
In this case, Realm needs a different location to store these files.
fifoFilesFallbackPath: <Your Custom FIFO File Path> to your
This property is ignored if the directory for the realm file allows FIFO special files.
var config = Configuration([Car.schema], fifoFilesFallbackPath: "./fifo_folder"); var realm = Realm(config);
Once you've finished working with a realm, close it to prevent memory leaks.