Skip to main content
Glama

Postgres MCP Server

database-identifier.test.ts994 B
import { describe, test, expect } from "bun:test"; import { DatabaseConnection } from "../src/database"; import { ConsoleLogger } from "../src/logger"; import type { ServerConfig } from "../src/types"; const cfg: ServerConfig = { databaseUrl: "postgresql://localhost:5432/test", allowWriteOps: false, maxConnections: 1, connectionTimeout: 1, statementTimeout: 0, prepareStatements: true, debug: false, }; describe("DatabaseConnection.quoteIdentifier", () => { test("escapes double quotes in identifier", () => { const db = new DatabaseConnection(cfg, new ConsoleLogger(false)); // @ts-ignore private access for test expect(db["quoteIdentifier"]('my"table')).toBe('"my""table"'); }); test("throws on null byte in identifier", () => { const db = new DatabaseConnection(cfg, new ConsoleLogger(false)); // @ts-ignore private access for test expect(() => db["quoteIdentifier"]("bad\0name")).toThrow("Identifier cannot contain null bytes"); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ericzakariasson/pg-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server