Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-json-dbindex

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-json-dbindex

Django complementary index definition and management.

  • 1.2.3
  • PyPI
  • Socket score

Maintainers
1

=================== django-json-dbindex

Describe your database index in json files into your apps

Detailed documentation is in the "docs" directory.

Quick start

  1. Add "json_dbindex" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = ( ... 'json_dbindex', )

  2. 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}, | {"name": "django_site_name_idx", | "table": "django_site", | "columns": [{"name": "gist_trgm_ops"}], | "using": "gist", | "extension": "pg_trgm"}]

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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc