Bun returns the singleton database connection through the bun library. bun is the database library we have decided to use for new code in the future due to its superior composability over bare SQL, and its superior flexibility over e.g. gorm. New code should not use the old bare SQL tooling.
()
| 83 | // over bare SQL, and its superior flexibility over e.g. gorm. New code should not use the old bare |
| 84 | // SQL tooling. |
| 85 | func Bun() *bun.DB { |
| 86 | if theOneBun == nil { |
| 87 | panic("Bun is not yet initialized! Did you use the database before initializing it?") |
| 88 | } |
| 89 | return theOneBun |
| 90 | } |
| 91 | |
| 92 | // SingleDB returns a singleton database client. Bun() should be preferred over this for all new |
| 93 | // queries. |
no outgoing calls