Skip to content

Database template options

new TemplateDBOpts()

Template options for an IndexedDB-like back-end. See module:templeo/options.DBOptions for a full listing of options.

See also

  • module:templeo/options.DBOptions
  • module:templeo/options.Options

TemplateDBOpts.defaultOptionsObject

Returns

See also

  • module:templeo/options.DBOptions
  • module:templeo/options.Options

templeo/options.DBOptions

Template options for an IndexedDB-like back-end. All DB options inherit from [TemplateOpts]module:templeo/options.Options.

Type: module:templeo/options.Options

Properties

NameTypeDefaultDescription
[dbTypeName='indexedDB']String'indexedDB'The IndexedDB type to use. The default indexedDB value uses the global accessible instance that contains
a property matching the type name. When not present in the current global scope, a module will be loaded using the provided type name.
[dbLocName='templeo']String'templeo'Either the IDBDatabase.name that will be
used or the location name/path passed into the IndexedDB-like module loaded via dbTypeName (e.g. LevelDB).
[renderTimePolicy=read-all-on-init-when-empty]Stringread-all-on-init-when-emptyThe policy applied to partial template DB read operations when encountering
include directives that do not have template content present in cache storage during rendering. In addition to the policies defined in
module:templeo/options.Options
, the following policies can be applied:
- read-all-on-init-when-empty When there are no partials registered during compilation other than the primary template designated by
options.defaultTemplateName, all partial templates are read during the start of each rendering invocation. If partial templates are
present/registered during compilation, no DB reads will be made during rendering.
- read-all-on-init-when-empty-write Same as read-all-on-init-when-empty, but will also write compiled rendering functions when include
directives are encountered during rendering.
- read-write-and-close Like the read and read-write policy, partial templates are only read when include directives are encountered that do not already contain content.
The DB will be opened before each read and closed after each read has completed for each included partial.

Released under the MIT License.