- New release notes here
- Fixed some features to work when there are non-MySQL databases configured
- Fixed
JSONField
to allow control characters, which MySQL does - but not in a top-level string, only inside a JSON object/array.
SmartChunkedIterator
now fails properly for models whose primary key is a non-integer foreign key.pty
is no longer imported at the top-level indjango_mysql.utils
, fixing Windows compatibility.
- Added new
JSONField
class backed by the JSON type added in MySQL 5.7. - Added database functions
JSONExtract
,JSONKeys
, andJSONLength
that wrap the JSON functions added in MySQL 5.7, which can be used with the JSON type columns as well as JSON data held in text/varchar columns. - Added
If
database function for simple conditionals.
- Now MySQL 5.7 compatible
- The final message from
SmartChunkedIterator
is now rounded to the nearest second. Lock
andTableLock
classes now haveacquire
andrelease()
methods for using them as normal objects rather than context managers
- Added
manage.py
commandfix_datetime_columns
that outputs the SQL necessary to fix anydatetime
columns intodatetime(6)
, as required when upgrading a database to MySQL 5.6+, or MariaDB 5.3+. SmartChunkedIterator
output now includes the total time taken and number of objects iterated over in the final message.
- Fixed the new system checks to actually work
- Fixed
EnumField
so that it works properly with forms, and does not accept themax_length
argument. SmartChunkedIterator
output has been fixed for reversed iteration, and now includes a time estimate.- Added three system checks that give warnings if the MySQL configuration can (probably) be improved.
- New function
add_QuerySetMixin
allows addding theQuerySetMixin
to arbitraryQuerySet
s, for when you can't edit a model class. - Added field class
EnumField
that uses MySQL'sENUM
data type.
- Added
chunk_min
argument toSmartChunkedIterator
- Changed version number to 1.0.0 to indicate maturity.
- Added
DynamicField
for using MariaDB's Named Dynamic Columns, and related database functionsColumnAdd
,ColumnDelete
, andColumnGet
. SmartChunkedIterator
withreport_progress=True
correctly reports 'lowest pk so far' when iterating in reverse.- Fix broken import paths during
deconstruct()
for subclasses of all fields:ListCharField
,ListTextField
,SetCharField
,SetTextField
,SizedBinaryField
andSizedTextField
- Added XML database functions -
UpdateXML
andXMLExtractValue
.
- Allow
approx_count
on QuerySets for which only query hints have been used - Added index query hints to
QuerySet
methods, via query-rewriting layer - Added
ordering
parameter toGroupConcat
to specify theORDER BY
clause - Added index query hints to
QuerySet
methods, via query-rewriting layer - Added
sql_calc_found_rows()
query hint that calculates the total rows that match when you only take a slice, which becomes available on thefound_rows
attribute - Made
SmartChunkedIterator
work withreverse()
'dQuerySet
s
SmartChunkedIterator
now takes an argumentchunk_size
as the initial chunk sizeSmartChunkedIterator
now allows models whose primary key is aForeignKey
- Added
iter_smart_pk_ranges
which is similar toiter_smart_chunks
but yields only the start and end primary keys for each chunks, in a tuple. - Added prefix methods to
MySQLCache
-delete_with_prefix
,get_with_prefix
,keys_with_prefix
- Added
Bit1BooleanField
andNullBit1BooleanField
model fields that work with boolean fields built by other databases that use theBIT(1)
column type
- Added Regexp database functions for MariaDB -
RegexpInstr
,RegexpReplace
, andRegexpSubstr
- Added the option to not limit the size of a
MySQLCache
by settingMAX_ENTRIES
= -1. MySQLCache
performance improvements in get, get_many, and has_key- Added query-rewriting layer added which allows the use of MySQL query hints
such as
STRAIGHT_JOIN
via QuerySet methods, as well as adding label comments to track where queries are generated. - Added
TableLock
context manager
- More database functions added -
Field
and its complementELT
, andLastInsertId
- Case sensitive string lookup added as to the ORM for
CharField
andTextField
- Migration operations added -
InstallPlugin
,InstallSOName
, andAlterStorageEngine
- Extra ORM aggregates added -
BitAnd
,BitOr
, andBitXor
MySQLCache
is now case-sensitive. If you are already using it, an upgradeALTER TABLE
and migration is provided at the end of the cache docs.- (MariaDB only) The
Lock
class gained a class methodheld_with_prefix
to query held locks matching a given prefix SmartIterator
bugfix for chunks with 0 objects slowing iteration; they such chunks most often occur on tables with primary key "holes"- Now tested against Django master for cutting edge users and forwards compatibility
- Added the
MySQLCache
backend for use with Django's caching framework, a more efficient version ofDatabaseCache
- Fix a
ZeroDivision
error inWeightedAverageRate
, which is used in smart iteration
pt_visual_explain
no longer executes the given query before fetching itsEXPLAIN
- New
pt_fingerprint
function that wraps thept-fingerprint
tool efficiently - For
List
fields, the newListF
class allows you to do atomic append or pop operations from either end of the list in a single query - For
Set
fields, the newSetF
class allows you to do atomic add or remove operatiosn from the set in a single query - The
@override_mysql_variables
decorator has been introduced which makes testing code with different MySQL configurations easy - The
is_mariadb
property gets added onto Django's MySQLconnection
class automatically - A race condition in determining the minimum and maximum primary key values for smart iteration was fixed.
- Add
Set
andList
fields which can store comma-separated sets and lists of a base field with MySQL-specific lookups - Support MySQL's
GROUP_CONCAT
as an aggregate! - Add a
functions
module with many MySQL-specific functions for the new Django 1.8 database functions feature - Allow access of the global and session status for the default connection from
a lazy singleton, similar to Django's
connection
object - Fix a different recursion error on
count_tries_approx
- Renamed
connection_name
argument tousing
onLock
,GlobalStatus
, andSessionStatus
classes, for more consistency with Django. - Fix recursion error on
QuerySetMixin
when usingcount_tries_approx
- Added support for
HANDLER
statements as aQuerySet
extension - Now tested on Django 1.8
- Add
pk_range
argument for 'smart iteration' code
- Added
manage.py
commanddbparams
for outputting database paramters in formats useful for shell scripts
- Fix release process
- Added
pt_visual_explain
integration onQuerySet
- Added soundex-based field lookups for the ORM
- Added
get_many
toGlobalStatus
- Added
wait_until_load_low
toGlobalStatus
which allows you to wait for any high load on your database server to dissipate. - Added smart iteration classes and methods for
QuerySet
s that allow efficient iteration over very large sets of objects slice-by-slice.
- Added
Model
andQuerySet
subclasses which add theapprox_count
method
- First release on PyPI
Lock
sGlobalStatus
andSessionStatus