Full database path. Includes the default location + the database filename.
160901
def database_path(self):
        
        filename = self.database_filename
        db_path = ":memory:" if filename == ":memory:" else (
            path.abspath(path.join(__file__, "../..", "..", "data", filename)))
        return db_path
373869
private function getDatabaseOfTruth() {
    $project_properties = $this->getProjectProperties();
    $default_database = $this->databaseSourceOfTruth();

    if (file_exists('vendor/database.sql.gz')) {
      $default_database = 'local';
    }

    $this->say('This command will drop all tables in your local database and re-populate from a backup .sql.gz file.');
    $this->say('If you already have a database backup in your  vendor folder, the "local" option will be available.');
    $this->say('If you want to grab a more recent backup from Pantheon, type in the environment name (i.e. dev, test, live, my-multidev). This will be saved to your vendor folder for future re-installs.');
    $this->say('Backups are generated on Pantheon regularly, but might be old.');
    $this->say('If you need the very latest data from a Pantheon site, go create a new backup using either the Pantheon backend, or Terminus.');

    $which_database = $this->askDefault(
      'Which database backup should we load (i.e. local/dev/live)?', $default_database
    );

    $getDB = TRUE;
    if ($which_database !== 'local') {
      $getDB = $this->downloadPantheonBackup($which_database);
    }

    if ($getDB) {
      $this->say('Emptying existing database.');
      $empty_database = $this->taskExec('drush sql:drop -y')->dir($project_properties['web_root'])->run();
      return $this->importLocal();
    }
    else {
      $this->yell('Failed to download a Pantheon backup. Database was not refreshed.');
      return false;
    }
  }
1355379
def init_db(db_path):
    """"""
    logger.info("Creating database")
    with closing(connect_database(db_path)) as db:
        with open(SCHEMA, 'r') as f:
            db.cursor().executescript(f.read())
        db.commit()
    return
1146040
def link(self):
    """"""
    if not self.IsLink():
      return ''

    location = getattr(self.path_spec, 'location', None)
    if location is None:
      return ''

    return self._file_system.GetDataByPath(location)
1146816
def db_use_local_file(self, arg, filename=None):
        '''  '''
        # interactive = False  # Never used
        if filename is None:
            # interactive = True  # Never used
            filename = raw_input('Enter the filename of the local SQLLite '
                                 'database you would like to use '
                                 '[default=participants.db]: ')
            if filename == '':
                filename = 'participants.db'
        base_url = "sqlite:///" + filename
        self.config.set("Database Parameters", "database_url", base_url)
        print "Updated database setting (database_url): \n\t", \
        self.config.get("Database Parameters", "database_url")
        if self.server.is_server_running() == 'yes':
            self.server_restart()
770316
def get_db_uri(config, output_dir):
    
    db_config = config.get("results_database", {"db_uri": "default"})
    if db_config['db_uri'] == 'default':
        return os.path.join(output_dir, "results.sqlite")
    return db_config['db_uri']
1238671
def db(self):
        

        # Initialize the database handle
        if not self._db:
            self._db = self.conf.get_database()

        return self._db
279240
def get_db_filename(impl, working_dir):
    
    db_filename = impl.get_virtual_chain_name() + ".db"
    return os.path.join(working_dir, db_filename)
306842
def database_path(cls, project, instance, database):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/instances/{instance}/databases/{database}",
            project=project,
            instance=instance,
            database=database,
        )
215041
def get_db(cls):
        """"""
        if cls._db:
            return getattr(cls._client, cls._db)
        return cls._client.get_default_database()
1160925
def db_url(self, var=DEFAULT_DATABASE_ENV, default=NOTSET, engine=None):
        
        return self.db_url_config(self.get_value(var, default=default), engine=engine)
1103063
def _get_fullpath(self, filepath):
        
        if filepath[0] == '/':
            return filepath
        return os.path.join(self._base_path, filepath)
1098230
def db_url_from_hass_config(path):
    """"""
    config = load_hass_config(path)
    default_path = os.path.join(path, "home-assistant_v2.db")
    default_url = "sqlite:///{}".format(default_path)

    recorder = config.get("recorder")

    if recorder:
        db_url = recorder.get("db_url")
        if db_url is not None:
            return db_url

    if not os.path.isfile(default_path):
        raise ValueError(
            "Unable to determine DB url from hass config at {}".format(path)
        )

    return default_url
1163136
public static String getPathToBase() {
		String path = new File(".").getAbsoluteFile().getParent();

		while( path != null )  {
			File f = new File(path);
			if( !f.exists() )
				break;

			String[] files = f.list();
			if( files == null )
				break;

			boolean foundMain = false;
			boolean foundExamples = false;
			boolean foundIntegration = false;

			for( String s : files ) {
				if( s.compareToIgnoreCase("main") == 0 )
					foundMain = true;
				else if( s.compareToIgnoreCase("examples") == 0 )
					foundExamples = true;
				else if( s.compareToIgnoreCase("integration") == 0 )
					foundIntegration = true;
			}

			if( foundMain && foundExamples && foundIntegration)
				return path;

			path = f.getParent();
		}
		return null;
	}
383081
def document_root_path(cls, project, database):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/databases/{database}/documents",
            project=project,
            database=database,
        )
130647
def sqlite_default():
    '''
    
    '''
    def parse_url(url):
        # TODO: need separate option for a config file
        if url.endswith('.db') or url.endswith('.sqlite'):
            if not url.startswith('sqlite:///'):
                url = 'sqlite:///' + url
        elif url.endswith('.cfg') or url.endswith('.conf'):
            conf = configparser.SafeConfigParser(allow_no_value=True)
            conf.optionxform = str  # options are case-sensitive
            conf.read(url)
            url = conf.get('sqlalchemy', 'url')

        return url
    return parse_url
1097402
function getDBAExtensionFilePath()
    {
        $activeExtensions = eZExtension::activeExtensions();
        $dataTypeString = $this->DataTypeString;
        $dbaFileName = $this->getDBAFileName();
        $fileName = false;
        foreach ( $activeExtensions as $activeExtension )
        {
            $extesionFileName = eZExtension::baseDirectory() . '/' . $activeExtension .
                                '/datatypes/' . $dataTypeString . '/' . $dbaFileName;
            if ( file_exists( $extesionFileName ) )
            {
                $fileName = $extesionFileName;
                break;
            }
        }
        return $fileName;
    }