No description
  • Go 61.1%
  • HTML 36.9%
  • Shell 1.4%
  • Makefile 0.6%
Find a file
oss-core-libraries-dashboard[bot] 3d436476a0
[COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2026-04-02 08:39:10 +05:30
.github Add PCI pull request template (#67) 2025-05-23 14:35:39 -04:00
coverage feat: refact DeleteItems(...) to batch deletes 2024-07-29 09:08:19 -04:00
docs feat: refactor CreateItems(...) to batch inserts (#55) 2024-07-16 12:33:17 -04:00
internal [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
scripts [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
tools [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
.copywrite.hcl chore: fix copywrite config hcl 2023-09-05 06:51:59 -04:00
.gitignore chore: add coverage reporting (#40) 2023-08-28 12:33:02 -04:00
backoff.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
backoff_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
buf.gen.yaml [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
buf.yaml [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
CHANGELOG.md Add Dialect to Reader and Writer (#25) 2022-09-10 09:57:38 -04:00
clause.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
CODEOWNERS Update CODEOWNERS (#62) 2024-11-19 11:38:18 -08:00
common.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
common_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
common_unexported_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
CONTRIBUTING.md Initial refactor from HashiCorp Boundary code base (#1) 2021-12-07 17:43:34 -05:00
create.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
create_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
create_unexported_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
db.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
db_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
db_unexported_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
delete.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
delete_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
do_tx.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
do_tx_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
docker-compose.yml [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
docs.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
error.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
go.mod chore: update use of jackc pgconn to address CVE GHSA-jqcq-xjh3-6g23 (#70) 2026-03-18 15:22:16 -04:00
go.sum chore: update use of jackc pgconn to address CVE GHSA-jqcq-xjh3-6g23 (#70) 2026-03-18 15:22:16 -04:00
id.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
id_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
LICENSE [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
lookup.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
lookup_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
Makefile chore (workflows): add make-gen-delta workflow (#44) 2023-10-02 15:29:10 -04:00
option.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
option_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
query.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
query_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
reader.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
README.md chore: add coverage reporting (#40) 2023-08-28 12:33:02 -04:00
rw.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
rw_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
rw_unexported_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
testing.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
testing_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
transactions.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
transactions_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
update.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
update_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
update_unexported_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30
writer.go [COMPLIANCE] Update Copyright and License Headers (Batch 1 of 1) (#69) 2026-04-02 08:39:10 +05:30

dbw package

Go Reference Go Report Card Go Coverage

dbw is a database wrapper that supports connecting and using any database with a GORM driver.

dbw is intended to completely encapsulate an application's access to its database with the exception of migrations. dbw is intentionally not an ORM and it removes typical ORM abstractions like "advanced query building", associations and migrations.

Of course you can use dbw for complicated queries, it's just that dbw doesn't try to reinvent SQL by providing some sort of pattern for building them with functions. Of course, dbw also provides lookup/search functions when you simply need to read resources from the database.

dbw strives to make CRUD for database resources fairly trivial for common use cases. It also supports an WithOnConflict(...) option for its RW.Create(...) function for complex scenarios. dbw also allows you to opt out of its CRUD functions and use exec, query and scan rows directly. You may want to carefully weigh when it's appropriate to use exec and query directly, since it's likely that each time you use them you're leaking a bit of your database layer schema into your application's domain.