Skip to main content
Glama
FreePeak

Multi Database MCP Server

tx.go760 B
package dbtools import ( "database/sql" "sync" ) // Map to store active transactions var transactions = make(map[string]*sql.Tx) var transactionMutex sync.RWMutex // StoreTransaction stores a transaction in the global map func StoreTransaction(id string, tx *sql.Tx) { transactionMutex.Lock() defer transactionMutex.Unlock() transactions[id] = tx } // GetTransaction retrieves a transaction from the global map func GetTransaction(id string) (*sql.Tx, bool) { transactionMutex.RLock() defer transactionMutex.RUnlock() tx, ok := transactions[id] return tx, ok } // RemoveTransaction removes a transaction from the global map func RemoveTransaction(id string) { transactionMutex.Lock() defer transactionMutex.Unlock() delete(transactions, id) }

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/FreePeak/db-mcp-server'

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