Fake django database backends to generate sql without a real database
Project description
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
Built Distribution
File details
Details for the file django_fake_database_backends-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_fake_database_backends-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb49280a3535d6f0ae87bb2f42b79509976e1da125135796b92c8cfc0f1fad0f |
|
MD5 | 6a2d00a88ce1adabb00b53d367efc082 |
|
BLAKE2b-256 | c3b3c39ae51a091766362843f367b2e6bbc3e84ccb4a13e1186a8094951f5f27 |