Discover Packages
github.com/colmpat/words-that-matter
pkg
db
package
Version:
v0.0.0-...-e7141a1
Opens a new window with list of versions in this module.
Published: Dec 18, 2023
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
GetDeckWithTotals returns a Deck with the totals for the given word counts
func InitDB(prodDSN, stagingDSN string )
InitDB initializes the global database instances
var (
ProdDB *DB
StagingDB *DB
)
MakeDB makes a new DB instance from a DSN using the pg driver
NewDB returns a new DB instance. Creates a background context for queries.
Transact executes the given function in a transaction. If the function returns an error, the transaction is rolled back. If the function panics, the transaction is rolled back and the panic is re-thrown.
UploadMedia uploads a media file to the database with the given metadata and word counts. Does so in a transaction for atomicity.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.