Skip to content

sumitasok/go-test-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

For testing database, we need to have a database with exactly same schema of that of development database.

TO-DO: This package gives functionality that will duplicate the database without data in it. Which we can use to populate our test data, and every time we call the database, it is recreated.

	ddb := testdb.TestDb{"mysql_username", "mysql_password", "development_db_name", "test_db_name"}
	db, _ := ddb.Prepare()

This is based on go-sql-driver, and var db is returned with the db instance.

We have to make sure, the code is written in a manner where we can inject this db instance instead of the development instance.

About

Work in progress

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages