package sqlparser

import "github.com/pressly/goose/v3/internal/sqlparser"

Index

Functions

func ParseSQLMigration

func ParseSQLMigration(r io.Reader, direction bool) (stmts []string, useTx bool, err error)

Split given SQL script into individual statements and return SQL statements for given direction (up=true, down=false).

The base case is to simply split on semicolons, as these naturally terminate a statement.

However, more complex cases like pl/pgsql can have semicolons within a statement. For these cases, we provide the explicit annotations 'StatementBegin' and 'StatementEnd' to allow the script to tell us to ignore semicolons.

func SetVersbose

func SetVersbose(b bool)

Source Files

parser.go

Version
v3.9.0
Published
Jan 27, 2023
Platform
windows/amd64
Imports
8 packages
Last checked
6 hours ago

Tools for package owners.