Skip to main content

Home > git-documentdb > DatabaseOptions

DatabaseOptions type#

Database Options

Signature:
export declare type DatabaseOptions = {
localDir?: string;
dbName: string;
logLevel?: TLogLevelName;
schema?: Schema;
serialize?: SerializeFormatLabel;
logToTransport?: (logObject: ILogObject) => void;
logColorEnabled?: boolean;
};
References:

Schema , SerializeFormatLabel

Remarks#

localDir and dbName are OS-specific options.

It is recommended to use ASCII characters and case-insensitive names for cross-platform.

localDir - A local directory path that stores repositories of GitDocumentDB.

  • Default is './gitddb'.

  • A directory name allows Unicode characters except for OS reserved filenames and the following characters: < > : " | ? * ¥0.

  • A colon : is generally not allowed, but a Windows drive letter followed by a colon is allowed. e.g.) C: D:

  • A directory name cannot end with a period or a white space but the current directory . and the parent directory .. are allowed.

  • A trailing slash / could be omitted.

dbName - A name of a git repository

  • dbName allows Unicode characters except for OS reserved filenames and the following characters: < > : " ¥ / \ | ? * ¥0.

  • dbName cannot end with a period or a white space.

  • dbName does not allow '.' and '..'.

logLevel - Default is 'info'.

schema - Schema for a specific document type.

serializeFormat - Format for serialization

logToTransport - logToTransport function for all log levels. See https://tslog.js.org/\#/?id=transports

logColorEnabled - Enable color for console log. Default is true. When you write log into a file by logToTransport, false is recommended.