Categorygithub.com/stormsync/database
repositorypackage
0.0.55
Repository: https://github.com/stormsync/database.git
Documentation: pkg.go.dev

# README

Stormsync Database

Welcome to the Stormsync Database repository. This repository contains a Go package for handling database operations, including migrations, and connection management, tailored for use with the Stormsync suite.

DB Schema

DBSchema

Table of Contents

Introduction

The Stormsync Database package is designed to simplify database management tasks within Go applications. It provides tools for database migrations, seeding, and connection handling, making it easier to develop and maintain consistent database states across different environments.

Features

  • Database Migrations: Manage database schema changes in a structured and version-controlled manner.
  • Seeding: Populate your database with initial or test data using seed scripts.
  • Connection Management: Simplified database connection handling.
  • Compatibility: Supports multiple database systems including PostgreSQL, MySQL, and SQLite.

Installation

To install the Stormsync Database package, use the following command:

go get github.com/stormsync/database

Environment Variables

You can configure the database package using environment variables. Here are the supported variables:

  • DB_DRIVER
  • DB_HOST
  • DB_PORT
  • DB_USER
  • DB_PASSWORD
  • DB_NAME
  • DB_SSLMODE

Usage

Running Migrations

To run database migrations, use the following code:

 migrate -source file:./migrations -database  "postgresql://<host>/<dbname>?<params>" up
 or
 migrate -source file:./migrations -database  "postgresql://<host>/<dbname>?<params>" down

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any questions or feedback, please reach out to us at [email protected] or join our community forum.