withResolvedLocalPath method

  1. @override
SqliteDatabaseConfig withResolvedLocalPath(
  1. String baseDirectory
)
override

Returns this config with a relative filePath resolved against baseDirectory.

:memory: and absolute paths are returned unchanged. Use this at the server boundary; SqliteDatabaseConfig consumers (including clients) should not assume a process working directory.

Implementation

@override
SqliteDatabaseConfig withResolvedLocalPath(String baseDirectory) {
  if (filePath == ':memory:' || path.isAbsolute(filePath)) return this;
  return SqliteDatabaseConfig(
    filePath: path.normalize(path.join(baseDirectory, filePath)),
    maxConnectionCount: maxConnectionCount,
  );
}