Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
c0e3c65b
Kaydet (Commit)
c0e3c65b
authored
Tem 20, 2018
tarafından
Andrew Brown
Kaydeden (comit)
Tim Graham
Tem 25, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29563 -- Added result streaming for QuerySet.iterator() on SQLite.
üst
55810d94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
features.py
django/db/backends/sqlite3/features.py
+4
-5
databases.txt
docs/ref/databases.txt
+13
-0
querysets.txt
docs/ref/models/querysets.txt
+13
-4
2.2.txt
docs/releases/2.2.txt
+1
-1
No files found.
django/db/backends/sqlite3/features.py
Dosyayı görüntüle @
c0e3c65b
...
...
@@ -4,11 +4,10 @@ from django.utils.functional import cached_property
class
DatabaseFeatures
(
BaseDatabaseFeatures
):
# SQLite cannot handle us only partially reading from a cursor's result set
# and then writing the same rows to the database in another cursor. This
# setting ensures we always read result sets fully into memory all in one
# go.
can_use_chunked_reads
=
False
# SQLite can read from a cursor since SQLite 3.6.5, subject to the caveat
# that statements within a connection aren't isolated from each other. See
# https://sqlite.org/isolation.html.
can_use_chunked_reads
=
True
test_db_allows_multiple_connections
=
False
supports_unspecified_pk
=
True
supports_timezones
=
False
...
...
docs/ref/databases.txt
Dosyayı görüntüle @
c0e3c65b
...
...
@@ -710,6 +710,19 @@ can use the "pyformat" parameter style, where placeholders in the query
are given as ``'%(name)s'`` and the parameters are passed as a dictionary
rather than a list. SQLite does not support this.
.. _sqlite-isolation:
Isolation when using ``QuerySet.iterator()``
--------------------------------------------
There are special considerations described in `Isolation In SQLite`_ when
modifying a table while iterating over it using :meth:`.QuerySet.iterator`. If
a row is added, changed, or deleted within the loop, then that row may or may
not appear, or may appear twice, in subsequent results fetched from the
iterator. Your code must handle this.
.. _`Isolation in SQLite`: https://sqlite.org/isolation.html
.. _oracle-notes:
Oracle notes
...
...
docs/ref/models/querysets.txt
Dosyayı görüntüle @
c0e3c65b
...
...
@@ -2178,10 +2178,15 @@ don't support server-side cursors.
Without server-side cursors
^^^^^^^^^^^^^^^^^^^^^^^^^^^
MySQL and SQLite don't support streaming results, hence the Python database
drivers load the entire result set into memory. The result set is then
transformed into Python row objects by the database adapter using the
``fetchmany()`` method defined in :pep:`249`.
MySQL doesn't support streaming results, hence the Python database driver loads
the entire result set into memory. The result set is then transformed into
Python row objects by the database adapter using the ``fetchmany()`` method
defined in :pep:`249`.
SQLite can fetch results in batches using ``fetchmany()``, but since SQLite
doesn't provide isolation between queries within a connection, be careful when
writing to the table being iterated over. See :ref:`sqlite-isolation` for
more information.
The ``chunk_size`` parameter controls the size of batches Django retrieves from
the database driver. Larger batches decrease the overhead of communicating with
...
...
@@ -2195,6 +2200,10 @@ psycopg mailing list <https://www.postgresql.org/message-id/4D2F2C71.8080805%40d
between the number of rows transferred and the data discarded if the loop
is exited early.
.. versionchanged:: 2.2
Support for result streaming on SQLite was added.
``latest()``
~~~~~~~~~~~~
...
...
docs/releases/2.2.txt
Dosyayı görüntüle @
c0e3c65b
...
...
@@ -126,7 +126,7 @@ CSRF
Database backends
~~~~~~~~~~~~~~~~~
*
..
.
*
Added result streaming for :meth:`.QuerySet.iterator` on SQLite
.
Email
~~~~~
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment