MCPcopy Index your code
hub / github.com/rilldata/rill / getDB

Method getDB

admin/database/postgres/tx.go:58–64  ·  view source on GitHub ↗

getDB either returns the current tx (if one is present) or c.db.

(ctx context.Context)

Source from the content-addressed store, hash-verified

56
57// getDB either returns the current tx (if one is present) or c.db.
58func (c *connection) getDB(ctx context.Context) dbHandle {
59 tx := txFromContext(ctx)
60 if tx == nil {
61 return c.db
62 }
63 return tx
64}
65
66// noopTx implements a database.Tx that does nothing on Commit/Rollback.
67// It is used in nested transactions to avoid committing too early.

Calls 1

txFromContextFunction · 0.85

Tested by

no test coverage detected