MCPcopy Index your code
hub / github.com/bytebase/bytebase / ConvertToSQLIsolation

Function ConvertToSQLIsolation

backend/plugin/parser/base/transaction_mode.go:97–110  ·  view source on GitHub ↗

ConvertToSQLIsolation converts our IsolationLevel to database/sql.IsolationLevel

(level common.IsolationLevel)

Source from the content-addressed store, hash-verified

95
96// ConvertToSQLIsolation converts our IsolationLevel to database/sql.IsolationLevel
97func ConvertToSQLIsolation(level common.IsolationLevel) sql.IsolationLevel {
98 switch level {
99 case common.IsolationLevelReadUncommitted:
100 return sql.LevelReadUncommitted
101 case common.IsolationLevelReadCommitted:
102 return sql.LevelReadCommitted
103 case common.IsolationLevelRepeatableRead:
104 return sql.LevelRepeatableRead
105 case common.IsolationLevelSerializable:
106 return sql.LevelSerializable
107 default:
108 return sql.LevelDefault
109 }
110}
111
112// CleanDirectives removes all Bytebase directive comments from a SQL statement.
113// This includes: -- txn-mode, -- txn-isolation, -- ghost

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected