Testing
Connection test
Section titled “Connection test”cd testgo run test-connection.goThis test verifies connectivity, authentication, and TLS encryption.
Security tests
Section titled “Security tests”go test -v -run TestSQLInjectionVulnerability ./test/security/...The security suite covers 6 SQL injection attack vectors.
Claude Code CLI
Section titled “Claude Code CLI”Use the CLI tool to test operations:
# Connection testgo run claude-code/db-connector.go test
# Database informationgo run claude-code/db-connector.go info
# List tablesgo run claude-code/db-connector.go tables
# Describe a tablego run claude-code/db-connector.go describe users
# Execute a querygo run claude-code/db-connector.go query "SELECT @@VERSION"Manual tests
Section titled “Manual tests”Verify read-only mode
Section titled “Verify read-only mode”With MSSQL_READ_ONLY=true, confirm that write queries are blocked:
go run claude-code/db-connector.go query "INSERT INTO some_table VALUES (1)"# Should return: Query blocked: read-only modeVerify whitelist
Section titled “Verify whitelist”With MSSQL_WHITELIST_TABLES=temp_ai, confirm that only that table accepts writes:
go run claude-code/db-connector.go query "INSERT INTO temp_ai (data) VALUES ('test')"# Should execute successfullyTest environment
Section titled “Test environment”Always use a separate database for testing. Never run tests against production.