Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bytebase/dbhub
/ functions
Functions
717 in github.com/bytebase/dbhub
⨍
Functions
717
◇
Types & classes
137
↓ 267 callers
Method
executeSQL
Execute a SQL query with execution options and optional parameters
src/connectors/interface.ts:253
↓ 232 callers
Function
cn
(...inputs: ClassValue[])
frontend/src/lib/utils.ts:4
↓ 101 callers
Function
loadTomlConfig
()
src/config/toml-loader.ts:15
↓ 92 callers
Function
isReadOnlySQL
(sql: string, connectorType: ConnectorType | string)
src/utils/allowed-keywords.ts:104
↓ 76 callers
Function
stripCommentsAndStrings
(sql: string, dialect?: ConnectorType)
src/utils/sql-parser.ts:204
↓ 67 callers
Method
add
* Add a request to the store * Evicts oldest entry if at capacity
src/requests/store.ts:28
↓ 61 callers
Function
quoteIdentifier
(identifier: string, dbType: ConnectorType)
src/utils/identifier-quoter.ts:23
↓ 55 callers
Method
parse
* Parse a connection string into connector-specific configuration * @param dsn - Database connection string * @param config - Optional database-
src/connectors/interface.ts:118
↓ 51 callers
Function
parseToolResponse
(response: any)
src/tools/__tests__/search-objects.test.ts:30
↓ 50 callers
Function
splitSQLStatements
(sql: string, dialect?: ConnectorType)
src/utils/sql-parser.ts:237
↓ 49 callers
Function
createSearchDatabaseObjectsToolHandler
(sourceId?: string)
src/tools/search-objects.ts:619
↓ 42 callers
Method
connect
Connect to the database using DSN, with optional init script and database-specific configuration
src/connectors/interface.ts:148
↓ 39 callers
Function
createRequest
(overrides: Partial<Request> = {})
src/api/__tests__/requests.integration.test.ts:7
↓ 36 callers
Function
buildDSNFromSource
(source: SourceConfig)
src/config/toml-loader.ts:831
↓ 32 callers
Method
disconnect
Close the connection
src/connectors/interface.ts:151
↓ 27 callers
Function
parseJumpHost
(jumpHostStr: string)
src/utils/ssh-config-parser.ts:261
↓ 26 callers
Function
countParameters
(statement: string)
src/utils/parameter-mapper.ts:91
↓ 25 callers
Function
normalizeSourceId
(id: string)
src/utils/normalize-id.ts:14
↓ 22 callers
Method
applyMaxRows
* Apply maxRows limit to a SELECT query only * * This method is used by PostgreSQL, MySQL, MariaDB, and SQLite connectors which all support *
src/utils/sql-row-limiter.ts:126
↓ 21 callers
Function
buildDSNFromEnvParams
()
src/config/env.ts:157
↓ 21 callers
Function
validateOrigin
( originHeader: string | undefined, hostHeader: string | undefined, allowedHosts: Set<string> )
src/utils/cross-origin.ts:182
↓ 20 callers
Function
resolveHost
()
src/config/env.ts:395
↓ 19 callers
Function
createExecuteSqlToolHandler
(sourceId?: string)
src/tools/execute-sql.ts:36
↓ 18 callers
Method
getConnector
* Get a connector by source ID * If sourceId is not provided, returns the default (first) connector
src/connectors/manager.ts:341
↓ 17 callers
Function
buildAllowedHosts
( configured: string[] = [], bindHost?: string, selfHosts: string[] = [] )
src/utils/cross-origin.ts:134
↓ 17 callers
Function
buildSourceDescriptionPrefix
(description: string | undefined)
src/utils/tool-metadata.ts:63
↓ 16 callers
Function
createRequest
(overrides: Partial<Request> = {})
src/requests/__tests__/store.test.ts:4
↓ 16 callers
Function
parseSSHConfig
( hostAlias: string, configPath: string, options: { requireUser?: boolean } = {} )
src/utils/ssh-config-parser.ts:111
↓ 15 callers
Function
buildZodSchemaFromParameters
( parameters: ParameterConfig[] | undefined )
src/tools/custom-tool-handler.ts:27
↓ 15 callers
Function
classifyConnectionError
( error: unknown, connectorType: ConnectorType, sourceId: string )
src/utils/error-classifier.ts:60
↓ 15 callers
Function
isDriverNotInstalled
(err: unknown, driver: string)
src/utils/module-loader.ts:12
↓ 15 callers
Function
obfuscateDSNPassword
(dsn: string)
src/utils/dsn-obfuscate.ts:91
↓ 15 callers
Function
parseToolResponse
(response: any)
src/tools/__tests__/execute-sql.test.ts:31
↓ 14 callers
Method
connectWithSources
* Initialize and connect to multiple databases using source configurations * This is the new multi-source connection method
src/connectors/manager.ts:44
↓ 13 callers
Function
detectParameterStyle
( statement: string )
src/utils/parameter-mapper.ts:27
↓ 13 callers
Function
looksLikeSSHAlias
(host: string)
src/utils/ssh-config-parser.ts:217
↓ 12 callers
Function
bigIntReplacer
(_key: string, value: any)
src/utils/response-formatter.ts:14
↓ 12 callers
Method
close
* Close the SSH tunnel and clean up resources
src/utils/ssh-tunnel.ts:328
↓ 12 callers
Function
expandHomeDir
* Expand ~ to home directory in paths
src/config/toml-loader.ts:744
↓ 12 callers
Method
getTables
* Get all tables in the database or in a specific schema * @param schema Optional schema name. If not provided, implementation should use the defau
src/connectors/interface.ts:181
↓ 12 callers
Method
hasLimitClause
* Check if a SQL statement already has a LIMIT clause. * Strips comments and string literals first to avoid false positives.
src/utils/sql-row-limiter.ts:20
↓ 11 callers
Method
getAll
* Get requests, optionally filtered by source * Returns newest first
src/requests/store.ts:41
↓ 11 callers
Function
makeJsonRpcCall
(method: string, params: any)
src/__tests__/json-rpc-integration.test.ts:128
↓ 11 callers
Function
resolveJumpHosts
( proxyJump: string, configPath: string, visited: Set<string> = new Set() )
src/utils/ssh-config-parser.ts:365
↓ 10 callers
Function
conflict
(field: string, fieldValue: string, dsnValue: string)
src/config/toml-loader.ts:273
↓ 10 callers
Function
createToolErrorResponse
(error: string, code: string = "ERROR", details?: any)
src/utils/response-formatter.ts:66
↓ 10 callers
Function
parseConnectionInfoFromDSN
(dsn: string)
src/utils/dsn-obfuscate.ts:24
↓ 10 callers
Function
resolveSymlink
(filePath: string)
src/utils/ssh-config-parser.ts:45
↓ 10 callers
Function
startConfigWatcher
(options: ConfigWatcherOptions)
src/utils/config-watcher.ts:23
↓ 9 callers
Function
buildInputSchema
(parameters: ParameterConfig[] | undefined)
src/tools/custom-tool-handler.ts:91
↓ 9 callers
Method
cleanup
* Clean up resources. Closes all SSH clients in reverse order (innermost first).
src/utils/ssh-tunnel.ts:343
↓ 9 callers
Method
clear
* Clear all requests (useful for testing)
src/requests/store.ts:63
↓ 9 callers
Function
createMockManager
(overrides: Partial<Record<string, any>> = {})
src/utils/__tests__/config-watcher.test.ts:19
↓ 9 callers
Function
createOptions
(connectorManager: ConnectorManager, initialTools?: any[])
src/utils/__tests__/config-watcher.test.ts:28
↓ 9 callers
Method
getConnectionUri
()
src/connectors/__tests__/shared/integration-test-base.ts:15
↓ 9 callers
Function
parseCommandLineArgs
()
src/config/env.ts:18
↓ 9 callers
Function
parseJumpHosts
(proxyJump: string)
src/utils/ssh-config-parser.ts:335
↓ 9 callers
Function
quoteQualifiedIdentifier
( tableName: string, schemaName: string | undefined, dbType: ConnectorType )
src/utils/identifier-quoter.ts:66
↓ 9 callers
Function
validateParameterStyle
( statement: string, connectorType: ConnectorType )
src/utils/parameter-mapper.ts:57
↓ 8 callers
Method
establish
* Establish an SSH tunnel, optionally through jump hosts (ProxyJump). * @param config SSH connection configuration * @param options Tunnel optio
src/utils/ssh-tunnel.ts:24
↓ 8 callers
Method
getTableSchema
* Get schema information for a specific table * @param tableName The name of the table to get schema information for * @param schema Optional sc
src/connectors/interface.ts:201
↓ 8 callers
Function
mapArgumentsToArray
( parameters: ParameterConfig[] | undefined, args: Record<string, any> )
src/utils/parameter-mapper.ts:179
↓ 8 callers
Method
prepare
* Prepare a user-facing query statement with BigInt reads enabled, so 64-bit * integer values in the result rows keep full precision. * * bet
src/connectors/sqlite/index.ts:137
↓ 7 callers
Function
onChange
()
frontend/src/hooks/use-mobile.ts:12
↓ 7 callers
Method
queryAll
* Run an introspection query and return all rows. Integers come back as plain * numbers (no `setReadBigInts`), which is what the schema-reading cal
src/connectors/sqlite/index.ts:152
↓ 6 callers
Function
getDatabaseTypeFromDSN
(dsn: string)
src/utils/dsn-obfuscate.ts:175
↓ 6 callers
Function
getRawDSNQueryParam
* Read a query parameter's value from a DSN's raw query string, distinguishing * "absent" (returns null) from "present but empty" (returns ""). * *
src/config/toml-loader.ts:235
↓ 6 callers
Method
getSchemas
* Get all schemas in the database * @returns Promise with array of schema names
src/connectors/interface.ts:157
↓ 6 callers
Method
getSourceConfig
* Get source configuration by ID * @param sourceId - Source ID. If not provided, returns default (first) source config
src/connectors/manager.ts:404
↓ 6 callers
Function
isModuleNotFound
(err: unknown)
src/utils/module-loader.ts:38
↓ 6 callers
Function
likePatternToRegex
* Convert SQL LIKE pattern to JavaScript regex * Supports % (any chars) and _ (single char)
src/tools/search-objects.ts:60
↓ 6 callers
Method
register
* Register a new connector
src/connectors/interface.ts:265
↓ 6 callers
Function
resolveId
()
src/config/env.ts:485
↓ 6 callers
Function
resolveSSHConfig
()
src/config/env.ts:506
↓ 6 callers
Method
stop
()
src/connectors/__tests__/shared/integration-test-base.ts:16
↓ 6 callers
Function
validateParameters
( statement: string, parameters: ParameterConfig[] | undefined, connectorType: ConnectorType )
src/utils/parameter-mapper.ts:153
↓ 5 callers
Function
areAllStatementsReadOnly
(sql: string, connectorType: ConnectorType)
src/utils/__tests__/allowed-keywords.test.ts:8
↓ 5 callers
Function
createSourceConfigFromDSN
* Helper function to create a SourceConfig from a DSN for testing
src/connectors/__tests__/postgres-ssh.integration.test.ts:14
↓ 5 callers
Method
forEachSearchParam
* Helper method to iterate over all parameters * * @param callback - Function to call for each parameter
src/utils/safe-url.ts:145
↓ 5 callers
Function
hasParam
(key: string)
src/config/toml-loader.ts:778
↓ 5 callers
Function
initializeToolRegistry
(config: TomlConfig)
src/tools/registry.ts:274
↓ 5 callers
Function
loadConnectors
( connectorModules: ConnectorModule[] )
src/utils/module-loader.ts:56
↓ 5 callers
Function
plainToken
(i: number)
src/utils/sql-parser.ts:11
↓ 5 callers
Function
resolveDSN
()
src/config/env.ts:232
↓ 5 callers
Function
resolveDefaultSchemas
* Resolve the set of schemas a search should scope to when the caller did not * pass an explicit `schema` filter. * * Prefers the connector's defau
src/tools/search-objects.ts:80
↓ 5 callers
Function
scanDoubleQuotedString
(sql: string, i: number)
src/utils/sql-parser.ts:90
↓ 5 callers
Function
scanSingleQuotedString
(sql: string, i: number)
src/utils/sql-parser.ts:79
↓ 4 callers
Function
createToolSuccessResponse
(data: T, meta: Record<string, any> = {})
src/utils/response-formatter.ts:82
↓ 4 callers
Function
fitString
* Pad or truncate a string to fit a specific width
src/utils/startup-table.ts:76
↓ 4 callers
Function
getDefaultPortForType
(type: ConnectorType)
src/utils/dsn-obfuscate.ts:204
↓ 4 callers
Function
getExecuteSqlMetadata
(sourceId: string)
src/utils/tool-metadata.ts:114
↓ 4 callers
Method
getSampleDSN
* Generate a sample DSN string for this connector type
src/connectors/interface.ts:123
↓ 4 callers
Function
getSearchObjectsMetadata
(sourceId: string)
src/utils/tool-metadata.ts:172
↓ 4 callers
Function
getSelfHosts
()
src/utils/cross-origin.ts:86
↓ 4 callers
Function
getTableComment
* Get table comment from the connector if supported.
src/tools/search-objects.ts:123
↓ 4 callers
Function
getToolRegistry
()
src/tools/registry.ts:282
↓ 4 callers
Function
horizontalLine
* Generate a horizontal line of specified width
src/utils/startup-table.ts:69
↓ 4 callers
Method
isBuiltinTool
* Check if a tool name is a built-in tool
src/tools/registry.ts:25
↓ 4 callers
Method
isValidDSN
* Check if a DSN is valid for this connector
src/connectors/interface.ts:128
↓ 4 callers
Function
parseNonNegativeInteger
(value: string, name: string)
src/config/env.ts:609
next →
1–100 of 717, ranked by callers