top of page
LiteDB for Unity logo icon

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.

Get it on the Unity Asset Store

Documentation

Support and info

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!

Features
  • 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

  • Indexed searches

  • 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.

  • What platforms are supported?
    Windows Mac iOS Android We are currently working on bringing support to UWP and WebGL as well.
  • What Unity data types are supported?
    We currently support the following data types from Unity. They can even be used for indexing! Vector2 Vector3 Vector4 Quaternion Matrix4x4
  • 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.
  • 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. Additionally, we have versions of LiteDB for Unity available that are based on v4.0+ of LiteDB. Versions 4.0 and above of LiteDB rely heavily on just-in-time compilation, which renders it unsuitable for IL2CPP platforms like iOS. As a result, we can’t list it on the Asset Store. However, if you are not targeting iOS and would like to use this version, please send us a request at our support email with your invoice number, and we will be happy to send you a copy.
  • 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.
bottom of page