Set keyspace for all connection models
510363
def set_models_keyspace(self, keyspace):
        """"""

        for models in self.connection.introspection.cql_models.values():
            for model in models:
                model.__keyspace__ = keyspace
1320927
private void executeDelKeySpace(Tree statement)
            throws TException, InvalidRequestException, NotFoundException, SchemaDisagreementException
    {
        if (!CliMain.isConnected())
            return;

        String keyspaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
        String version = thriftClient.system_drop_keyspace(keyspaceName);
        sessionState.out.println(version);

        if (keyspaceName.equals(keySpace)) //we just deleted the keyspace we were authenticated too
            keySpace = null;
    }
26279
public void setupKeys()
    {
        KeyAreaInfo keyArea = null;
        keyArea = new KeyAreaInfo(this, Constants.UNIQUE, ID_KEY);
        keyArea.addKeyField(ID, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, MESSAGE_INFO_ID_KEY);
        keyArea.addKeyField(MESSAGE_INFO_ID, Constants.ASCENDING);
        keyArea.addKeyField(MESSAGE_TYPE_ID, Constants.ASCENDING);
        keyArea.addKeyField(PROCESS_TYPE_ID, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, DESCRIPTION_KEY);
        keyArea.addKeyField(DESCRIPTION, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.NOT_UNIQUE, CODE_KEY);
        keyArea.addKeyField(CODE, Constants.ASCENDING);
    }
557851
public Collection<String> getKeyspaces(DBConn dbConn) {
        List<String> result = new ArrayList<>();
        try {
            for (KsDef ksDef : dbConn.getClientSession().describe_keyspaces()) {
                result.add(ksDef.getName());
            }
        } catch (Exception e) {
            String errMsg = "Failed to get keyspace description";
            m_logger.error(errMsg, e);
            throw new RuntimeException(errMsg, e);
        }
        return result;
    }
888134
public Schema load(KSMetaData keyspaceDef)
    {
        for (CFMetaData cfm : keyspaceDef.cfMetaData().values())
            load(cfm);

        setKeyspaceDefinition(keyspaceDef);

        return this;
    }
222971
@Override
    public void createNamespace() {
        KeyspaceMetadata ksMetadata = m_cluster.getMetadata().getKeyspace(m_keyspace);
        if (ksMetadata == null) {
            new CQLSchemaManager(this).createKeyspace();
        }
    }
544845
def set(self, key, value, glob=False):
        """"""
        ns = self.namespace(key, glob)
        self.keyring.set_password(ns, key, value)
1004374
@NonNull
  public BatchStatementBuilder setKeyspace(@NonNull String keyspaceName) {
    return setKeyspace(CqlIdentifier.fromCql(keyspaceName));
  }
464070
def backspace_changed(self, settings, key, user_data):
        
        for i in self.guake.notebook_manager.iter_terminals():
            i.set_backspace_binding(self.getEraseBinding(settings.get_string(key)))
1154001
def add_kb_mapping(kb_name, key, value=""):
    
    kb = get_kb_by_name(kb_name)
    if key in kb.kbrvals:
        # update
        kb.kbrvals[key].m_value = value
    else:
        # insert
        kb.kbrvals.set(models.KnwKBRVAL(m_key=key, m_value=value))
768086
function(connection, options){
    if(!connection) throw "Data connection configuration undefined";
    options = options || {};
    this._options = lodash.defaults(options, {
        replication_strategy : {'class' : 'SimpleStrategy', 'replication_factor' : DEFAULT_REPLICATION_FACTOR }
    });
    this._models = {};
    this._keyspace = connection.keyspace;
    this._connection = connection;
    //Compatibility with old parameters name
    if(this._connection.hosts && !this._connection.contactPoints)
        this._connection.contactPoints = this._connection.hosts;
    this._client = null;
}
247053
def set_keyspace(self, keyspace):
        
        self.keyspace = keyspace
        dfrds = []
        for p in self._protos:
            dfrds.append(p.submitRequest(ManagedThriftRequest(
                'set_keyspace', keyspace)))
        return defer.gatherResults(dfrds)
1218883
def describe_keyspaces(self, ):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_describe_keyspaces()
    return d
118785
function namespace() {
  var args = Array.prototype.slice.call(arguments);
  var setComponents = function(context, first, rest) {
    if(!context[first]) {
      context[first] = {
        models: {},
        collections: {},
        views: {},
      };
    }
    if(rest.length) {
      setComponents(context[first], _.first(rest), _.rest(rest));
    }
  };
  setComponents(window, _.first(args), _.rest(args));
}
346902
KeyFactory newNativeKeyFactory() {
    KeyFactory keyFactory = datastore.newKeyFactory();
    String namespace = Tenant.getNamespace();
    if (namespace != null) {
      keyFactory.setNamespace(namespace);
    }
    return keyFactory;
  }
395745
def connection(model_connections):
    

    # for each connection group
    for connection_str in model_connections:

        # the services to connect
        services = connection_str.split(':')
        services.sort()

        service_name = ''.join([service.title() for service in services])

        # the template context
        context = {
            # make sure the first letter is lowercase
            'name': service_name[0].lower() + service_name[1:],
            'services': services,
        }

        render_template(template='common', context=context)
        render_template(template='connection', context=context)
1113322
def create_space(self):
        ''''''
        cur = self._conn.cursor()
        cur.executescript(SQL_MODEL)
        self._conn.commit()
        cur.close()
        return