// Tables implements Session.
9107
func (m SessionMock) Tables(keyspace string) ([]string, error) {
	var r = m.Called(keyspace)

	return r.Get(0).([]string), r.Error(1)
}
877213
func (s *DB) Table(name string) *DB {
	clone := s.clone()
	clone.search.Table(name)
	clone.Value = nil
	return clone
}
232609
func (session *Session) Cols(columns ...string) *Session {
	session.Statement.Cols(columns...)
	return session
}
1048074
func (m *Schema) Table(tableIn string) (*Table, error) {

	tableName := strings.ToLower(tableIn)

	m.mu.RLock()
	defer m.mu.RUnlock()

	// u.Debugf("%p looking up %q", m, tableName)

	tbl, ok := m.tableMap[tableName]
	if ok && tbl != nil {
		return tbl, nil
	}

	// Lets see if it is   `schema`.`table` format
	_, tableName, ok = expr.LeftRight(tableName)
	if ok {
		tbl, ok = m.tableMap[tableName]
		if ok && tbl != nil {
			return tbl, nil
		}
	}

	if m.SchemaRef != nil {
		return m.SchemaRef.Table(tableIn)
	}
	return nil, fmt.Errorf("Could not find that table: %v", tableIn)
}
1275879
func (builder *TsListKeysCommandBuilder) WithTable(table string) *TsListKeysCommandBuilder {
	builder.protobuf.Table = []byte(table)
	return builder
}
254947
func (session *Session) MustCols(columns ...string) *Session {
	session.Statement.MustCols(columns...)
	return session
}
763692
func (engine *Engine) CreateTables(beans ...interface{}) error {
	session := engine.NewSession()
	defer session.Close()

	err := session.Begin()
	if err != nil {
		return err
	}

	for _, bean := range beans {
		err = session.createTable(bean)
		if err != nil {
			session.Rollback()
			return err
		}
	}
	return session.Commit()
}
511935
func (p *Session) All() (ret int) {
	p.db.Query("select count(*) from " + TABLE_NAME).Row(&ret)
	return
}
1345934
func (c *Client) session() client.Session {
	sess := c.mgoSession.Copy()
	return &Session{sess}
}
601137
func (st *symtab) AllTables() []*table {
	if len(st.tableNames) == 0 {
		return nil
	}
	tables := make([]*table, 0, len(st.tableNames))
	for _, tname := range st.tableNames {
		tables = append(tables, st.tables[tname])
	}
	return tables
}
1333622
func (builder *TsStoreRowsCommandBuilder) WithTable(table string) *TsStoreRowsCommandBuilder {
	builder.protobuf.Table = []byte(table)
	return builder
}
910689
func Sessions(name string, store Store) martini.Handler {
	return func(res http.ResponseWriter, r *http.Request, c martini.Context, l *log.Logger) {
		// Map to the Session interface
		s := &session{name, r, l, store, nil, false}
		c.MapTo(s, (*Session)(nil))

		// Use before hook to save out the session
		rw := res.(martini.ResponseWriter)
		rw.Before(func(martini.ResponseWriter) {
			if s.Written() {
				check(s.Session().Save(r, res), l)
			}
		})

		// clear the context, we don't need to use
		// gorilla context and we don't want memory leaks
		defer context.Clear(r)

		c.Next()
	}
}
1090841
func (session *Session) Cols(columns ...string) *Session {
	session.statement.Cols(columns...)
	return session
}
219283
func GetTables(c *gocql.ClusterConfig) ([]string, error) {
	tables := []string{}
	s, err := c.CreateSession()
	if err != nil {
		return tables, err
	}
	defer s.Close()
	q := s.Query("SELECT columnfamily_name FROM system.schema_columnfamilies WHERE keyspace_name = ?;", c.Keyspace).Iter()
	var tn string
	for q.Scan(&tn) {
		tables = append(tables, tn)
	}
	return tables, q.Close()
}
1055533
func (engine *Engine) DumpTables(tables []*core.Table, w io.Writer, tp ...core.DbType) error {
	return engine.dumpTables(tables, w, tp...)
}
673041
func (session *Session) Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *Session {
	session.Statement.Join(joinOperator, tablename, condition, args...)
	return session
}
561328
func (session *Session) Ping() error {
	defer session.resetStatement()
	if session.IsAutoClose {
		defer session.Close()
	}

	return session.DB().Ping()
}