Skip to content

Commit

Permalink
Add SQLite backend is_in_memory_db() functions (#1218)
Browse files Browse the repository at this point in the history
* Add SQLite backend is_in_memory_db() functions

* Update django-stubs/db/backends/sqlite3/creation.pyi

Co-authored-by: Nikita Sobolev <[email protected]>
  • Loading branch information
adamchainz and sobolevn authored Nov 3, 2022
1 parent e865c5b commit 1d78b8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django-stubs/db/backends/sqlite3/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class DatabaseWrapper(BaseDatabaseWrapper):
introspection_class: Type[DatabaseIntrospection]
ops_class: Type[DatabaseOperations]

def is_in_memory_db(self) -> bool: ...

FORMAT_QMARK_REGEX: Any

class SQLiteCursorWrapper(Database.Cursor): ...
Expand Down
6 changes: 6 additions & 0 deletions django-stubs/db/backends/sqlite3/creation.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from os import PathLike
from typing import Union

from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.backends.sqlite3.base import DatabaseWrapper

class DatabaseCreation(BaseDatabaseCreation):
connection: DatabaseWrapper

@staticmethod
def is_in_memory_db(database_name: Union[str, PathLike[str]]) -> bool: ...

0 comments on commit 1d78b8f

Please sign in to comment.