sqliting 0.1.0
An awesome and also useful sqlite high level api tools for python developer, enjoy~
License: MIT
Requires Python: >=3.6.0

# sqliting
An awesome and also useful sqlite high level api tools for python developer,
And `sqliting` is also a web-based SQLite database browser, enjoy~

![](http://media.charlesleifer.com/blog/photos/sqlite-web.png)



### Installation

```sh
$ pip install sqliting
```

### Usage

```sh
$ sqliting /path/to/database.db
```

### Features


* Works with your existing SQLite databases, or can be used to create new databases.
* Add or drop:
  * Tables
  * Columns (yes, you can drop and rename columns!)
  * Indexes
* Export data as JSON or CSV.
* Import JSON or CSV files.
* Browse table data.

### Screenshots

The index page shows some basic information about the database, including the number of tables and indexes, as well as its size on disk:

![](http://media.charlesleifer.com/blog/photos/s1415479324.32.png)

The `structure` tab displays information about the structure of the table, including columns, indexes, and foreign keys (if any exist). From this page you can also create, rename or drop columns and indexes.

![](http://media.charlesleifer.com/blog/photos/s1415479418.23.png)

The `content` tab displays all the table data. Links in the table header can be used to sort the data:

![](http://media.charlesleifer.com/blog/photos/s1415479502.61.png)

The `query` tab allows you to execute arbitrary SQL queries on a table. The query results are displayed in a table and can be exported to either JSON or CSV:

![](http://media.charlesleifer.com/blog/photos/s1415487149.3.png)

The `import` tab supports importing CSV and JSON files into a table. There is an option to automatically create columns for any unrecognized keys in the import file:

![](http://media.charlesleifer.com/blog/photos/s1415479625.44.png)

### Command-line options

The syntax for invoking sqliting is:

```console

$ sqliting [options] /path/to/database-file.db
```

The following options are available:

* ``-p``, ``--port``: default is 8080
* ``-H``, ``--host``: default is 127.0.0.1
* ``-d``, ``--debug``: default is false
* ``-x``, ``--no-browser``: do not open a web-browser when sqliting starts.
* ``-P``, ``--password``: prompt for password to access sqliting.
  Alternatively, the password can be stored in the "SQLITE_WEB_PASSWORD"
  environment variable, in which case the application will not prompt for a
  password, but will use the value from the environment.
* ``-r``, ``--read-only``: open database in read-only mode.
* ``-u``, ``--url-prefix``: URL prefix for application, e.g. "/sqliting".
* ``-c``, ``--cert`` and ``-k``, ``--key`` - specify SSL cert and private key.
* ``-a``, ``--ad-hoc`` - run using an ad-hoc SSL context.

# SQLite3 to MySQL
A simple Python tool to transfer data from SQLite 3 to MySQL
### How to run

```bash
sqlite2mysql --help
```

### Usage
```
Usage: sqlite2mysql [OPTIONS]

  Transfer SQLite to MySQL using the provided CLI options.

Options:
  -f, --sqlite-file PATH       SQLite3 database file  [required]
  -t, --sqlite-tables TEXT     Transfer only these specific tables (space
                               separated table names). Implies --without-
                               foreign-keys which inhibits the transfer of
                               foreign keys.

  -X, --without-foreign-keys   Do not transfer foreign keys.
  -d, --mysql-database TEXT    MySQL database name  [required]
  -u, --mysql-user TEXT        MySQL user  [required]
  -p, --prompt-mysql-password  Prompt for MySQL password
  --mysql-password TEXT        MySQL password
  -h, --mysql-host TEXT        MySQL host. Defaults to localhost.
  -P, --mysql-port INTEGER     MySQL port. Defaults to 3306.
  -S, --skip-ssl               Disable MySQL connection encryption.
  --mysql-integer-type TEXT    MySQL default integer field type. Defaults to
                               INT(11).

  --mysql-string-type TEXT     MySQL default string field type. Defaults to
                               VARCHAR(255).

  -T, --use-fulltext           Use FULLTEXT indexes on TEXT columns. Will
                               throw an error if your MySQL version does not
                               support InnoDB FULLTEXT indexes!

  --with-rowid                 Transfer rowid columns.
  -c, --chunk INTEGER          Chunk reading/writing SQL records
  -l, --log-file PATH          Log file
  -q, --quiet                  Quiet. Display only errors.
  --version                    Show the version and exit.
  --help                       Show this message and exit.
```

[Special thanks]
- [sqlite_web](https://github.com/coleifer/sqlite-web)
- [sqlite3-to-mysql](https://github.com/techouse/sqlite3-to-mysql)