Click or drag to resize

ILiteDatabase Methods

The ILiteDatabase type exposes the following members.

Methods
 NameDescription
Public methodBeginTrans 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.
Public methodCheckpoint Do database checkpoint. Copy all commited transaction from log file into datafile.
Public methodCollectionExists Checks if a collection exists on database. Collection name is case insensitive
Public methodCommit Commit current transaction
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable)
Public methodDropCollection Drop a collection and all data + indexes
Public methodExecute(String, BsonDocument) Execute SQL commands and return as data reader
Public methodExecute(String, BsonValue) Execute SQL commands and return as data reader
Public methodExecute(TextReader, BsonDocument) Execute SQL commands and return as data reader.
Public methodGetCollection(String, BsonAutoId) Get a collection using a generic BsonDocument. If collection does not exits, create a new one.
Public methodGetCollectionT Get a collection using a name based on typeof(T).Name (BsonMapper.ResolveCollectionName function)
Public methodGetCollectionT(BsonAutoId) Get a collection using a name based on typeof(T).Name (BsonMapper.ResolveCollectionName function)
Public methodGetCollectionT(String, BsonAutoId) Get a collection using a entity class as strong typed document. If collection does not exits, create a new one.
Public methodGetCollectionNames Get all collections name inside this database.
Public methodGetStorageTFileId 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)
Public methodPragma(String) Get value from internal engine variables
Public methodPragma(String, BsonValue) Set new value to internal engine variables
Public methodRebuild Rebuild all database to remove unused pages - reduce data file
Public methodRenameCollection Rename a collection. Returns false if oldName does not exists or newName already exists
Public methodRollback Rollback current transaction
Top
See Also