Registry / testing / zhashkevych-go-sqlxmock

zhashkevych-go-sqlxmock

JSON →
library1.5.1gogounverified

A mock library for testing SQL database interactions without a real database connection, supporting sqlx and standard database/sql.

go get github.com/zhashkevych/go-sqlxmock
INSTALL
IMPORT
SIG · ZHASHKEVYCH-GO-SQL
Z
zhashkevych-go-sqlxmock
testinggov1.5.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sqlxmock
github.com/zhashkevych/go-sqlxmock

Create a mock SQL database and set up an expectation.

package main import ( "fmt" "github.com/zhashkevych/go-sqlxmock" ) func main() { db, mock, err := sqlxmock.New() if err != nil { panic(err) } defer db.Close() mock.ExpectQuery("SELECT .*").WillReturnRows(sqlxmock.NewRows([]string{"id"}).AddRow(1)) fmt.Println("Mock created") }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.5.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
38
OpenAI (training)
1
Resources
zhashkevych-go-sqlxmock — go get zhashkevych-go-sqlxmock · libregistry