sqlfile

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlfile manage the handling with sql files

Index

Constants

View Source
const (
	// CommandUpgrade represents the string to get the upgrade statements
	CommandUpgrade = "up"

	// CommandDowngrade represents the string to get the downgrade statements
	CommandDowngrade = "down"
)

Variables

View Source
var (
	// ErrScanFiles is used if scanning a file fails
	ErrScanFiles = errors.New("scan files failed")
)

Functions

func Read

func Read(fileName string, command string) (string, error)

Read returns the content of a file for the given command.

func Scan

func Scan(path string) ([]string, error)

Scan returns a sorted (asc) list of files (including path) ending with .sql and file size bigger than zero. It excludes directories.

func ScanReverse

func ScanReverse(path string) ([]string, error)

ScanReverse does the same as Scan but returns the filenames in reverse order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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