数据库其它

关注公众号 jb51net

关闭
首页 > 数据库 > 数据库其它 > 数据库工具实战

数据库工具LazySQL、sql-tap、Tabularis、rsql、DbPaw实战教程

作者:johnny233

数据库设计是系统开发的基石,直接影响数据一致性、查询效率与维护成本,这篇文章主要介绍了数据库工具LazySQL、sql-tap、Tabularis、rsql、DbPaw实战的相关资料,需要的朋友可以参考下

LazySQL

官网,开源(GitHub,3.7K Star,163 Fork)跨平台的终端用户界面(TUI)SQL客户端。核心理念是:将数据库管理的强大功能,全部封装在终端环境里,无需离开键盘,就能完成所有操作。

核心功能

  1. 全键盘操作,Vim键位原生支持:从导航、编辑到执行命令,全程键盘流操作。如果你是Vim用户,上手即巅峰,毫无学习成本。
  2. 多数据库支持:一站式管理MySQL、PG、SQLite、SQL Server等主流数据库,连接配置文件化管理,一键切换。
  3. 强大的内置编辑器:直接在TUI里编写、格式化、高亮显示SQL语句,支持多语句执行和历史记录查询。
  4. 直观的数据表管理:不仅限于查询,可在终端里直接以表格形式浏览数据,并进行增、删、改操作,所见即所得。
  5. 灵活的连接方式:除标准连接,还支持通过SSH隧道、自定义命令等方式连接数据库,适应各种复杂的网络环境。
  6. 极简部署:提供多种安装方式,从一行Homebrew命令到直接下载二进制文件,开箱即用。

实战

GitHub Release页面下载安装包:

brew install lazysql
go install github.com/dolthub/lazysql@latest

sql-tap

基于Go开发的开源(GitHub,1.4K Star,43 Fork)实时SQL流量监控工具,无需修改代码即可使用。它作为代理部署在应用与数据库之间,通过解析数据库wire协议捕获所有查询,提供TUI和Web两种使用方式,支持PG、MySQL和TiDB数据库。

Tabularis

官网,基于Tauri+Rust+React架构,开源(GitHub,940 Star,63 Fork)跨平台、轻量级、现代化数据库管理工具。官方文档

功能特性

rsql

基于Rust语言、开源(GitHub,422 Star,15 Fork)跨平台、功能丰富的SQL命令行客户端(CLI),可为多种关系型数据库、本地文件、云数据服务提供统一的SQL查询接口。官方文档

功能特性

实战

支持多种安装方式

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/theseus-rs/rsql/releases/latest/download/rsql_cli-installer.sh | sh

使用

rsql --help
.bail on|off			Stop after an error occurs
.catalogs				List the catalogs in the database
.changes on|off			Show number of rows changed
.clear					Clear the screen
.color on|off			Enable or disable color output
.completions on|off		Enable or disable smarter completions
.describe [table]		Describe a table in the schema
.drivers				Display available database drivers
.echo on|prompt|off		Enable or disable echoing commands
.exit [code]			Exit the application
.footer on|off			Enable or disable result footer
.foreign [table]		Display the foreign keys
.format [format]		Set the output format for the results
.header on|off			Enable or disable result header
.help					Show this help message
.history on|off			Show the command history
.indexes [table]		Display the indexes
.limit [limit]			Set the maximum number of results to return
.locale [locale]		Set the display locale
.output clipboard|<file>	Output contents to the system clipboard, <file> or the console
.primary [table]		Display the primary keys
.print [string]			Print the specified string
.quit					Quit the application
.read [file]			Read a SQL file and execute it
.rows on|off			Show number of rows returned
.schemas				List the schemas in the catalog
.sleep [seconds]		Sleep for a specified number of seconds
.system command [args]	Run command in a system shell
.tables					List the tables in the schema
.tee clipboard|<file>	Output contents to the system clipboard or a <file>, and the console
.timer on|off			Enable or disable query execution timer
# 连接数据库
rsql --url "postgresql://user:pass@localhost/mydb"
# 查询CSV文件
rsql --url "csv://data.csv"
# 使用DuckDB内存数据库
rsql --url "duckdb://"
# 查询SQLite文件
rsql --url "sqlite://database.db" -- "SELECT * FROM users LIMIT 10"
# 查询Excel文件
rsql --url "excel://report.xlsx" -- "SELECT * FROM table WHERE amount > 1000"
# 查询Parquet文件
rsql --url "parquet://data.parquet" -- "SELECT column1, COUNT(*) FROM table GROUP BY column1"
# CSV转化为JSON文件
rsql --url "csv://input.csv" --format json -- "SELECT * FROM input"
# 查询压缩文件
rsql --url "csv://data.csv.gz" -- "SELECT column1, column2 FROM data"
# 组合查询多种格式
rsql --url "duckdb://" -- "
	SELECT * FROM read_csv_auto('file1.csv') 
	UNION ALL 
	SELECT * FROM read_parquet('file2.parquet')
"

DbPaw

官网,基于现代化技术栈构建、开源(GitHub,80 Star,9 Fork)跨平台的数据库开发工具,支持可选的AI助手。基于Rust+TypeScript+Tauri框架构建。

功能特性

总结

到此这篇关于数据库工具LazySQL、sql-tap、Tabularis、rsql、DbPaw的文章就介绍到这了,更多相关数据库工具实战内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

您可能感兴趣的文章:
阅读全文