Choosing a Database Adapter
Overview
A database adapter provides an interface between the TinaCMS database and the underlying database implementation. It implements a limited subset of functionality required by a sorted key-value store, which can be provided by almost any database implementation. We currently have database adapters for the following database implementations:
We're considering support for additional database adapters in the future, if this interests you let us know through GitHub discussions.
Configuring a database adapter can be done in the database.{ts,js} file by passing it to the createDatabase function.
createDatabase Function
This is a factory function that creates a new instance of the TinaCMS Database. It takes a databaseAdapter and a gitProvider.
The database adapter to use.
The git provider to use.
The directory used to store tina files.
tina.The bridge used to index the content to the database adapter. This defaults to the FileSystem. The bridge is a more advanced use case if you want to index from a different source other than the filesystem. Please reach out on Discord for further help.
async function called to report the status of the current indexing operation.
Specifies the namespace for the current indexed content. If specified, this will usually be an environment variable with the name of the current branch.
Number of operations per database write batch during indexing. Increase for adapters that process operations in parallel within a single batch call.
25.All properties marked as REQUIRED must be specified for the field to work properly.
createLocalDatabase Function
This is a factory function that creates a database that can be used for local development or static builds.
It uses a local in-memory database adapter and a file-system Git provider that only writes changes to the file-system without committing them.
(does not take any parameter)