package
0.0.0-20240624235250-9e89dfb7520d
Repository: https://github.com/tailscale/pkgsitelib.git
Documentation: pkg.go.dev
# Functions
Collect1 runs the query, which must select for a single column that can be scanned into a value of type T, and returns a slice of the resulting values.
No description provided by the author
CollectStructs scans the rows from the query into structs and returns a slice of them.
ConnectAndExecute connects to the postgres database specified by uri and executes dbFunc, then cleans up the database connection.
CopyFromChan returns a CopyFromSource that gets its rows from a channel.
CreateDB creates a new database dbName.
CreateDBIfNotExists checks whether the given dbName is an existing database, and creates one if not.
DBConnURI generates a postgres connection string in URI format.
DropDB drops the database named dbName.
New creates a new DB from a sql.DB.
NullIsEmpty returns a sql.Scanner that writes the empty string to s if the sql.Value is NULL.
NullPtr is for scanning nullable database columns into pointer variables or fields.
Open creates a new DB for the given connection string.
RegisterOCWrapper registers a driver that wraps the OpenCensus driver, which in turn wraps the driver named as the first argument.
ResetDB truncates all data from the given test DB.
StructScanner returns a function that, when called on a struct pointer of its argument type, returns a slice of arguments suitable for Row.Scan or Rows.Scan.
TryToMigrate attempts to migrate the database named dbName to the latest migration.
# Constants
No description provided by the author
# Variables
QueryLoggingDisabled stops logging of queries when true.
# Type aliases
MultiErr can be used to combine one or more errors into a single error.