MCPcopy Index your code
hub / github.com/helm/helm / NewSQL

Function NewSQL

pkg/storage/driver/sql.go:283–302  ·  view source on GitHub ↗

NewSQL initializes a new sql driver.

(connectionString string, namespace string)

Source from the content-addressed store, hash-verified

281
282// NewSQL initializes a new sql driver.
283func NewSQL(connectionString string, namespace string) (*SQL, error) {
284 db, err := sqlx.Connect(postgreSQLDialect, connectionString)
285 if err != nil {
286 return nil, err
287 }
288
289 driver := &SQL{
290 db: db,
291 statementBuilder: sq.StatementBuilder.PlaceholderFormat(sq.Dollar),
292 }
293
294 if err := driver.ensureDBSetup(); err != nil {
295 return nil, err
296 }
297
298 driver.namespace = namespace
299 driver.SetLogger(slog.Default().Handler())
300
301 return driver, nil
302}
303
304// Get returns the release named by key.
305func (s *SQL) Get(key string) (release.Releaser, error) {

Callers 1

InitMethod · 0.92

Calls 2

ensureDBSetupMethod · 0.95
SetLoggerMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…