Skip to content

Commit 1d78b8f

Browse files
adamchainzsobolevn
andauthored
Add SQLite backend is_in_memory_db() functions (#1218)
* Add SQLite backend is_in_memory_db() functions * Update django-stubs/db/backends/sqlite3/creation.pyi Co-authored-by: Nikita Sobolev <[email protected]>
1 parent e865c5b commit 1d78b8f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

django-stubs/db/backends/sqlite3/base.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class DatabaseWrapper(BaseDatabaseWrapper):
2626
introspection_class: Type[DatabaseIntrospection]
2727
ops_class: Type[DatabaseOperations]
2828

29+
def is_in_memory_db(self) -> bool: ...
30+
2931
FORMAT_QMARK_REGEX: Any
3032

3133
class SQLiteCursorWrapper(Database.Cursor): ...
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
from os import PathLike
2+
from typing import Union
3+
14
from django.db.backends.base.creation import BaseDatabaseCreation
25
from django.db.backends.sqlite3.base import DatabaseWrapper
36

47
class DatabaseCreation(BaseDatabaseCreation):
58
connection: DatabaseWrapper
9+
10+
@staticmethod
11+
def is_in_memory_db(database_name: Union[str, PathLike[str]]) -> bool: ...

0 commit comments

Comments
 (0)