statement

package
v0.0.0-...-e98148d Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Statement

type Statement struct {
	SQL  string // Original sql statement
	Verb Verb   // A statement type; INSERT, CREATE, etc
}

Statement captures a single sql statement, ie INSERT INTO (...) VALUES (...);

func FromString

func FromString(s string) (*Statement, error)

FromString constructs a Statement from a string

func (*Statement) Dependencies

func (s *Statement) Dependencies() []string

Dependencies determines the foreign key dependencies of the table if the statement is a Create Statement

func (*Statement) String

func (s *Statement) String() string

func (*Statement) Table

func (s *Statement) Table() string

Table returns the name of the table that this statement operates upon.

type Statements

type Statements []Statement

Statements type is needed to satisfy the sort interface

func (Statements) Len

func (slice Statements) Len() int

func (Statements) Less

func (slice Statements) Less(i, j int) bool

func (Statements) Swap

func (slice Statements) Swap(i, j int)

type Verb

type Verb int

Verb describes a type of sql statement, INSERT, CREATE, etc

const (
	// Create represents a Create Table statement
	Create Verb = iota
	// Insert represents an Insert statement
	Insert
)

func (Verb) String

func (v Verb) String() string

Jump to

Keyboard shortcuts

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