diff --git a/databases/core.py b/databases/core.py
index c9e074f..62a2487 100644
--- a/databases/core.py
+++ b/databases/core.py
@@ -246,6 +246,11 @@ class Transaction:
             await self._connection.__aexit__()
 
 
+class _EmptyNetloc(str):
+    def __bool__(self) -> bool:
+        return True
+
+
 class DatabaseURL:
     def __init__(self, url: typing.Union[str, "DatabaseURL"]):
         self._url = str(url)
@@ -282,6 +287,10 @@ class DatabaseURL:
     def port(self) -> typing.Optional[int]:
         return self.components.port
 
+    @property
+    def netloc(self) -> typing.Optional[str]:
+        return self.components.netloc
+
     @property
     def database(self) -> str:
         return self.components.path.lstrip("/")
@@ -317,6 +326,11 @@ class DatabaseURL:
             driver = kwargs.pop("driver", self.driver)
             kwargs["scheme"] = f"{dialect}+{driver}" if driver else dialect
 
+        if not kwargs.get("netloc", self.netloc):
+            # Using an empty string that evaluates as True means we end
+            # up with URLs like `sqlite:///database` instead of `sqlite:/database`
+            kwargs["netloc"] = _EmptyNetloc()
+
         components = self.components._replace(**kwargs)
         return self.__class__(components.geturl())
 

Bug: sqlite url replace does not work
Testcase:

```python
def test_replace_database_url_components_sqlite():
    u = DatabaseURL("sqlite:///mydatabase.db")

    assert u.database == "mydatabase.db"
    new = u.replace(database="test_" + u.database)
    assert new.database == "test_mydatabase.db"
    assert str(new) == "sqlite:///test_mydatabase.db"
```

Pytest traceback:

```
E       AssertionError: assert 'sqlite:/test_mydatabase.db' == 'sqlite:///test_mydatabase.db'
E         - sqlite:/test_mydatabase.db
E         + sqlite:///test_mydatabase.db
E         ?        ++
```
If I find a solution I'll make a PR. But so far I couldn't make it work
diff --git a/tests/test_database_url.py b/tests/test_database_url.py
index 49ad281..d587df9 100644
--- a/tests/test_database_url.py
+++ b/tests/test_database_url.py
@@ -40,3 +40,9 @@ def test_replace_database_url_components():
     new = u.replace(port=123)
     assert new.port == 123
     assert str(new) == "postgresql://localhost:123/mydatabase"
+
+    u = DatabaseURL("sqlite:///mydatabase")
+    assert u.database == "mydatabase"
+    new = u.replace(database="test_" + u.database)
+    assert new.database == "test_mydatabase"
+    assert str(new) == "sqlite:///test_mydatabase"

pip install -e .[postgresql,mysql,sqlite]
parse_log_pytest
requirements.txt
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aiocontextvars==0.2.2
aiomysql==0.0.22
aiosqlite==0.17.0
anyio==3.6.2
asyncpg==0.26.0
attrs==22.2.0
autoflake==1.4
black==22.8.0
certifi==2021.5.30
charset-normalizer==2.0.12
click==8.0.4
codecov==2.1.13
contextlib2==21.6.0
contextvars==2.4
coverage==6.2
-e git+https://github.com/encode/databases.git@76b04c2a9c37227db859cf4b8f1efeff7fc0b9c1#egg=databases
dataclasses==0.8
idna==3.10
immutables==0.19
importlib-metadata==4.8.3
iniconfig==1.1.1
isort==5.10.1
mypy==0.971
mypy-extensions==1.0.0
packaging==21.3
pathspec==0.9.0
platformdirs==2.4.0
pluggy==1.0.0
psycopg2-binary==2.9.5
py==1.11.0
pyflakes==3.0.1
PyMySQL==0.9.3
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
requests==2.27.1
sniffio==1.2.0
SQLAlchemy==1.3.0b3
starlette==0.19.1
tomli==1.2.3
typed-ast==1.5.5
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: databases
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aiocontextvars==0.2.2
      - aiomysql==0.0.22
      - aiosqlite==0.17.0
      - anyio==3.6.2
      - asyncpg==0.26.0
      - attrs==22.2.0
      - autoflake==1.4
      - black==22.8.0
      - charset-normalizer==2.0.12
      - click==8.0.4
      - codecov==2.1.13
      - contextlib2==21.6.0
      - contextvars==2.4
      - coverage==6.2
      - dataclasses==0.8
      - idna==3.10
      - immutables==0.19
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isort==5.10.1
      - mypy==0.971
      - mypy-extensions==1.0.0
      - packaging==21.3
      - pathspec==0.9.0
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - psycopg2-binary==2.9.5
      - py==1.11.0
      - pyflakes==3.0.1
      - pymysql==0.9.3
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - requests==2.27.1
      - sniffio==1.2.0
      - sqlalchemy==1.3.0b3
      - starlette==0.19.1
      - tomli==1.2.3
      - typed-ast==1.5.5
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/databases

tests/test_database_url.py::test_replace_database_url_components
tests/test_database_url.py::test_database_url_repr tests/test_database_url.py::test_database_url_properties
databases/core.py
databases/core.py