{"id":48837250,"url":"https://github.com/debba/tabularis-db2-plugin","last_synced_at":"2026-04-15T00:02:47.782Z","repository":{"id":351414205,"uuid":"1210865217","full_name":"debba/tabularis-db2-plugin","owner":"debba","description":"IBM Db2 plugin for Tabularis with ODBC connectivity, schema browsing, query execution, CRUD, and DDL support","archived":false,"fork":false,"pushed_at":"2026-04-14T22:24:20.000Z","size":56,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-14T23:35:47.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/debba/tabularis","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debba.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T20:46:48.000Z","updated_at":"2026-04-14T22:24:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/debba/tabularis-db2-plugin","commit_stats":null,"previous_names":["debba/tabularis-db2-plugin"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/debba/tabularis-db2-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Ftabularis-db2-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Ftabularis-db2-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Ftabularis-db2-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Ftabularis-db2-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debba","download_url":"https://codeload.github.com/debba/tabularis-db2-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debba%2Ftabularis-db2-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31820369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-15T00:02:47.204Z","updated_at":"2026-04-15T00:02:47.774Z","avatar_url":"https://github.com/debba.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/debba/tabularis/main/public/logo-sm.png\" width=\"120\" height=\"120\" /\u003e\n\u003c/div\u003e\n\n# tabularis-db2-plugin\n\u003cp align=\"center\"\u003e\n\n![](https://img.shields.io/badge/status-WIP-red?style=flat)\n[![Discord](https://img.shields.io/discord/1470772941296894128?color=5865F2\u0026logo=discord\u0026logoColor=white)](https://discord.gg/YrZPHAwMSG)\n\n\u003c/p\u003e\n\n\u003e **Work in progress** — this plugin is under active development. See the [verification checklist](#verification-checklist) below for the current status.\n\nAn [IBM Db2](https://www.ibm.com/products/db2) plugin for [Tabularis](https://github.com/debba/tabularis), the lightweight database management tool.\n\nThis plugin enables Tabularis to connect to Db2 through **ODBC**, browse schemas and objects, run SQL queries, perform inline CRUD operations, and generate DDL through the Tabularis JSON-RPC plugin interface.\n\n**Discord** - [Join our discord server](https://discord.gg/YrZPHAwMSG) and chat with the maintainers.\n\n## Table of Contents\n\n- [Verification Checklist](#verification-checklist)\n- [Features](#features)\n- [Supported Db2 Data Types](#supported-db2-data-types)\n- [Requirements](#requirements)\n- [Installation](#installation)\n  - [Automatic (via Tabularis)](#automatic-via-tabularis)\n  - [Manual Installation](#manual-installation)\n- [How It Works](#how-it-works)\n- [Supported Operations](#supported-operations)\n- [Building from Source](#building-from-source)\n- [Development](#development)\n  - [Docker-based Db2 Environment](#docker-based-db2-environment)\n- [Known Limitations](#known-limitations)\n- [License](#license)\n\n## Verification Checklist\n\n| Feature | Status | Issue |\n|---|---|---|\n| Read table data | Verified | — |\n| Schema \u0026 object browsing | Not yet verified | [#1](https://github.com/debba/tabularis-db2-plugin/issues/1) |\n| Query execution | Not yet verified | [#2](https://github.com/debba/tabularis-db2-plugin/issues/2) |\n| Insert record | Not yet verified | [#3](https://github.com/debba/tabularis-db2-plugin/issues/3) |\n| Update record | Not yet verified | [#4](https://github.com/debba/tabularis-db2-plugin/issues/4) |\n| Delete record | Not yet verified | [#5](https://github.com/debba/tabularis-db2-plugin/issues/5) |\n| DDL generation | Not yet verified | [#6](https://github.com/debba/tabularis-db2-plugin/issues/6) |\n| View support | Not yet verified | [#7](https://github.com/debba/tabularis-db2-plugin/issues/7) |\n| Index management | Not yet verified | [#8](https://github.com/debba/tabularis-db2-plugin/issues/8) |\n| Foreign key management | Not yet verified | [#9](https://github.com/debba/tabularis-db2-plugin/issues/9) |\n| Routine support | Not yet verified | [#10](https://github.com/debba/tabularis-db2-plugin/issues/10) |\n| Explain query | Verified | [#11](https://github.com/debba/tabularis-db2-plugin/issues/11) |\n\n## Features\n\n- **Connection via ODBC** — Connect to Db2 using host, port, database, credentials, and optional plugin settings.\n- **Schema \u0026 Object Browsing** — List schemas, tables, columns, views, indexes, foreign keys, and routines.\n- **Query Execution** — Run arbitrary SQL queries with pagination support.\n- **Inline Editing** — Insert, update, and delete rows directly from the Tabularis grid.\n- **DDL Generation** — Generate `CREATE TABLE`, `ALTER TABLE`, `CREATE INDEX`, and `ADD FOREIGN KEY` SQL.\n- **Modern Plugin Manifest** — Uses current Tabularis plugin manifest fields including `settings`, modern capabilities, color/icon metadata, and connection string support.\n- **Modular Rust Codebase** — RPC, client creation, metadata handlers, CRUD, DDL, and utilities are split into dedicated modules with unit tests.\n\n## Supported Db2 Data Types\n\n| Category | Types |\n|---|---|\n| **Numeric** | SMALLINT, INTEGER, BIGINT, DECIMAL, DECFLOAT, REAL, DOUBLE |\n| **String** | CHAR, VARCHAR, CLOB, GRAPHIC, VARGRAPHIC, DBCLOB |\n| **Date/Time** | DATE, TIME, TIMESTAMP |\n| **Binary** | BLOB, BINARY, VARBINARY |\n| **Other** | XML, JSON |\n\n## Requirements\n\nThis plugin uses the [`odbc-api`](https://crates.io/crates/odbc-api) crate and requires a working Db2 ODBC driver on the host system.\n\nTypical requirement:\n\n- IBM Db2 ODBC driver installed\n- ODBC driver manager available on the OS\n- network connectivity to the Db2 server\n\nYou can configure the driver name from Tabularis through the plugin settings.\n\n## Installation\n\n### Automatic (via Tabularis)\n\nOnce the plugin is packaged and published in a registry-compatible format, it can be installed through the Tabularis plugin UI.\n\n### Manual Installation\n\n1. Build the plugin in release mode:\n\n```bash\ncargo build --release\n```\n\n2. Copy `tabularis-db2-plugin` (or `tabularis-db2-plugin.exe` on Windows) and `manifest.json` into the Tabularis plugins directory:\n\n| OS | Plugins Directory |\n|---|---|\n| **Linux** | `~/.local/share/tabularis/plugins/db2/` |\n| **macOS** | `~/Library/Application Support/com.debba.tabularis/plugins/db2/` |\n| **Windows** | `%APPDATA%\\com.debba.tabularis\\plugins\\db2\\` |\n\n3. Restart Tabularis.\n\n### Local Sync Helper\n\nA convenience script is provided to build and copy the plugin into the local Tabularis plugins directory:\n\n```bash\n./sync.sh\n```\n\n## How It Works\n\nThe plugin is a standalone Rust binary that communicates with Tabularis through **JSON-RPC 2.0 over stdio**:\n\n1. Tabularis spawns the plugin process.\n2. Requests are sent as newline-delimited JSON-RPC messages to the plugin `stdin`.\n3. The plugin opens Db2 ODBC connections on demand and writes JSON-RPC responses to `stdout`.\n\nThe code is intentionally split by responsibility:\n\n- `src/main.rs` — request loop and dispatch\n- `src/client.rs` — ODBC connection string construction and query execution\n- `src/handlers/metadata.rs` — schemas, tables, columns, views, indexes, FKs, routines\n- `src/handlers/query.rs` — connection test, query execution, explain plan\n- `src/handlers/crud.rs` — insert, update, delete\n- `src/handlers/ddl.rs` — SQL generation helpers\n- `src/utils/` — pure helpers with unit tests\n\n## Supported Operations\n\n| Method | Description |\n|---|---|\n| `initialize` | Loads plugin settings sent by Tabularis |\n| `test_connection` / `ping` | Verifies Db2 connectivity |\n| `get_databases` | Returns the current server/database identity |\n| `get_schemas` | Lists Db2 schemas |\n| `get_tables` | Lists base tables in the selected schema |\n| `get_columns` | Returns column metadata for a table or view |\n| `get_foreign_keys` | Lists foreign keys for a table |\n| `get_indexes` | Lists indexes for a table |\n| `get_views` | Lists views in the selected schema |\n| `get_view_definition` | Returns the stored view definition |\n| `get_view_columns` | Returns column metadata for a view |\n| `get_routines` | Lists routines in the selected schema |\n| `get_routine_parameters` | Returns routine parameters |\n| `get_routine_definition` | Returns the stored routine body when available |\n| `execute_query` | Runs SQL with pagination for `SELECT` / `WITH` queries |\n| `explain_query` | Returns the DB2 execution plan tree by reading explain tables |\n| `insert_record` | Inserts a row |\n| `update_record` | Updates a row by primary key column |\n| `delete_record` | Deletes a row by primary key column |\n| `get_schema_snapshot` | Returns all tables with columns and foreign keys |\n| `get_all_columns_batch` | Returns all column metadata for a schema |\n| `get_all_foreign_keys_batch` | Returns all FK metadata for a schema |\n| `get_create_table_sql` | Generates `CREATE TABLE` SQL |\n| `get_add_column_sql` | Generates `ALTER TABLE ... ADD COLUMN` SQL |\n| `get_alter_column_sql` | Generates `ALTER TABLE ... ALTER/RENAME COLUMN` SQL |\n| `get_create_index_sql` | Generates `CREATE INDEX` SQL |\n| `get_create_foreign_key_sql` | Generates FK DDL |\n| `drop_index` | Executes `DROP INDEX` |\n| `drop_foreign_key` | Executes `ALTER TABLE ... DROP FOREIGN KEY` |\n\n## Building from Source\n\n### Prerequisites\n\n- [Rust](https://www.rust-lang.org/tools/install) (edition 2021)\n- Db2 ODBC driver installed locally\n\n### Build\n\n```bash\ncargo build --release\n```\n\nThe binary will be available at:\n\n```bash\ntarget/release/tabularis-db2-plugin\n```\n\n## Development\n\n### Docker-based Db2 Environment\n\nA `docker-compose.yml` is provided to spin up a local IBM Db2 Community Edition instance for development and integration testing.\n\n#### Prerequisites\n\n- Docker (or Podman with the `docker` CLI alias)\n- IBM Data Server Driver for ODBC and CLI (`clidriver`) installed on the host and registered in `/etc/odbcinst.ini`\n\n**Installing the IBM clidriver on Linux:**\n\n```bash\ncurl -fSL https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz \\\n  -o /tmp/clidriver.tar.gz\nsudo mkdir -p /opt/ibm\nsudo tar xf /tmp/clidriver.tar.gz -C /opt/ibm\necho -e \"[Db2]\\nDescription = IBM Db2 ODBC Driver\\nDriver = /opt/ibm/clidriver/lib/libdb2o.so\" \\\n  | sudo tee /etc/odbcinst.ini\n```\n\n#### Start, seed, and manage the test database\n\nA helper script handles the full lifecycle:\n\n```bash\n# Start the container and seed TEST_SCHEMA with fixtures\n./scripts/setup-test-db.sh\n\n# Check container health and seed status\n./scripts/setup-test-db.sh status\n\n# Stop and remove the container (including volumes)\n./scripts/setup-test-db.sh teardown\n```\n\nThe first start can take a couple of minutes while Db2 initialises. The script waits up to 300 seconds and streams progress.\n\n#### Connection details\n\n| Parameter | Value |\n|---|---|\n| **Host** | `localhost` |\n| **Port** | `50000` |\n| **Database** | `TESTDB` |\n| **User** | `db2inst1` |\n| **Password** | `db2test123` |\n| **Schema** | `TEST_SCHEMA` |\n\n#### Run integration tests\n\nOnce the container is healthy:\n\n```bash\nDB2_TEST=1 cargo test --test integration -- --test-threads=1\n```\n\n\u003e Integration tests are gated behind the `DB2_TEST` environment variable so that `cargo test` alone only runs unit tests (no Db2 connection required).\n\n### Run Unit Tests\n\n```bash\ncargo test\n```\n\n### Smoke Test the Plugin Process\n\n```bash\ncargo run --bin test_plugin\n```\n\n### Manual JSON-RPC example\n\n```bash\necho '{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"settings\":{}},\"id\":1}' \\\n  | ./target/debug/tabularis-db2-plugin\n```\n\n### Tech Stack\n\n- **Language:** Rust (edition 2021)\n- **Database driver:** [`odbc-api`](https://crates.io/crates/odbc-api)\n- **Serialization:** serde + serde_json\n- **Protocol:** JSON-RPC 2.0 over stdio\n\n## Known Limitations\n\n- The plugin requires a working Db2 ODBC driver on the host system.\n- `explain_query` reads the DB2 explain tables (`SYSTOOLS.EXPLAIN_OPERATOR`, `EXPLAIN_STREAM`, `EXPLAIN_STATEMENT`) to build a plan tree; these tables must exist (see `CALL SYSPROC.SYSINSTALLOBJECTS`). Some cost/row metrics depend on the DB2 edition and optimizer statistics being up to date.\n- Catalog queries were designed using Db2 catalog conventions and DBeaver’s Db2 extension as a reference, but they should still be validated against the specific Db2 edition/version you target.\n- `get_databases` is intentionally conservative and currently returns the active server/database identity instead of enumerating every possible database on an instance.\n\n## License\n\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebba%2Ftabularis-db2-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebba%2Ftabularis-db2-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebba%2Ftabularis-db2-plugin/lists"}