Skip to content

Add multi-database adapter support (MySQL, PostgreSQL, SQLite) + update README and screenshots#2

Merged
nik2208 merged 3 commits intomainfrom
copilot/evaluate-library-extraction-for-db
Feb 25, 2026
Merged

Add multi-database adapter support (MySQL, PostgreSQL, SQLite) + update README and screenshots#2
nik2208 merged 3 commits intomainfrom
copilot/evaluate-library-extraction-for-db

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 24, 2026

Extends the library beyond SQLite to support MySQL/MariaDB and PostgreSQL via a pluggable adapter layer. Schema introspection is automatic (via information_schema / PRAGMA) — no manual table mapping required. All existing SQLite APIs are preserved unchanged.

Adapter architecture

  • IDatabaseAdapter — common interface; defines quoteIdentifier() for dialect-aware quoting plus all CRUD/introspection operations
  • SqliteAdapter — thin wrapper around the existing databaseFunctions module; zero behaviour change
  • MysqlAdaptermysql2/promise pool; reflects via information_schema.TABLES/COLUMNS/KEY_COLUMN_USAGE
  • PostgresAdapterpg Pool; reflects via information_schema.tables/columns/table_constraints
  • mysql2 and pg added as optionalDependencies

New entry point

// MySQL / MariaDB
import mysql from "mysql2/promise";
import { MysqlAdapter, SqliteGuiNodeWithAdapter } from "sqlite-gui-node";
SqliteGuiNodeWithAdapter(new MysqlAdapter(mysql.createPool({ host, user, password, database })), 8080);

// PostgreSQL
import { Pool } from "pg";
import { PostgresAdapter, SqliteGuiNodeWithAdapter } from "sqlite-gui-node";
SqliteGuiNodeWithAdapter(new PostgresAdapter(new Pool({ host, user, database })), 8080);

Legacy SqliteGuiNode / SqliteGuiNodeMiddleware / createSqliteGuiApp are kept and internally wrap Database in SqliteAdapter.

SQL generator refactor

  • generateInsertSQL now accepts IDatabaseAdapter instead of raw db: any
  • generateUpdateSQL / generateCreateTableSQL accept an optional quoter function (default: identity — no quoting), which also fixes 2 pre-existing test failures caused by hardcoded backtick quoting in expected strings

README + screenshots

Updated to reflect the redesigned UI and multi-db support — new sections for MySQL/PostgreSQL usage, updated Arguments table, and 4 fresh screenshots of the current dark-sidebar layout.

Screenshots

Table view
Create table
Custom query
Edit row


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: nik2208 <28157038+nik2208@users.noreply.github.com>
Copilot AI changed the title [WIP] Evaluate feasibility of extracting library for multiple databases Add multi-database adapter support (MySQL, PostgreSQL, SQLite) Feb 24, 2026
…r docs

Co-authored-by: nik2208 <28157038+nik2208@users.noreply.github.com>
Copilot AI changed the title Add multi-database adapter support (MySQL, PostgreSQL, SQLite) Add multi-database adapter support (MySQL, PostgreSQL, SQLite) + update README and screenshots Feb 25, 2026
@nik2208 nik2208 marked this pull request as ready for review February 25, 2026 08:58
@nik2208 nik2208 merged commit 2ad3807 into main Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants