// deleteTable deletes DynamoDB table with a given name
519407
func (b *DynamoDBBackend) deleteTable(ctx context.Context, tableName string, wait bool) error {
	tn := aws.String(tableName)
	_, err := b.svc.DeleteTable(&dynamodb.DeleteTableInput{TableName: tn})
	if err != nil {
		return trace.Wrap(err)
	}
	if wait {
		return trace.Wrap(
			b.svc.WaitUntilTableNotExists(&dynamodb.DescribeTableInput{TableName: tn}))
	}
	return nil
}
130904
func (i *Index) DeleteField(name string) error {
	i.mu.Lock()
	defer i.mu.Unlock()

	// Confirm field exists.
	f := i.field(name)
	if f == nil {
		return newNotFoundError(ErrFieldNotFound)
	}

	// Close field.
	if err := f.Close(); err != nil {
		return errors.Wrap(err, "closing")
	}

	// Delete field directory.
	if err := os.RemoveAll(i.fieldPath(name)); err != nil {
		return errors.Wrap(err, "removing directory")
	}

	// If the field being deleted is the existence field,
	// turn off existence tracking on the index.
	if name == existenceFieldName {
		i.trackExistence = false
		i.existenceFld = nil

		// Update meta data on disk.
		if err := i.saveMeta(); err != nil {
			return errors.Wrap(err, "saving existence meta data")
		}
	}

	// Remove reference.
	delete(i.fields, name)

	return nil
}
972783
func (session *Session) Table(tableNameOrBean interface{}) *Session {
	session.Statement.Table(tableNameOrBean)
	return session
}
1283215
func (cb *CreateBuilder) Table(name string) *CreateTableBuilder {
	return &CreateTableBuilder{
		name:    name,
		columns: make([]tableColumn, 0),
	}
}
44120
func (c *conn) delete(table, field, id string) error {
	result, err := c.Exec(`delete from `+table+` where `+field+` = $1`, id)
	if err != nil {
		return fmt.Errorf("delete %s: %v", table, id)
	}

	// For now mandate that the driver implements RowsAffected. If we ever need to support
	// a driver that doesn't implement this, we can run this in a transaction with a get beforehand.
	n, err := result.RowsAffected()
	if err != nil {
		return fmt.Errorf("rows affected: %v", err)
	}
	if n < 1 {
		return storage.ErrNotFound
	}
	return nil
}
410077
func (w *Writer) Delete(key []byte, o *db.WriteOptions) error {
	return errors.New("leveldb/table: cannot Delete from a table")
}
202088
func (s *GetTableOutput) SetTable(v *Table) *GetTableOutput {
	s.Table = v
	return s
}
126939
func (m *FileSource) Table(tableName string) (*schema.Table, error) {

	//u.Debugf("Table(%q) path:%v  %#v", tableName, m.path, m.ss.Conf)
	// We have a special table that is the list of all files
	if m.filesTable == tableName {
		return m.fdb.Table(tableName)
	}

	// Check cache for this table
	t, ok := m.tableSchemas[tableName]
	if ok {
		return t, nil
	}

	var err error
	// Its possible that the file handle implements schema handling
	if schemaSource, hasSchema := m.fh.(schema.SourceTableSchema); hasSchema {
		t, err = schemaSource.Table(tableName)
		if err != nil {
			u.Errorf("could not get %T table %q %v", schemaSource, tableName, err)
			return nil, err
		}

	} else {

		// Source doesn't implement Schema Handling so we are going to get
		//  a scanner and introspect some rows
		t, err = m.buildTable(tableName)
		if err != nil {
			return nil, err
		}

	}

	if t == nil {
		return nil, fmt.Errorf("Missing table for %q", tableName)
	}

	m.tableSchemas[tableName] = t
	//u.Debugf("%p Table(%q) cols=%v", m, tableName, t.Columns())
	return t, nil
}
35559
func (s *DB) DropTable(values ...interface{}) *DB {
	db := s.clone()
	for _, value := range values {
		if tableName, ok := value.(string); ok {
			db = db.Table(tableName)
		}

		db = db.NewScope(value).dropTable().db
	}
	return db
}
788010
func (tab *Table) delete(node *Node) {
	//fmt.Println("delete", node.addr().String(), node.ID.String(), node.sha.Hex())
	bucket := tab.buckets[logdist(tab.self.sha, node.sha)]
	for i := range bucket.entries {
		if bucket.entries[i].ID == node.ID {
			bucket.entries = append(bucket.entries[:i], bucket.entries[i+1:]...)
			tab.count--
			return
		}
	}
}
910081
func (t *Table) RemoveRow(row int) *Table {
	if row < 0 || row >= len(t.cells) {
		return t
	}

	t.cells = append(t.cells[:row], t.cells[row+1:]...)

	return t
}
651447
func (session *Session) Table(tableNameOrBean interface{}) *Session {
	session.statement.Table(tableNameOrBean)
	return session
}
1101570
func (b *tableBatch) Delete(key []byte) error {
	return b.batch.Delete(append([]byte(b.prefix), key...))
}
1353326
func (as *AgentServer) Delete(ctx context.Context, deleteRequest *pb.DeleteDatasetShardRequest) (*pb.DeleteDatasetShardResponse, error) {

	log.Println("deleting", deleteRequest.Name)
	as.storageBackend.DeleteNamedDatasetShard(deleteRequest.Name)
	as.inMemoryChannels.Cleanup(deleteRequest.Name)

	return &pb.DeleteDatasetShardResponse{}, nil
}
871556
func (m *SchemaDb) Table(table string) (*schema.Table, error) {

	switch table {
	case "tables":
		return m.tableForTables()
	case "databases":
		return m.tableForDatabases()
	case "session_variables", "global_variables":
		return m.tableForVariables(table)
	case "procedures", "functions":
		return m.tableForProcedures(table)
	case "engines":
		return m.tableForEngines()
	case "indexes", "keys":
		return m.tableForIndexes()
	case "status":
		return m.tableForVariables(table)
	case "columns":
		return m.tableForTable(table)
	default:
		return m.tableForTable(table)
	}
}
1302623
func (tz *TzArchive) DeleteName(name string) error {
	for i, f := range tz.files {
		if f.Name == name {
			return tz.DeleteIndex(i)
		}
	}
	return errors.New("entry with given name not found")
}
212107
func (db *Database) DeleteIndex(ctx context.Context, id string) error {
	if db.RemoteClient == nil {
		return nil
	}
	return deleteIndex(db.RemoteClient.NewContext(ctx), id)
}