BuildUpdatePaths takes a map of field names to field values, field masks, fields allowed to be zero value, and returns both a list of field names to update and a list of field names that should be set to null.
Clear sets fields in the value pointed to by i to their zero value.
Expr creates an expression value (ExprValue) which can be used when setting column values for database operations.
GetOpts - iterate the inbound Options and return a struct.
InitNonCreatableFields sets the fields which are not setable using via RW.Create(...).
InitNonUpdatableFields sets the fields which are not updatable using via RW.Update(...).
Intersection is a case-insensitive search for intersecting values.
New creates a new RW using an open DB.
NewId creates a new random base62 ID with the provided prefix with an underscore delimiter.
NonCreatableFields returns the current set of fields which are not setable using via RW.Create(...).
NonUpdatableFields returns the current set of fields which are not updatable using via RW.Update(...).
Open a database connection which is long-lived.
OpenWith will open a database connection using a Dialector which is long-lived.
SetColumns defines a list of column (names) to update using the set of proposed insert columns during an on conflict update.
SetColumnValues defines a map from column names to values for database operations.
StringToDbType provides a string to type conversion.
TestCreateTables will create the test tables for the dbw pkg.
TestSetup is typically called before starting a test and will setup the database for the test (initialize the database one-time).
TestSetupWithMock will return a test DB and an associated Sqlmock which can be used to mock out the db responses.
UpdateFields will create a map[string]interface of the update values to be sent to the db.
WithAfterWrite provides and option to provide a func to be called after a write operation.
WithBatchSize specifies an option for setting the batch size for bulk operations like CreateItems.
WithBeforeWrite provides and option to provide a func to be called before a write operation.
WithDebug specifies the given operation should invoke debug mode for the database output.
WithFieldMaskPaths provides an option to provide field mask paths for update operations.
WithLimit provides an option to provide a limit.
WithLogger specifies an optional hclog to use for db operations.
WithLogLevel specifies an option for setting the log level.
WithLookup enables a lookup after a write operation.
WithMaxOpenConnections specifies and optional max open connections for the database.
WithMinOpenConnections specifies and optional min open connections for the database.
WithNullPaths provides an option to provide null paths for update operations.
WithOnConflict specifies an optional on conflict criteria which specify alternative actions to take when an insert results in a unique constraint or exclusion constraint error.
WithOrder provides an option to provide an order when searching and looking up.
WithPrngValues provides an option to provide values to seed an PRNG when generating IDs.
WithReturnRowsAffected specifies an option for returning the rows affected and typically used with "bulk" write operations.
WithSkipVetForWrite provides an option to allow skipping vet checks to allow testing lower-level SQL triggers and constraints.
WithTable specifies an option for setting a table name to use for the operation.
WithTestDatabaseUrl provides a way to specify an existing database for tests.
WithTestDialect provides a way to specify the test database dialect.
WithTestMigration provides a way to specify an option func which runs a required database migration to initialize the database.
WithTestMigrationUsingDB provides a way to specify an option func which runs a required database migration to initialize the database using an existing open sql.DB.
WithVersion provides an option version number for update operations.
WithWhere provides an option to provide a where clause with arguments for an operation.