Skip to main content

Fake django database backends to generate sql without a real database

Project description

https://travis-ci.org/David-Wobrock/django-fake-database-backends.svg?branch=master https://img.shields.io/pypi/v/django-fake-database-backends.svg

Motivations

This project intends to propose django database backends which can be used to generated SQL, without actually having the databases set up. The main use case is using the built-in django command manage.py sqlmigrate.

These backends are not intended to be used for any production, migration or storage. They will nicely fail when you try to actually establish an actual database connection.

The need for this library comes from the tests of django-migration-linter which needed to generate SQL from a backend that was not sqlite3, but without having to install a database client library.

Installation

pip install django-fake-database-backends

Usage

In your project settings file, presumably settings.py, use one of the available backends:

DATABASES = {
    'default': {
        'ENGINE': 'django_fake_database_backends.backends.mysql',
    }
}

Available backends

  • django_fake_database_backends.backends.mysql

  • django_fake_database_backends.backends.sqlite3

  • django_fake_database_backends.backends.postgresql

More will come in the future.

Tests

The test suite uses tox and can be invoked using.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_fake_database_backends-0.1.1-py2.py3-none-any.whl (30.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_fake_database_backends-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_fake_database_backends-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 360a30a9548a9c24ba11379ecfd208b9ccb7a6ae98ccf2e945094557ac34d1fe
MD5 ecb92290e6f5e4869743184cfebd2049
BLAKE2b-256 f65fe3aecd223d3c9d8bd003193fdb32ce668df7b927be0ea3527c026d144c2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page