npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

n8n-nodes-database-connector

v0.1.0

Published

The **Database Connector** node for n8n allows you to easily connect to MySQL and MongoDB databases, retrieve table names (for MySQL), or collection names (for MongoDB). It supports both traditional MySQL databases and MongoDB Atlas, providing a simple wa

Downloads

92

Readme

Database Connector Node for n8n

The Database Connector node for n8n allows you to connect to MySQL and MongoDB databases and retrieve the list of tables (for MySQL) or collections (for MongoDB). This node supports both MySQL and MongoDB, providing flexibility for database automation workflows.

Features:

  • MySQL Support: Connect to MySQL databases and retrieve the list of tables.
  • MongoDB Support: Connect to MongoDB (including MongoDB Atlas) and retrieve the list of collections.
  • Error Handling: Provides detailed error messages in case of connection or query failures.
  • Simple Configuration: Easily configure database connection parameters like host, port, username, password, and database name.

Installation

To install this custom node, follow these steps:

  1. Clone or download this repository.
  2. Follow the official n8n custom node installation guide.
  3. Install the necessary dependencies:
    • For MySQL: Install mysql2.
    • For MongoDB: Install mongodb.

Configuration

Node Settings

Once you add the Database Connector node to your workflow, you can configure the following parameters:

  • Database Type (options):

    • Choose between MySQL or MongoDB for the database type.
    • Default: mysql
    • Description: Select the type of database you want to connect to.
  • Host (string):

    • Provide the host for the database (e.g., localhost for MySQL or MongoDB Atlas connection string).
    • Default: localhost
    • Description: The host of the database server.
  • Port (number):

    • Provide the port for the database connection.
    • Default: 3306 for MySQL. Leave empty for MongoDB Atlas.
    • Description: The port to connect to the database (leave empty for MongoDB Atlas).
  • Username (string):

    • The username for the database connection.
    • Default: ''
    • Description: The username to authenticate the database connection.
  • Password (string):

    • The password for the database connection.
    • Default: ''
    • Description: The password to authenticate the database connection.
  • Database Name (string):

    • The name of the database to connect to.
    • Default: ''
    • Description: The specific database to use on the selected database server.

Example Workflow

Input Data:

{
  "dbType": "mysql",
  "host": "localhost",
  "port": 3306,
  "username": "root",
  "password": "password",
  "database": "test_db"
}

Node Configuration:

  • Database Type: mysql
  • Host: localhost
  • Port: 3306
  • Username: root
  • Password: password
  • Database Name: test_db

Output Data (Example):

If the database is MySQL, the output might look like this:

{
  "tableName": "users"
}

If the database is MongoDB, the output might look like this:

{
  "collectionName": "customers"
}

In this example:

  • tableName (for MySQL): The name of the table in the database.
  • collectionName (for MongoDB): The name of the collection in the database.