Skip to content
/ tablite Public

🪶 An ai driven lightweight database GUI built on Tauri.

License

Notifications You must be signed in to change notification settings

tmg0/tablite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

26e5b8e Â· Apr 7, 2025
Mar 17, 2025
Jan 15, 2025
Dec 31, 2024
Apr 7, 2025
Apr 5, 2025
Feb 12, 2025
Apr 2, 2025
Dec 31, 2024
Feb 18, 2025
Apr 5, 2025
Apr 7, 2025
Mar 31, 2025
Apr 7, 2025
Apr 7, 2025
Apr 7, 2025
Jan 17, 2025

Repository files navigation

Tablite

🪶 An ai driven lightweight database GUI built on Tauri.

Features

  • Lightweight and cross-platform build
  • Natural language querying with multi-LLMs support
  • Modern and easy-to-use interface
  • Local data storage for secure (except for sending schema to your LLM provider)

Supported databases:

  • SQLite
  • MySQL

Supported LLMs:

  • Gemini 2.0 Flash
  • Gemini 1.5 Pro
  • Gemini 1.5 Flash
  • DeepSeek V3
  • DeepSeek R1
  • OpenRouter (Tools supported)

Screenshot

Installation

You can download Windows and Mac desktop app here

For MacOS user with M1 or later, you need to execute the following command in terminal to allow the application downloaded form the internet:

sudo xattr -r -d com.apple.quarantine /Applications/Tablite.app

Or use the x64 version in release page to bypass this issue.

Usage

Tables

  • Fuzzy search for table names
  • Dynamically filter tables with popover selectors
  • Double-click a cell to enter edit mode
  • Select rows for deletion
  • Disvard changes or preview the actual SQL before saving
  • Support re-editing SQL before saving

Queries

  • Fuzzy search for table names
  • Automatically generate an SQL query from the title as a prompt
  • ⌘ + s or click the Save button for saving
  • Run the query and display the time costs

Settings

  • Select ai assistant based model
  • Enter api keys for different providers

Developing

pnpm install && pnpm tauri dev

Comparisons

  • Tauri: Small bundle size and low memory usage, dependence by user os, may have rendering differences across different systems/platforms due to WebKit version.

  • Electron: Large bundle size and large mem usage, has high consistency in cross-platform application rendering.

Tauri Electron Gpui Swift
Performance mid low high high
Cross Platform yes yes yes no
Community high high low mid
Size small large mid mid
Development mid low high mid
App ChatWise DingTalk Zed Pages

Code Design

Design

WebView client application with official nuxt design (future.compatibilityVersion: 4), read Directory Structure.

High performance canvas based table component, powered by VisActor

Support cell update and undo actions, and used update ref struct like:

/**
 * Tracks changes made to table cell contents, where:
 * - The outer key is a stringified row identifier (e.g., JSON string of row ID)
 * - The inner key is the column/property name that was modified
 * - The value is an array containing the new content(s)
 *
 * @example
 * // Changes for row with ID "93uisjxquq", updating the "content" column from "hi" to "hi tablite"
 * { "{\"id\":\"93uisjxquq\"}": { "content": ["hi", "hi tablite"] } }
 */
const changes = ref({})

Usage:

<VisTable
  v-model:changes="changes"
  v-model:inserts="inserts"
  v-model:selected-row-keys="selectedRowKeys"
  editable
  :columns="columns"
  :records="data"
  :deletes="deletes"
  :primary-keys="primaryKeys"
/>

Reacitve vue hooks

Text to SQL AI Agent

Reactive Vercel AI SDK in vue port

Global agent creator, example here

createAgent usage:

const prompt = ref('')
const { model } = useAiProvider()

const { messages } = await createAgent(model.value!)
  .next(({ messages }: { messages: any[] }) => messages[0]!.content)
  .execute([{ role: 'user', content: prompt.value }])

Tauri service root directory

App instance entry, plugin register center (includes: sql-extra / log / store)

Custom tauri plugin sql implement.

Heavily inspired by tauri-plugin-sql and extends its capabilities by adding support for multiple database types.

sql-extra powered by sqlx and provide plugin commands below:

  • plugin:sql-extra|load: ({ db: string }) => Promise
  • plugin:sql-extra|execute: ({ db: string, query: string }) => Promise
  • plugin:sql-extra|select: <T extends any[]>({ db: string, query: string }) => Promise
  • plugin:sql-extra|close: ({ db: string }) => Promise

For different type of database, sql-extra use serde_json for json decoder

  • mysql

    • "CHAR" | "VARCHAR" | "TINYTEXT" | "TEXT" | "MEDIUMTEXT" | "LONGTEXT" | "ENUM" | "DATE" | "TIME" | "DATETIME" | "TIMESTAMP": string
    • "Float" | "DOUBLE" | "TINYINT" | "SMALLINT" | "INT" | "MEDIUMINT" | "BIGINT" | "TINYINT UNSIGNED" | "SMALLINT UNSIGNED" | "INT UNSIGNED" | "MEDIUMINT UNSIGNED" | "BIGINT UNSIGNED" | "YEAR" | "TINIYBLOB" | "MEDIUMBLOB" | "BLOB" | "LONGBLOB": number
    • "BOOLEAN": boolean
  • sqlite

    • "TEXT" | "DATE" | "TIME" | "DATETIME": string
    • "REAL" | "INTEGER" | "NUMERIC" | "BLOB": number
    • "BOOLEAN": boolean

Agents

Generate executable sql query with natural language.

  • Analysis relevant table names by model function calling
  • Provide table schema with row index
  • Generate prompt by preset templates
  • Generate SQL query
  • Format results and response with sse

Roadmap

Ranking here very subjective and based on personal pain points.

SQL Client

  • Support create table by GUI
  • Support create connection by a form instead of a connection string
  • Support edit or create columns / index by GUI
  • Support export table filter results to csv
  • Collect SQL execute histories
  • Better code auto completion

AI Assistant

  • Support table visualization dashboard generation
  • Support custom table context
  • Support inline assistant in code editor
  • Support MCP service

License

MIT License © 2024-PRESENT Tamago

About

🪶 An ai driven lightweight database GUI built on Tauri.

Resources

License

Stars

Watchers

Forks

Packages

No packages published