semvec/pypi-packages huggingface dataset:
datasette-backup 0.1
Plugin adding backup options to Datasette
License: Apache License, Version 2.0

# datasette-backup

[![PyPI](https://img.shields.io/pypi/v/datasette-backup.svg)](https://pypi.org/project/datasette-backup/)
[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-backup?include_prereleases&label=changelog)](https://github.com/simonw/datasette-backup/releases)
[![Tests](https://github.com/simonw/datasette-backup/workflows/Test/badge.svg)](https://github.com/simonw/datasette-backup/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-backup/blob/main/LICENSE)

Plugin adding backup options to Datasette

## Installation

Install this plugin in the same environment as Datasette.

    $ datasette install datasette-backup

## Usage

Once installed, you can download a SQL backup of any of your databases from:

    /-/backup/dbname.sql

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

    cd datasette-backup
    python3 -mvenv venv
    source venv/bin/activate

Or if you are using `pipenv`:

    pipenv shell

Now install the dependencies and tests:

    pip install -e '.[test]'

To run the tests:

    pytest
sqlite-dump 0.1.1
An improved version of .iterdump() for sqlite3
License: Apache License, Version 2.0

# sqlite-dump

[![PyPI](https://img.shields.io/pypi/v/sqlite-dump.svg)](https://pypi.org/project/sqlite-dump/)
[![Changelog](https://img.shields.io/github/v/release/simonw/sqlite-dump?label=changelog)](https://github.com/simonw/sqlite-dump/releases)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/sqlite-dump/blob/master/LICENSE)

An improved version of `.iterdump()` for Python's `sqlite3`

## Background

Python's `sqlite3` standard library module provides a method for dumping the contents of a database out as lines of SQL that can be used to recreate the database:

```python
import sqlite3

conn = sqlite3.connect("mydb.db")
for line in conn.iterdump():
    print(line)
```

This mechanism is convenient but unfortunately does not support every SQLite feature. In particular it doesn't correctly dump databases that use SQLite's full-text search functionality from the [FTS module](https://www.sqlite.org/fts5.html). This library offers an improved alternative to the `.iterdump()` method.

## Installation

Install this plugin using `pip`:

    $ pip install sqlite-dump

## Usage

To loop through lines of SQL that can recreate a SQLite database file:

```python
import sqlite3
from sqlite_dump import iterdump

conn = sqlite3.connect(db_path)
for line in iterdump(conn):
    print(line)
```

## Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

    cd sqlite-dump
    python -mvenv venv
    source venv/bin/activate

Or if you are using `pipenv`:

    pipenv shell

Now install the dependencies and tests:

    pip install -e '.[test]'

To run the tests:

    pytest