Skip to main content
Glama
apolosan

Design Patterns MCP Server

by apolosan
004_add_code_examples.sql1.4 kB
-- Migration: Add Code Examples Support -- Created: 2025-01-11T12:00:00Z -- Description: Adds optional code examples field to patterns table -- UP -- Add examples column to patterns table (JSON format for multiple language examples) -- ALTER TABLE patterns ADD COLUMN examples TEXT; -- Column already exists in updated schema -- Create index for patterns with examples CREATE INDEX IF NOT EXISTS idx_patterns_has_examples ON patterns(id) WHERE examples IS NOT NULL; -- Create a new table for structured code examples (normalized approach) CREATE TABLE IF NOT EXISTS pattern_code_examples ( id TEXT PRIMARY KEY, pattern_id TEXT NOT NULL, language TEXT NOT NULL, description TEXT, code TEXT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (pattern_id) REFERENCES patterns(id) ON DELETE CASCADE, UNIQUE(pattern_id, language) ); -- Create indexes for code examples CREATE INDEX IF NOT EXISTS idx_pattern_code_examples_pattern_id ON pattern_code_examples(pattern_id); CREATE INDEX IF NOT EXISTS idx_pattern_code_examples_language ON pattern_code_examples(language); -- DOWN DROP INDEX IF EXISTS idx_patterns_has_examples; DROP TABLE IF EXISTS pattern_code_examples; -- Note: Cannot easily drop column in SQLite without recreating table -- For rollback, would need to recreate patterns table without examples column

Latest Blog Posts

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/apolosan/design_patterns_mcp'

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