DbGate Serve Premium
DbGate Serve Premium is the commercial, web-based server component of the DbGate database administration tool, currently at version 7.1.9. It provides a cross-platform solution for managing a wide array of databases, including MySQL, PostgreSQL, SQL Server, Oracle, MongoDB, Redis, SQLite, CockroachDB, MariaDB, and ClickHouse, with premium support for Amazon Redshift and CosmosDB. This package is distinguished from the community `dbgate-serve` by offering additional commercial features, such as enhanced storage options via `STORAGE_SERVER` environment variables, enabling persistent server-side metadata and connection management. It maintains an active release cadence, frequently publishing updates and bug fixes. Key functionalities include schema comparison, a visual query designer, advanced chart visualizations, and robust batch export/import capabilities. Unlike its desktop application counterpart, `dbgate-serve-premium` runs as a standalone web server, accessible through a browser, facilitating remote database management and collaboration.
Common errors
-
Error: SQL error: UUID parsing issues
cause Specific formats of UUIDs were not correctly parsed when interacting with databases, leading to errors in operations involving UUID columns.fixThis issue was fixed in DbGate Serve Premium v7.1.9. Upgrade to version 7.1.9 or later to resolve UUID parsing problems (#1434, #1431). -
TypeError: Cannot read properties of undefined (reading 'writeQueryHistory')
cause An internal error prevented the `writeQueryHistory` function from executing correctly, often due to an undefined context or missing dependency within the server.fixThis specific bug was resolved in DbGate Serve Premium v7.1.9. Upgrade to this version or newer to fix the `writeQueryHistory` function error (#1432). -
Error: Export failure when password mode is enabled
cause Export operations failed to complete successfully when the connected database required a password, indicating an issue with credential handling during the export process.fixThis problem was fixed in DbGate Serve Premium v7.1.7. Upgrade to version 7.1.7 or later to resolve export failures when password mode is enabled (#1409). -
ORA-24960: the Oracle environment variable NLS_LANG is not set
cause When using Oracle Instant Client (thick mode), the `NLS_LANG` environment variable is required by Oracle to correctly handle character sets, and its absence causes connection errors.fixBefore running DbGate, ensure the `NLS_LANG` environment variable is set in your system environment (e.g., `export NLS_LANG=AMERICAN_AMERICA.AL32UTF8` on Linux/macOS, or via System Properties on Windows). Consult Oracle Instant Client documentation for the appropriate value for your locale.
Warnings
- gotcha DbGate Serve Premium is primarily a CLI application and is not designed for direct programmatic import into JavaScript/TypeScript projects. Its functionality is accessed by running the `dbgate-serve-premium` command from the terminal. For programmatic interaction with DbGate's core features (e.g., querying databases, managing connections), use the `dbgate-api` package instead.
- breaking As of v7.1.9, the public DbGate cloud infrastructure and endpoints were migrated. This change could potentially affect existing integrations or direct cloud connectivity if hardcoded endpoints were used, though it aims to improve availability and resilience.
- gotcha Oracle database connections using 'thick mode' (Oracle Instant Client) require manual installation and specific environment variable configuration (e.g., `ORACLE_INSTANT_CLIENT`). Without it, certain Oracle features or older Oracle server versions may not be supported (thin mode limitations apply).
- gotcha Configuration of DbGate Serve Premium is primarily managed through environment variables, typically loaded from `.env` files in the working directory. It is crucial to handle sensitive information (e.g., `STORAGE_PASSWORD`) securely and ensure `.env` files are not committed to version control.
- breaking Version 7.1.9 introduced stricter validation for function and file names, along with fixes for security issues. This means previously accepted, potentially unsafe names or patterns in configurations might now be rejected, leading to unexpected behavior or errors.
Install
-
npm install dbgate-serve-premium -
yarn add dbgate-serve-premium -
pnpm add dbgate-serve-premium
Imports
- DbGateServePremiumCLI
/* This package is primarily a CLI tool. Its functionality is accessed via the 'dbgate-serve-premium' command, not through direct programmatic imports. */
- query
const query = require('dbgate-api').query;import { query } from 'dbgate-api'; - connect
const connect = require('dbgate-api').connect;import { connect } from 'dbgate-api';
Quickstart
npm install -g dbgate-serve-premium # Create a .env file in your working directory for configuration # Example .env file for a MySQL connection (premium feature) # STORAGE_SERVER=localhost # STORAGE_USER=root # STORAGE_PASSWORD=mypassword # STORAGE_DATABASE=dbname # STORAGE_ENGINE=mysql@dbgate-plugin-mysql # (Note: STORAGE_xxx variables are specific to the Premium edition and store DbGate's metadata) # Start the DbGate Premium server dbgate-serve-premium # Then open http://localhost:3000 in your browser to access the web interface.