1.1.0 • Published 12 months ago

universal-database-connection v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Universal-Database-Connection

This is the first package i have ever made.

This package can make it easier to connect to databases without having to go through the trouble of finding the documentation to connect.

First you download the package npm i universal-database-connection

then import the package

const createDatabaseConnection = require('universal-database-connection')

How to connect to the database (Postgres, Firebase, MySql)

  • Postgres Connection
const createDatabaseConnection = require("universal-database-connection/createDatabaseConnection");
  const databaseOptions = {
    host: 'databasehost',
    database: 'databasename',
    password: 'databasepassword',
    port: databaseport,
};

createDatabaseConnection("postgres", databaseOptions);
  • Firebase Connection
const createDatabaseConnection = require("universal-database-connection/createDatabaseConnection");
const databaseOptions = {
  firebaseConfig: {
    apiKey: "apiKey",
    authDomain: "authDomain",
    projectId: "projectId",
    storageBucket: "storageBucket",
    messagingSenderId: "messagingSenderId",
    appId: "appId",
    measurementId: "measurementId"
  }
}

createDatabaseConnection("firebase", databaseOptions);
  • MySql Connection
const createDatabaseConnection = require("./createDatabaseConnection");

const databaseOptions = {
    host: "localhost",
    user: "root",
    password: "password",
    database: "database"
};

createDatabaseConnection("mysql", databaseOptions);

Remember to change the databaseOptions properties to your host, user, database, password, port and firebaseConfig information.

1.1.0

12 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago