Get a database and inject it into the list at the
specified index if no db exists at that index.

@param index The database index.
@param opts Database options.
195573
function getDatabase(index, opts) {
  var db;
  if(!this._databases[index]) {
    db = new Database(this, opts);
    this._databases[index] = db;
  }
  return this._databases[index];
}
259379
public boolean isNull(int index) {
		Object value = opt(index);
		return value == null || value == JSONObject.NULL;
	}
526518
public function getCreateIndexSQL(Index $index, $table)
    {
        return parent::getCreateIndexSQL($index, $table) . $this->getAdvancedIndexOptionsSQL($index);
    }
342649
public Optional<Map<String, ?>> getMappings(String index, String
            type) {
        try {
            return Optional
                    .of(getMappingsResponse(index).get(index).get(type)
                            .getSourceAsMap());
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndReturnEmptyOptional
                    (log, e, "getMappings", index, type);
        }
    }
263123
private boolean createIndex(String index, Map<String, Object> defaultSettings) {
        IndicesExistsResponse res = client.admin().indices().prepareExists(index).execute().actionGet();
        boolean created = false;
        if (!res.isExists()) {
            CreateIndexRequestBuilder req = client.admin().indices().prepareCreate(index);
            req.setSettings(defaultSettings);
            created = req.execute().actionGet().isAcknowledged();
            if (!created) {
                throw new RuntimeException("Could not create index [" + index + "]");
            }
        }

        return created;
    }
804986
function addTableOpt( $opt ) {
		if(isset($this->currentPlatform)) {
			$this->opts[$this->parent->db->databaseType] = $opt;
		}
		return $this->opts;
	}
715414
function (opts) {
        var objectName = opts.name
        var object = null

        this.objects.forEach(function (item) {
            if (item.name == objectName) {
                object = item
            }
        })
        if (object !== null) {
            return object
        }
    }
1047017
public <T> T get(int index) {
        if (size() <= index) {
            return null;
        }
        return (T) args.get(index);
    }
1127038
public void registerIndexQuery(long index, Runnable query) {
    // Add a query to be run once the session's index reaches the given index.
    List<Runnable> queries = this.indexQueries.computeIfAbsent(index, v -> new LinkedList<>());
    queries.add(query);
  }
927984
def get_opts(db_uri)
      uri = URI.parse(db_uri)

      {
        :host => uri.host,
        :port => uri.port,
        :user => uri.user,
        :password => uri.password,
        :db => uri.path.gsub('/', '')
      }
    end
256373
public boolean isNull(int index) {
        Object value = opt(index);
        return value == null || value.equals(JSON_NULL);
    }
470435
String getOption(String[] options, int index) {
        if ((options != null) && (options.length > index)) {
            return options[index];
        }
        return null;
    }
1054300
@Override
  public String select(final int index) {
    checkIsInMultiOrPipeline();
    client.select(index);
    String statusCodeReply = client.getStatusCodeReply();
    client.setDb(index);

    return statusCodeReply;
  }
527890
public Object opt( int index ) {
      return (index < 0 || index >= size()) ? null : this.elements.get( index );
   }
50366
public function digipolisDatabaseBackup($database = 'default', $opts = [
      'file-system-config|fsconf' => null,
      'database-config|dbconf' => null,
      'compression|c' => 'gzip',
      'destination|d' => null,
      'destination-type|dtype' => 'local',
    ])
    {
        if (is_callable([$this, 'readProperties'])) {
            $this->readProperties();
        }
        $destination = $opts['destination']
            ? $opts['destination']
            : realpath(getcwd()) . '/project.tar.gz';
        if (!$opts['file-system-config']) {
            $opts['file-system-config'] = [
                $opts['destination-type'] => [
                    'type' => ucfirst($opts['destination-type']),
                    'root' => realpath(dirname($destination)),
                ],
            ];
            $destination = basename($destination);
        }
        return $this->createDbTask('taskDatabaseBackup', $database, $opts)
            ->destination($destination, $opts['destination-type'])
            ->run();
    }
771804
public <E extends Enum<E>> E optEnum(Class<E> clazz, int index) {
        return this.optEnum(clazz, index, null);
    }
1072403
public Optional<E> get(int index) {
        return getOptional(linkedList)
                .filter(getGreaterSize(0).and(getGreaterSize(index)))
                .map(l -> l.get(index));
    }