Namespace: Internal.LiteDBAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.1.1.0 (2026.1.1.0)
Syntaxpublic interface ILiteDatabase : IDisposable
The ILiteDatabase type exposes the following members.
Properties| | Name | Description |
|---|
 | CheckpointSize |
Get/Set in how many pages (8 Kb each page) log file will auto checkpoint (copy from log file to data file). Use 0 to manual-only checkpoint (and no checkpoint on dispose)
Default: 1000 pages
|
 | Collation |
Get database collection (this options can be changed only in rebuild proces)
|
 | FileStorage |
Returns a special collection for storage files/stream inside datafile. Use _files and _chunks collection names. FileId is implemented as string. Use "GetStorage" for custom options
|
 | LimitSize |
Get/Set database limit size (in bytes). New value must be equals or larger than current database size
|
 | Mapper |
Get current instance of BsonMapper used in this database instance (can be BsonMapper.Global)
|
 | Timeout |
Get/Set database timeout - this timeout is used to wait for unlock using transactions
|
 | UserVersion |
Get/Set database user version - use this version number to control database change model
|
 | UtcDate |
Get/Set if database will deserialize dates in UTC timezone or Local timezone (default: Local)
|
Top
Methods| | Name | Description |
|---|
 | BeginTrans |
Initialize a new transaction. Transaction are created "per-thread". There is only one single transaction per thread.
Return true if transaction was created or false if current thread already in a transaction.
|
 | Checkpoint |
Do database checkpoint. Copy all commited transaction from log file into datafile.
|
 | CollectionExists |
Checks if a collection exists on database. Collection name is case insensitive
|
 | Commit |
Commit current transaction
|
 | Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable) |
 | DropCollection |
Drop a collection and all data + indexes
|
 | Execute(String, BsonDocument) |
Execute SQL commands and return as data reader
|
 | Execute(String, BsonValue) |
Execute SQL commands and return as data reader
|
 | Execute(TextReader, BsonDocument) |
Execute SQL commands and return as data reader.
|
 | GetCollection(String, BsonAutoId) |
Get a collection using a generic BsonDocument. If collection does not exits, create a new one.
|
 | GetCollectionT |
Get a collection using a name based on typeof(T).Name (BsonMapper.ResolveCollectionName function)
|
 | GetCollectionT(BsonAutoId) |
Get a collection using a name based on typeof(T).Name (BsonMapper.ResolveCollectionName function)
|
 | GetCollectionT(String, BsonAutoId) |
Get a collection using a entity class as strong typed document. If collection does not exits, create a new one.
|
 | GetCollectionNames |
Get all collections name inside this database.
|
 | GetStorageTFileId |
Get new instance of Storage using custom FileId type, custom "_files" collection name and custom "_chunks" collection. LiteDB support multiples file storages (using different files/chunks collection names)
|
 | Pragma(String) |
Get value from internal engine variables
|
 | Pragma(String, BsonValue) |
Set new value to internal engine variables
|
 | Rebuild |
Rebuild all database to remove unused pages - reduce data file
|
 | RenameCollection |
Rename a collection. Returns false if oldName does not exists or newName already exists
|
 | Rollback |
Rollback current transaction
|
Top
See Also