Skip to main content
Glama

Notion MCP Server V2

by ankitmalik84
sql_manager.pyโ€ข1.39 kB
import sqlite3 class SQLManager: """ A manager for handling SQLite database connections and executing queries. """ def __init__(self, db_path: str): """ Initializes the SQLManager instance. Args: db_path (str): Path to the SQLite database file. """ self.db_path = db_path def execute_query(self, query: str, params: tuple = (), fetch_one: bool = False, fetch_all: bool = False) -> list: """ Executes an SQL query with optional parameters and fetch options. Args: query (str): The SQL query to execute. params (tuple, optional): Parameters to pass to the SQL query. Defaults to (). fetch_one (bool, optional): Whether to fetch a single row. Defaults to False. fetch_all (bool, optional): Whether to fetch all rows. Defaults to False. Returns: Optional[list[tuple[Any, ...]]]: - A single row (if `fetch_one` is True). - All rows (if `fetch_all` is True). - None if no data is fetched. """ conn = sqlite3.connect(self.db_path) cursor = conn.cursor() cursor.execute(query, params) result = cursor.fetchone() if fetch_one else cursor.fetchall() if fetch_all else None conn.commit() conn.close() return result

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/ankitmalik84/Agentic_Longterm_Memory'

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