insert

package
v0.0.0-...-af8a1ed Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNoPrefix = errors.New("can not find a corresponding prefix")

ErrorNoPrefix is the error returned when no prefix can be extracted

View Source
var ErrorNoTableName = errors.New("can not find a corresponding table name")

ErrorNoTableName is the error returned when no table name is found based on the filename

View Source
var RegexTls = regexp.MustCompile(`^(tls[0-9]{3})`)

RegexTls is the regexp for matching the prefix of a file name

Functions

func BulkInsert

func BulkInsert(tableName string, filePath string) (err error)

func BulkInsertFile

func BulkInsertFile(filePath string)

BulkInsertFile reads a file and creates the db entries in batches

func BulkReadDirectory

func BulkReadDirectory(dirPath, postGresPath string) (files []string, err error)

func File2Table

func File2Table(filePath string) (tableName string, err error)

File2Table is a map of filename to table name

func ProcessDirectory

func ProcessDirectory(fileDirectoryPath, postgresDirectoryPath string)

func ReadFile

func ReadFile(filePath string)

ReadFile reads a file and creates the db entries in batches

Types

This section is empty.

Jump to

Keyboard shortcuts

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