Skip to content

Max pool connection and BulkInsert #402

Closed Answered by sijms
gexcode asked this question in Q&A
Discussion options

You must be logged in to vote

BulkInsert now can run from inside sql.Exec() just pass an arrays. you can review example merge/main.go
this is a code example

// all arrays should be same size
_, err := conn.Exec(sqlText,  // sql text INSERT INTO OR MERGE INTO
                sql.Named("ID", ids),   // array of integers
		sql.Named("NAME", names), // array of string
		sql.Named("VAL", vals),  // array of float
		sql.Named("LDATE", dates)) // array of time.Time

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gexcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants