LiteDB for Unity
This tool for Unity enables you to easily create a document data store in your application or game. This NoSQL database lets you shape your data how you want, and takes little time to learn.
Why should I use LiteDB for Unity?
LiteDB for Unity brings the power of LiteDB to the Unity game engine! LiteDB for Unity is a document database, which means you can store your data in a convenient, flexible way, rather than needing to normalize the data into flat columns and rows as in a SQL database. And it is stored in a single local file, making access incredibly simple and ideal for game development. LiteDB for Unity also supports all of the major platforms that Unity supports, including Windows, Mac, Android, and iOS.
Can I use the LiteDB tool on GitHub?
The LiteDB project on GitHub provides a wonderful tool, but it encounters many issues when used with Unity. LiteDB for Unity removes these issues while adding support for Unity platforms and data types!
NoSQL document database
Local file storage
Documents can be mapped to POCO classes, making reading and writing very simple.
Support for Unity data types such as Vector3 and Quaternion
Documents can be any shape, and aren't required to be uniform.
Examples demonstrate common usage scenarios such as saving and loading game state, and saving settings.
Frequently asked questions
What platforms are supported?
Can I use LINQ to query my data?
You can, as long as you aren't targeting an IL2CPP platform, such as iOS. IL2CPP does not support the ability to compile code on the fly, which is a needed feature when LINQ expressions are used to query data. Instead, simply use the Query class, and your code will work on all platforms! Please see the documentation for more info.
Where should I store my database files?
It is recommended to store your files in one of the folders defined by Unity’s Application class, most likely in Application.persistentDataPath.
What version of LiteDB is LiteDB for Unity based on?
LiteDB for Unity is based on version 3.1.4 of LiteDB. It is continuously updated with the latest patches and fixes in the Asset Store.
What Unity data types are supported?
We currently support the following data types from Unity. They can even be used for indexing!