ds-connector
v0.0.5
Published
A CLI tool for dynamic database setup
Downloads
6
Readme
ds-connector
ds-connector is a CLI tool for dynamic database setup. It allows you to configure your database using command-line options, streamlining the setup process for different database systems.
Table of Contents
Features
- Supports multiple database types including PostgreSQL.
- Dynamically sets up the database configuration through command-line options.
- Copies an entities JSON file to your working directory.
Installation
To install ds-connector
globally, use the following command:
npm install -g ds-connector
You can also use npx to run it without installing globally:
npx ds-connector
Usage
Run ds-connector to set up your database:
ds-connector -t <db_type> -h <host> -u <username> -pw <password> -pt <port> -d <database> -f <path_to_entities_file>
Command-Line Options
- -t, --type : Required. Database type (e.g., postgres).
- -h, --host : Required. Database host.
- -u, --username : Required. Database username.
- -pw, --password : Required. Database password.
- -pt, --port : Required. Database port.
- -d, --database : Required. Database name.
- -f, --file : Required. Path to the entities JSON file.
Example To configure a PostgreSQL database with a JSON file entities.json, use:
ds-connector -t postgres -h localhost -u postgres -pw mypassword -pt 5432 -d mydatabase -f ./entities.json
Configuration The tool uses environment variables to configure the database connection dynamically:
DB_TYPE: Database type.
DB_HOST: Database host.
DB_PORT: Database port.
DB_USERNAME: Database username.
DB_PASSWORD: Database password.
DB_DATABASE: Database name.
These are set automatically based on the command-line options provided.
License
This project is licensed under the ISC License.
Contact
For questions or support, please reach out to Rick.