Skip to content

Commit 22ebd0a

Browse files
streeckblueyed
authored andcommitted
docs: add warning about sqlite specific snippet + fix typos [ci skip] (#666)
1 parent 8f741ff commit 22ebd0a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/database.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ Create the test database from a custom SQL script
419419

420420
You can replace the :fixture:`django_db_setup` fixture and run any code in its
421421
place. This includes creating your database by hand by running a SQL script
422-
directly. This example shows how sqlite3's executescript method. In more a more
423-
general use cases you probably want to load the SQL statements from a file or
422+
directly. This example shows sqlite3's executescript method. In a more
423+
general use case, you probably want to load the SQL statements from a file or
424424
invoke the ``psql`` or the ``mysql`` command line tool.
425425

426426
Put this in ``conftest.py``::
@@ -439,6 +439,11 @@ Put this in ``conftest.py``::
439439
INSERT INTO theapp_item (name) VALUES ('created from a sql script');
440440
''')
441441

442+
.. warning::
443+
This snippet shows ``cursor().executescript()`` which is `sqlite` specific, for
444+
other database engines this method might differ. For instance, psycopg2 uses
445+
``cursor().execute()``.
446+
442447

443448
Use a read only database
444449
""""""""""""""""""""""""

0 commit comments

Comments
 (0)