MCPcopy
hub / github.com/gogf/gf / Insert

Method Insert

database/gdb/gdb.go:99–99  ·  view source on GitHub ↗

=========================================================================== Common APIs for CRUD. =========================================================================== Insert inserts one or multiple records into table. The data can be a map, struct, or slice of maps/structs. The optional batch

(ctx context.Context, table string, data any, batch ...int)

Source from the content-addressed store, hash-verified

97 // The data can be a map, struct, or slice of maps/structs.
98 // The optional batch parameter specifies the batch size for bulk inserts.
99 Insert(ctx context.Context, table string, data any, batch ...int) (sql.Result, error)
100
101 // InsertIgnore inserts records but ignores duplicate key errors.
102 // It works like Insert but adds IGNORE keyword to the SQL statement.

Callers 15

Test_DB_InsertFunction · 0.65
Test_DB_InsertIgnoreFunction · 0.65
Test_DB_BatchInsertFunction · 0.65
Test_DB_TimeFunction · 0.65
Test_DB_TableFieldFunction · 0.65
Test_DB_PrefixFunction · 0.65
Test_DB_UpdateCounterFunction · 0.65
Test_TypesFunction · 0.65
createInitTableWithDbFunction · 0.65

Calls

no outgoing calls

Tested by 15

Test_DB_InsertFunction · 0.52
Test_DB_InsertIgnoreFunction · 0.52
Test_DB_BatchInsertFunction · 0.52
Test_DB_TimeFunction · 0.52
Test_DB_TableFieldFunction · 0.52
Test_DB_PrefixFunction · 0.52
Test_DB_UpdateCounterFunction · 0.52
Test_TypesFunction · 0.52
createInitTableWithDbFunction · 0.52