command
Version:
v0.4.4
Opens a new window with list of versions in this module.
Published: Jul 19, 2026
License: MIT
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Basic Example
This example introduces the ORM in a few minutes.
It shows:
Open()
Ping()
Close()
Create
Find
Update
Delete
- explicit Raw SQL via
WithoutPolicy()
- a simple lifecycle hook
- request-scoped context usage
Raw SQL uses generic ? placeholders and participates in the current transaction automatically:
err := db.Raw(ctx, `SELECT * FROM users WHERE email = ?`, email).
WithoutPolicy().
Scan(&users)
Run it with:
export DORM_EXAMPLE_DSN='host=localhost port=5432 dbname=dorm user=postgres password=postgres sslmode=disable'
go run ./examples/basic
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.