testrecords

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

README

testrecords

GitHub release (latest SemVer) GitHub Workflow Status GitHub GitHub go.mod Go version

A Go library to help inserting records to DB for testing.

Requirements

  • Go 1.24+

Installation

go get github.com/Siroshun09/testrecords

License

This project is under the Apache License version 2.0. Please see LICENSE for more info.

Copyright © 2025, Siroshun09

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

type Inserter

type Inserter struct {
	// contains filtered or unexported fields
}

func NewInserter

func NewInserter(flavor sqlbuilder.Flavor) Inserter

func NewInserterForMySQL

func NewInserterForMySQL() Inserter

func NewInserterForPostgreSQL

func NewInserterForPostgreSQL() Inserter

func (Inserter) Add

func (i Inserter) Add(tableName string, records ...any) Inserter

func (Inserter) InsertAll

func (i Inserter) InsertAll(ctx context.Context, conn Conn) error

Jump to

Keyboard shortcuts

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