- Prevent
collections.abc.Sequencewarning.
- Update Python support to 3.5-3.8.
- Converted setuptools metadata to configuration file. This meant removing the
__version__attribute from the package. If you want to inspect the installed version, useimportlib.metadata.version("django-mysql")(docs / backport). - Fix
GroupConcatto work with bothseparatorandorderingset. (PR #596).
- Update Python support to 3.5-3.7, as 3.4 has reached its end of life.
- Always cast SQL params to tuples in ORM code.
- Remove authors file and documentation page. This was showing only 4 out of the 17 total contributors.
- Tested on Django 2.2. No changes were needed for compatibility.
- Remove universal wheel. Version 3.0.0 has been pulled from PyPI after being up for 3 hours to fix mistaken installs on Python 2.
- Drop Python 2 support, only Python 3.4+ is supported now.
- Drop Django 1.8, 1.9, and 1.10 support. Only Django 1.11+ is supported now.
- Django 2.1 compatibility - no code changes were required, releasing for PyPI trove classifiers and documentation.
- Added
JSONArrayAppenddatabase function that wraps the respective JSON-modifying function from MySQL 5.7.
- Made
EnumFieldescape its arguments in apymysql-friendly fashion.
- Started testing with MariaDB 10.3.
- Changed
GlobalStatus.wait_until_load_low()to increase the default number of allowed running threads from 5 to 10, to account for the new default threads in MariaDB 10.3. - Added
encoderanddecoderarguments toJSONFieldfor customizing the way JSON is encoded and decoded from the database. - Added a
touchmethod to theMySQLCacheto refresh cache keys, as added in Django 2.1. - Use a temporary database connection in system checks to avoid application startup stalls.
- Fixed some crashes from
DynamicFieldinstances without explicitspecdefinitions. - Fixed a crash in system checks for
ListCharFieldandSetCharFieldinstances missingmax_length.
- Fixed
JSONField.deconstruct()to not break the path for subclasses.
- Add
output_fieldargument toJSONExtractfunction. - Improved DB version checks for
JSONFieldandDynamicFieldso you can have just one connection that supports them. - Django 2.0 compatibility.
- Changed subprocess imports for compatibility with Google App Engine.
- (Insert new release notes below this line)
- Made
MySQLCache.set_manyreturn a list as per Django 2.0.
- Django 1.11 compatibility
- Some fixes to work with new versions of
mysqlclient
Fixed
JSONFieldmodel field string serialization. This is a small backwards incompatible change.Storing strings mostly used to crash with MySQL error -1 "error totally whack", but in the case your string was valid JSON, it would store it as a JSON object at the MySQL layer and deserialize it when returned. For example you could do this:
>>> mymodel.attrs = '{"foo": "bar"}' >>> mymodel.save() >>> mymodel = MyModel.objects.get(id=mymodel.id) >>> mymodel.attrs {'foo': 'bar'}
The new behaviour now correctly returns what you put in:
>>> mymodel.attrs '{"foo": "bar"}'
Removed the
connection.is_mariadbmonkey patch. This is a small backwards incompatible change. Instead of using it, usedjango_mysql.utils.connection_is_mariadb.
- Only use Django's vendored six (
django.utils.six). Fixes usage ofEnumFieldand field lookups whensixis not installed as a standalone package. - Added
JSONInsert,JSONReplaceandJSONSetdatabase functions that wraps the respective JSON-modifying functions from MySQL 5.7. - Fixed
JSONFieldto work with Django's serializer framework, as used in e.g.dumpdata. - Fixed
JSONFieldform field so that it doesn't overquote inputs when redisplaying the form due to invalid user input.
- Don't allow NaN in
JSONFieldbecause MySQL doesn't support it
- Dropped Django 1.7 support
- Made the query hint functions raise
RuntimeErrorif you haven't activated the query-rewriting layer in settings.
- Fixed some features to work when there are non-MySQL databases configured
- Fixed
JSONFieldto allow control characters, which MySQL does - but not in a top-level string, only inside a JSON object/array.
SmartChunkedIteratornow fails properly for models whose primary key is a non-integer foreign key.ptyis no longer imported at the top-level indjango_mysql.utils, fixing Windows compatibility.
- Added new
JSONFieldclass backed by the JSON type added in MySQL 5.7. - Added database functions
JSONExtract,JSONKeys, andJSONLengththat 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
Ifdatabase function for simple conditionals.
- Now MySQL 5.7 compatible
- The final message from
SmartChunkedIteratoris now rounded to the nearest second. LockandTableLockclasses now haveacquireandrelease()methods for using them as normal objects rather than context managers
- Added
manage.pycommandfix_datetime_columnsthat outputs the SQL necessary to fix anydatetimecolumns intodatetime(6), as required when upgrading a database to MySQL 5.6+, or MariaDB 5.3+. SmartChunkedIteratoroutput 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
EnumFieldso that it works properly with forms, and does not accept themax_lengthargument. SmartChunkedIteratoroutput 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_QuerySetMixinallows addding theQuerySetMixinto arbitraryQuerySets, for when you can't edit a model class. - Added field class
EnumFieldthat uses MySQL'sENUMdata type.
- Added
chunk_minargument toSmartChunkedIterator
- Changed version number to 1.0.0 to indicate maturity.
- Added
DynamicFieldfor using MariaDB's Named Dynamic Columns, and related database functionsColumnAdd,ColumnDelete, andColumnGet. SmartChunkedIteratorwithreport_progress=Truecorrectly reports 'lowest pk so far' when iterating in reverse.- Fix broken import paths during
deconstruct()for subclasses of all fields:ListCharField,ListTextField,SetCharField,SetTextField,SizedBinaryFieldandSizedTextField - Added XML database functions -
UpdateXMLandXMLExtractValue.
- Allow
approx_counton QuerySets for which only query hints have been used - Added index query hints to
QuerySetmethods, via query-rewriting layer - Added
orderingparameter toGroupConcatto specify theORDER BYclause - Added index query hints to
QuerySetmethods, 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_rowsattribute - Made
SmartChunkedIteratorwork withreverse()'dQuerySets
SmartChunkedIteratornow takes an argumentchunk_sizeas the initial chunk sizeSmartChunkedIteratornow allows models whose primary key is aForeignKey- Added
iter_smart_pk_rangeswhich is similar toiter_smart_chunksbut 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
Bit1BooleanFieldandNullBit1BooleanFieldmodel 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
MySQLCacheby settingMAX_ENTRIES= -1. MySQLCacheperformance improvements in get, get_many, and has_key- Added query-rewriting layer added which allows the use of MySQL query hints
such as
STRAIGHT_JOINvia QuerySet methods, as well as adding label comments to track where queries are generated. - Added
TableLockcontext manager
- More database functions added -
Fieldand its complementELT, andLastInsertId - Case sensitive string lookup added as to the ORM for
CharFieldandTextField - Migration operations added -
InstallPlugin,InstallSOName, andAlterStorageEngine - Extra ORM aggregates added -
BitAnd,BitOr, andBitXor MySQLCacheis now case-sensitive. If you are already using it, an upgradeALTER TABLEand migration is provided at the end of the cache docs.- (MariaDB only) The
Lockclass gained a class methodheld_with_prefixto query held locks matching a given prefix SmartIteratorbugfix 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
MySQLCachebackend for use with Django's caching framework, a more efficient version ofDatabaseCache - Fix a
ZeroDivisionerror inWeightedAverageRate, which is used in smart iteration
pt_visual_explainno longer executes the given query before fetching itsEXPLAIN- New
pt_fingerprintfunction that wraps thept-fingerprinttool efficiently - For
Listfields, the newListFclass allows you to do atomic append or pop operations from either end of the list in a single query - For
Setfields, the newSetFclass allows you to do atomic add or remove operatiosn from the set in a single query - The
@override_mysql_variablesdecorator has been introduced which makes testing code with different MySQL configurations easy - The
is_mariadbproperty gets added onto Django's MySQLconnectionclass automatically - A race condition in determining the minimum and maximum primary key values for smart iteration was fixed.
- Add
SetandListfields which can store comma-separated sets and lists of a base field with MySQL-specific lookups - Support MySQL's
GROUP_CONCATas an aggregate! - Add a
functionsmodule 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
connectionobject - Fix a different recursion error on
count_tries_approx
- Renamed
connection_nameargument tousingonLock,GlobalStatus, andSessionStatusclasses, for more consistency with Django. - Fix recursion error on
QuerySetMixinwhen usingcount_tries_approx
- Added support for
HANDLERstatements as aQuerySetextension - Now tested on Django 1.8
- Add
pk_rangeargument for 'smart iteration' code
- Added
manage.pycommanddbparamsfor outputting database paramters in formats useful for shell scripts
- Fix release process
- Added
pt_visual_explainintegration onQuerySet - Added soundex-based field lookups for the ORM
- Added
get_manytoGlobalStatus - Added
wait_until_load_lowtoGlobalStatuswhich allows you to wait for any high load on your database server to dissipate. - Added smart iteration classes and methods for
QuerySets that allow efficient iteration over very large sets of objects slice-by-slice.
- Added
ModelandQuerySetsubclasses which add theapprox_countmethod
- First release on PyPI
LocksGlobalStatusandSessionStatus