Skip to content
Mauricio David edited this page Dec 25, 2016 · 14 revisions

LiteDatabase can be initialize using a string connection, with key1=value1; key2=value2; ... syntax. If there is no ; in your connection string, LiteDB assume that your connection string is Filename key. Keys are case insensitive.

Options

  • Filename (string): Full path or relative path from DLL directory.
  • Journal (bool): Enabled or disable double write check to ensure durability (default: true)
  • Password (string): Encrypt (using AES) your datafile with a password (defult: null - no encryption)
  • Cache Size (int): Max number of pages in cache. After this size, flush data to disk to avoid too memory usage (defult: 5000)
  • Timeout (TimeSpan): Timeout for waiting unlock operations (thread lock and locked file)
  • Mode (Exclusive|ReadOnly|Shared): How datafile will be open (defult: Shared in NET35 and Exclusive in NetStandard)
  • Initial Size (string|long): If database is new, initialize with allocated space - support KB, MB, GB (defult: null)
  • Limit Size (string|long): Max limit of datafile - support KB, MB, GB (defult: null)
  • Log (byte): Debug messages from database - use LiteDatabase.Log (defult: Logger.NONE)