MCPcopy Index your code
hub / github.com/coder/coder / New

Function New

coderd/database/db.go:58–71  ·  view source on GitHub ↗

New creates a new database store using a SQL database connection.

(sdb *sql.DB, opts ...func(*sqlQuerier))

Source from the content-addressed store, hash-verified

56
57// New creates a new database store using a SQL database connection.
58func New(sdb *sql.DB, opts ...func(*sqlQuerier)) Store {
59 dbx := sqlx.NewDb(sdb, "postgres")
60 q := &sqlQuerier{
61 db: dbx,
62 sdb: dbx,
63 // This is an arbitrary number.
64 serialRetryCount: 3,
65 }
66
67 for _, opt := range opts {
68 opt(q)
69 }
70 return q
71}
72
73// TxOptions is used to pass some execution metadata to the callers.
74// Ideally we could throw this into a context, but no context is used for

Calls

no outgoing calls