-
Notifications
You must be signed in to change notification settings - Fork 0
Database
Elijah Cobb edited this page Apr 20, 2020
·
1 revision
It is very quick and easy to connect to a database with silicon. All you need to do is call the init
method on
SiDatabase
. You can pass in a config object which follows the types:
type SiDatabaseConstructor = {
address: string,
database: string;
verbose?: boolean;
};
Provide the address and database name. Optionally you can also set a verbose
mode. If verbose mode is set to true
everything that silicon does will be logged into the console and the objects themselves through encoding cycles will
also be logged.
await SiDatabase.init({
address: "mongodb://localhost:27017",
database: "silicon",
verbose: true
});
Created by Elijah Cobb provided under the MIT license.
Element is a group of developer tools I have built in TypeScript. Check them out at: element-ts.com.
Author: Elijah Cobb
NPM: @element-ts/silicon
Issue Reporting: Github Issues