Django complementary index definition and management.
Project description
Describe your database index in json files into your apps
Detailed documentation is in the “docs” directory.
Quick start
Add “json_dbindex” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = ( ... 'json_dbindex', )
Run python manage.py list_jsindex to list all defined indexes.
Create indexes
Create a file in you app directory called dbindex_create.json with following contents
- [{“name”: “django_site_composite_idx”,
“table”: “django_site”, “columns”: [“domain”,”name”], “predicat”: “WHERE id > 1000”, “using”: “btree”, “database”: “default”, “unique”: yes}]
Trying to create an existing index will not generate an error, only a logging at level notice will be raised.
Drop indexes
Create a file in you app directory called dbindex_drop.json with following contents.
- [{“name”: “django_site_composite_idx”},
{“name”: “django_site_domain_idx”}]
Only the name is required. In the above example two indexes will be dropped. Trying to drop a non existing index will not generate an error, only a logging at level notice will be raised.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-json-dbindex-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 072db606cc3b7db73e4aebed34aa9df29681d8548c3ffb5c69ffe4e02240f019 |
|
MD5 | eee00c16b87d710fd49185fa66c2a1fb |
|
BLAKE2b-256 | 1d33dd276cee14002e341835c27deba58ef7923c2fee6b50b092ec1d605df819 |