// MustInsert records to database.
// It'll panic if any error occurred.
487472
func (query Query) MustInsert(record interface{}, chs ...*changeset.Changeset) {
	must(query.Insert(record, chs...))
}
1305547
func (tx *Tx) InsertContext(ctx context.Context, list ...interface{}) error {
	return insertObjects(ctx, tx.DB, tx, getInsert, list, opInsert)
}
6742
func (c *PCPCounter) MustInc(val int64) {
	if err := c.Inc(val); err != nil {
		panic(err)
	}
}
1043104
func (p *Psyringe) MustInject(targets ...interface{}) {
	if err := p.Inject(targets...); err != nil {
		panic(err)
	}
}
650298
func (g *Genesis) MustCommit(db ethdb.Database) *types.Block {
	block, err := g.Commit(db)
	if err != nil {
		panic(err)
	}
	return block
}
297630
func Insert(db DB, table string, src interface{}) error {
	return Default.Insert(db, table, src)
}
109875
func (dt *DbfTable) AddRecord() int {
	newRecord := make([]byte, dt.recordLength)
	dt.dataStore = appendSlice(dt.dataStore, newRecord)

	// since row numbers are "0" based first we set newRecordNumber
	// and then increment number of records in dbase table
	newRecordNumber := int(dt.numberOfRecords)

	dt.numberOfRecords++
	s := uint32ToBytes(dt.numberOfRecords)
	dt.dataStore[4] = s[0]
	dt.dataStore[5] = s[1]
	dt.dataStore[6] = s[2]
	dt.dataStore[7] = s[3]
	return newRecordNumber
}
1001505
func (dbMan *dbManager) buildInsertSql(tableName string, orderedColumns []string, rows []common.Row) string {
	if len(rows) == 0 {
		return ""
	}
	normalizedTableName := normalizeTableName(tableName)
	var values string = ""

	var i, j int
	k := 1
	for i = 0; i < len(rows)-1; i++ {
		values += "("
		for j = 0; j < len(orderedColumns)-1; j++ {
			values += fmt.Sprintf("$%d,", k)
			k++
		}
		values += fmt.Sprintf("$%d),", k)
		k++
	}
	values += "("
	for j = 0; j < len(orderedColumns)-1; j++ {
		values += fmt.Sprintf("$%d,", k)
		k++
	}
	values += fmt.Sprintf("$%d)", k)

	sql := "INSERT INTO " + normalizedTableName
	sql += "(" + strings.Join(orderedColumns, ",") + ") "
	sql += "VALUES " + values

	return sql
}
660459
func (s *Stmt) MustExec(args ...interface{}) sql.Result {
	return MustExec(&qStmt{s}, "", args...)
}
1253631
func MustAdd(b []uint32, rh []uint32) {
	if len(b) != len(rh) {
		panic(ErrUnequallySizedSlices)
	}

	carry := false

	for i := range b {
		v, c := FullAdd(b[i], rh[i], carry)
		b[i] = uint32(v)
		carry = c
	}
}
593621
func (db *baseDB) Insert(model ...interface{}) error {
	return orm.Insert(db.db, model...)
}
164582
func InitDB(path string, params *chaincfg.Params) (*PublicRecord, error) {
	path = filepath.Clean(path)
	// Check if the file exists and remove it if it does.
	if _, err := os.Stat(path); err == nil {
		if err := os.Remove(path); err != nil {
			return nil, err
		}
	}

	conn, err := sql.Open("sqlite3", path)
	if err != nil {
		return nil, err
	}

	// Execute the Create Table sql
	_, err = conn.Exec(createSql())
	if err != nil {
		return nil, err
	}
	conn.Close()

	db, err := createPubRec(path)
	if err != nil {
		return nil, err
	}

	// Prepare the DB to do one insert (for the pegBlk)
	if err := prepareInserts(db); err != nil {
		return nil, err
	}

	err = db.InsertGenesisBlk(params.Net)
	if err != nil {
		return nil, err
	}
	return prepareDB(db)
}
1159345
func (sid *Shortid) MustGenerate() string {
	id, err := sid.Generate()
	if err == nil {
		return id
	}
	panic(err)
}
94653
func (db *DB) MustBindModel(name string, obj interface{}) *Model {
	model, err := db.BindModel(name, obj)
	if err != nil {
		panic(fmt.Errorf("%s: unable to bind model: %s", name, err))
	}
	return model
}
293582
func MustAst(x interface{}) []byte {
	bs, err := Ast(x)
	if err != nil {
		panic(err)
	}
	return bs
}
981907
func recordExists(ctx sessionctx.Context, sql string) (bool, error) {
	rows, _, err := ctx.(sqlexec.RestrictedSQLExecutor).ExecRestrictedSQL(ctx, sql)
	if err != nil {
		return false, err
	}
	return len(rows) > 0, nil
}
607797
func (w *ByteWriter) MustWrite(data []byte, offset int) int {
	off, err := w.Write(data, offset)
	if err != nil {
		panic(err)
	}
	return off
}