Skip to content

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.

Connecting Database

await SiDatabase.init({
    address: "mongodb://localhost:27017",
    database: "silicon",
    verbose: true
});

Pages

element-ts

Element is a group of developer tools I have built in TypeScript. Check them out at: element-ts.com.

About

Author: Elijah Cobb

NPM: @element-ts/silicon

Issue Reporting: Github Issues

Clone this wiki locally