kbsql

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 5 Imported by: 0

README

kbsql

Go Reference

A SQL utility library for Katabole, primarily for tests.

For a canonical place these are used see kbexample.

Documentation

Overview

Package kbsql provides database utilities for Katabole

At this time it's for migrations and tests.

For a canonical place these are used see https://github.com/katabole/kbexample

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtlasSetupDB

func AtlasSetupDB(dbURL string, atlasDevDBURL string) error

AtlasSetupDB runs atlas to ensure the database (usually dev/test) is up to date.

func PostgresCleanDB

func PostgresCleanDB(db *sqlx.DB) error

PostgresCleanDB resets sequences and wipes all tables in the provided postgres database.

func PostgresCreateDBIfNotExistsByURL added in v0.3.0

func PostgresCreateDBIfNotExistsByURL(dbURL string) error

PostgresCreateDBIfNotExistsByURL ensures the given database exists, creating it if it doesn't. Generally for dev/test databases. It takes a URL connection string like `postgres://joe:secret@kb.example.com:5432/testdb`

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL