Configuration

Configuring Datamint

There are a few configuration options within Datamint, lets start with how to configure the LoggerService.

LoggerService

The LoggerService is a static class that is used to log messages to the console. It is used throughout the Datamint library to log messages, warnings, and errors. The LoggerService has a few configuration options that can be set.

PropertyTypeDescriptionOptions
verbosityVerbositySets the log levelINFO, WARN, ERROR, DEBUG, NONE
colorLogColorSets the color of the log messagesBLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, GRAY
contextstringSets the context of the log messagesAny string
emojisbooleanSets whether or not to use emojis in the log messagestrue, false
stylesbooleanSets whether or not to use styles in the log messagestrue, false

DatamintClient

The DatamintClient is the main entry point for interacting with databases in Datamint. It provides methods for connecting to a database, executing queries, and managing the database connection.

PropertyTypeDescriptionOptions
databaseDatabaseTypeSpecifies the type of database to connect toMONGODB, MYSQL, POSTGRESQL
optionsDatabaseOptionsSpecifies the database connection detailsObject with name, user, password properties

DatabaseOptions

The DatabaseOptions interface specifies the connection details for a database.

PropertyTypeDescription
namestringThe name of the database
userstringThe username to use for authentication
passwordstringThe password to use for authentication

Connection String

If you do not provide a DatabaseOptions object when creating a DatamintClient, you must provide a connection string when calling the connect method. The connection string should be in a format appropriate for the type of database you are connecting to.

MethodParametersDescription
connectconnectionString?: stringConnects to the database using the provided connection string or the DatabaseOptions provided during the creation of the DatamintClient instance