// GenAutoTableID adds step to the auto ID of the table and returns the sum.
548909
func (m *Meta) GenAutoTableID(dbID, tableID, step int64) (int64, error) {
	// Check if DB exists.
	dbKey := m.dbKey(dbID)
	if err := m.checkDBExists(dbKey); err != nil {
		return 0, errors.Trace(err)
	}
	// Check if table exists.
	tableKey := m.tableKey(tableID)
	if err := m.checkTableExists(dbKey, tableKey); err != nil {
		return 0, errors.Trace(err)
	}

	return m.txn.HInc(dbKey, m.autoTableIDKey(tableID), step)
}
792388
func AuthorizationURITenantID(url *url.URL) (string, error) {
	path := strings.TrimPrefix(url.Path, "/")
	if _, err := utils.UUIDFromString(path); err != nil {
		return "", errors.NotValidf("authorization_uri %q", url)
	}
	return path, nil
}
315490
func goVRowid(pCursor unsafe.Pointer, pRowid *C.sqlite3_int64) *C.char {
	vtc := lookupHandle(uintptr(pCursor)).(*sqliteVTabCursor)
	rowid, err := vtc.vTabCursor.Rowid()
	if err != nil {
		return mPrintf("%s", err.Error())
	}
	*pRowid = C.sqlite3_int64(rowid)
	return nil
}
437375
func (d *driver) InstanceID(
	ctx types.Context,
	opts types.Store) (*types.InstanceID, error) {

	return d.getInstanceID()
}
705193
func (e *Element) EventID() string {
	return fmt.Sprintf("%s[uid='%s']", strings.ToLower(e.Name()), e.UID())
}
9161
func (a *DataTable) GenOrderBy(args ...func(string, string) string) string {
	return a.orders.Sql(args...)
}
1247772
func (s *CACertificateDescription) SetGenerationId(v string) *CACertificateDescription {
	s.GenerationId = &v
	return s
}
1244029
func (m *Machine) ParentId() (string, bool) {
	parentId := ParentId(m.Id())
	return parentId, parentId != ""
}
1213065
func (s *AutomationExecutionMetadata) SetAutomationExecutionId(v string) *AutomationExecutionMetadata {
	s.AutomationExecutionId = &v
	return s
}
347327
func GenTableIndexPrefix(tableID int64) kv.Key {
	buf := make([]byte, 0, len(tablePrefix)+8+len(indexPrefixSep))
	return appendTableIndexPrefix(buf, tableID)
}
1360532
func (s *PutLifecycleEventHookExecutionStatusInput) SetLifecycleEventHookExecutionId(v string) *PutLifecycleEventHookExecutionStatusInput {
	s.LifecycleEventHookExecutionId = &v
	return s
}
639224
func (e *Epoch) ID() EpochID {
	base := e.Base()
	var id EpochID
	binary.LittleEndian.PutUint64(id[:], base)
	id[7] = e.Level
	return id
}
1082828
func (r *RetryInfo) AddAutoIncrementID(id int64) {
	r.autoIncrementIDs = append(r.autoIncrementIDs, id)
}
588575
func (d PostgresDialect) InsertAutoIncr(e SqlExecutor, insertSql string, params ...interface{}) (int64, error) {
	rows, err := e.handle().Queryx(insertSql, params...)
	if err != nil {
		return 0, err
	}
	defer rows.Close()

	if rows.Next() {
		var id int64
		err := rows.Scan(&id)
		return id, err
	}

	return 0, errors.New("No serial value returned for insert: " + insertSql + ", error: " + rows.Err().Error())
}
1099725
func (s *AutomationExecution) SetAutomationExecutionId(v string) *AutomationExecution {
	s.AutomationExecutionId = &v
	return s
}
1058543
func GenTablePrefix(tableID int64) kv.Key {
	buf := make([]byte, 0, len(tablePrefix)+8)
	buf = append(buf, tablePrefix...)
	buf = codec.EncodeInt(buf, tableID)
	return buf
}
155354
func NewAutoGcd(settings *Settings) *AutoGcd {
	auto := &AutoGcd{settings: settings}
	auto.tabLock = &sync.RWMutex{}
	auto.tabs = make(map[string]*Tab)
	auto.debugger = gcd.NewChromeDebugger()
	auto.debugger.SetTerminationHandler(auto.defaultTerminationHandler)
	if len(settings.extensions) > 0 {
		auto.debugger.AddFlags(settings.extensions)
	}

	if len(settings.flags) > 0 {
		auto.debugger.AddFlags(settings.flags)
	}

	if settings.timeout > 0 {
		auto.debugger.SetTimeout(settings.timeout)
	}

	if len(settings.env) > 0 {
		auto.debugger.AddEnvironmentVars(settings.env)
	}
	return auto
}