MCPcopy Create free account
hub / github.com/rilldata/rill / dbFilePath

Method dbFilePath

runtime/drivers/sqlite/backups.go:290–300  ·  view source on GitHub ↗

dbFilePath gets the file path of the SQLite database. It returns the empty string if the database is in-memory.

(ctx context.Context)

Source from the content-addressed store, hash-verified

288// dbFilePath gets the file path of the SQLite database.
289// It returns the empty string if the database is in-memory.
290func (c *connection) dbFilePath(ctx context.Context) (string, error) {
291 var file string
292 err := c.db.QueryRowContext(ctx, `SELECT file FROM pragma_database_list WHERE name = 'main';`).Scan(&file)
293 if err != nil {
294 return "", err
295 }
296 if file == "" || file == ":memory:" || file == "file::memory:" {
297 return "", nil
298 }
299 return file, nil
300}

Callers 3

startBackupsMethod · 0.95
backupMethod · 0.95
TestDBFilePathFunction · 0.80

Calls 2

QueryRowContextMethod · 0.80
ScanMethod · 0.65

Tested by 1

TestDBFilePathFunction · 0.64