schema

package
v0.0.0-...-8aeb11b Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package schema enables checking the schema, both columns and indexes, of a database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TableNames

func TableNames(tables interface{}) []string

TableNames takes in a "table type", that is a table whose fields are slices. Each field will be interpreted as a table. TableNames returns all expected table names in a string slice with table names lowercased.

For example:

"description", "taskresult"

Types

type Description

type Description struct {
	ColumnNameAndType map[string]string
	IndexNames        []string
}

Description describes the schema for all tables.

func GetDescription

func GetDescription(ctx context.Context, db pool.Pool, tables interface{}) (*Description, error)

GetDescription returns a Description populated for every table listed in `tables`.

Directories

Path Synopsis
Package exportschema contains a re-usable Main function that exports an SQL schema as a JSON seriailized schema.Description.
Package exportschema contains a re-usable Main function that exports an SQL schema as a JSON seriailized schema.Description.

Jump to

Keyboard shortcuts

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