Metadata-Version: 2.1
Name: tableplus-db-urls
Version: 0.1.2
Summary: Generate TablePlus DB URLs from CookieCutter Django to make setting up connections easier.
Author-email: Tim Santor <tsantor@xstudios.com>
Project-URL: Repository, https://github.com/tsantor/tableplus-db-urls.git
Project-URL: Issues, https://github.com/tsantor/tableplus-db-urls/issues
Project-URL: Changelog, https://github.com/tsantor/tableplus-db-urls/blob/master/HISTORY.md
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.md
Requires-Dist: click
Requires-Dist: python-dotenv
Provides-Extra: dev

# TablePlus DB URLS

![Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen)

## Overview

Generate TablePlus DB URLs from CookieCutter Django to make setting up connections easier. Yea, I'm that lazy!

It assumes you are using [django-cookiecutter](https://github.com/cookiecutter/cookiecutter-django) with the `use_docker=y` option and that you are connecting to your Postgres DB over SSH using your private key (`~/.ssh/config`) in production.

It is looking for your `.postgres` env files that are generated by cookiecutter at

## Installation

```bash
$ python3 -m pip install tableplus-db-urls
```

## Usage

```bash
# --path should be your django project root
$ tableplus generate --path="." --ssh-user="user" --ssh-host="xxx.xxx.x.x"
```

> **NOTE:** TablePlus DB URLs assumes you use an SSH Key to login and not password.

Then in TablePlus, on the main screen, right-click and choose `New` > `Connection from URL...` and use the URLs provided by the output.

## Development

```bash
make env
make pip_install
make pip_install_editable
```

## Testing

```bash
make pytest
make coverage
make open_coverage
```

## Issues

If you experience any issues, please create an [issue](https://github.com/tsantor/tableplus-db-urls/issues) on Github.

# History

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## 0.1.2 (2024-05-15)

- Added `name` argument to name the connection.

## 0.1.1 (2024-04-23)

- Moved from `argparse` to `click`
- Moved from `python-environ` to `python-dotenv`
- Fixed bug with production URL

## 0.1.0 (2024-04-09)

- First release
