Documentation
¶
Index ¶
- Constants
- func AccessContext(userID, companyID, workspaceID string) context.Context
- func ApplySchema(t testing.TB, project *itest.Project, s *schema.Schema)
- func BuildSchema(t testing.TB, project *itest.Project) *schema.Schema
- func ExecSQL(t testing.TB, db *sql.DB, stmt string, args ...any)
- func OpenDB(t testing.TB, project *itest.Project, obs orm.ObservabilityConfig) *dorm.DB
- func StringID(prefix string, n int) string
- func TracingConfig(enabled bool) orm.ObservabilityConfig
- func WriteModels(t testing.TB, project *itest.Project, source string)
- type AuditRecord
- type Company
- type Fixture
- type NopSpan
- type NopTracer
- type NopTracerProvider
- type Product
- type Role
- type User
Constants ¶
View Source
const AppModelsSource = `package models
import "time"
type Company struct {
ID string ` + "`orm:\"pk\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
type User struct {
ID string ` + "`orm:\"pk\"`" + `
CompanyID string ` + "`orm:\"company\"`" + `
Email string ` + "`orm:\"unique\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
type Product struct {
ID string ` + "`orm:\"pk\"`" + `
CompanyID string ` + "`orm:\"company\"`" + `
WorkspaceID string ` + "`orm:\"workspace\"`" + `
SKU string ` + "`orm:\"unique\"`" + `
Name string
Description string
DeletedAt *time.Time ` + "`orm:\"soft_delete\"`" + `
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
type AuditRecord struct {
ID string ` + "`orm:\"pk\"`" + `
CompanyID string ` + "`orm:\"company\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
CreatedBy string ` + "`orm:\"created_by\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
UpdatedBy string ` + "`orm:\"updated_by\"`" + `
}
type Role struct {
ID string ` + "`orm:\"pk\"`" + `
Code string ` + "`orm:\"unique\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
`
View Source
const MigrationModelsSourceV2 = `package models
import "time"
type Company struct {
ID string ` + "`orm:\"pk\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
type User struct {
ID string ` + "`orm:\"pk\"`" + `
CompanyID string ` + "`orm:\"company\"`" + `
Email string ` + "`orm:\"unique\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
type Product struct {
ID string ` + "`orm:\"pk\"`" + `
CompanyID string ` + "`orm:\"company\"`" + `
WorkspaceID string ` + "`orm:\"workspace\"`" + `
SKU string ` + "`orm:\"unique\"`" + `
Name string
Description string
Category string
DeletedAt *time.Time ` + "`orm:\"soft_delete\"`" + `
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
type AuditRecord struct {
ID string ` + "`orm:\"pk\"`" + `
CompanyID string ` + "`orm:\"company\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
CreatedBy string ` + "`orm:\"created_by\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
UpdatedBy string ` + "`orm:\"updated_by\"`" + `
}
type Role struct {
ID string ` + "`orm:\"pk\"`" + `
Code string ` + "`orm:\"unique\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
`
View Source
const SeedModelsSource = `package models
import "time"
type Role struct {
ID string ` + "`orm:\"pk\"`" + `
Code string ` + "`orm:\"unique\"`" + `
Name string
CreatedAt time.Time ` + "`orm:\"created_at\"`" + `
UpdatedAt time.Time ` + "`orm:\"updated_at\"`" + `
}
`
Variables ¶
This section is empty.
Functions ¶
func AccessContext ¶
func TracingConfig ¶
func TracingConfig(enabled bool) orm.ObservabilityConfig
Types ¶
type AuditRecord ¶
type NopTracerProvider ¶
type NopTracerProvider struct{}
Click to show internal directories.
Click to hide internal directories.