用python写数据库sqlite_sqlite-web - 用Python编写的基于web的SQLite数据库浏览器

sqlite-web是一个基于Python的SQLite数据库浏览器,支持现有数据库或新建数据库,提供表格添加删除、列操作、索引管理、数据导出为JSON或CSV、导入JSON或CSV文件等功能。此外,还具备查询执行、读取数据、命令行选项和Docker使用方式。
摘要由CSDN通过智能技术生成

sqlite-web is a web-based SQLite database browser written in Python.

Project dependencies:

Installation

$ pip install sqlite-web

Usage

$ sqlite_web /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:

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.

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

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:

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:

Command-line options

The syntax for invoking sqlite-web is:

$ sqlite_web [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 sqlite-web starts.

-P, --password: prompt for password to access sqlite-web. 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. "/sqlite-web".

Using docker

A Dockerfile is provided with sqlite-web. To use:

$ cd docker/ # Change dirs to the dir containing Dockerfile

$ docker build -t coleifer/sqlite-web .

$ docker run -it --rm \

-p 8080:8080 \

-v /path/to/your-data:/data \

-e SQLITE_DATABASE=db_filename.db \

coleifer/sqlite-web

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值