Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidDatabase = errors.New("database must be managed or have a non-empty URI")
View Source
var ErrManagedDatabaseNoAuthToken = errors.New(`managed databases require an auth token
If you don't have an auth token, you can create one from the sqlc Cloud
dashboard at https://dashboard.sqlc.dev/. If you have an auth token, ensure
you've set it as the value of the SQLC_AUTH_TOKEN environment variable.`)
View Source
var ErrManagedDatabaseNoProject = errors.New(`managed databases require a cloud project
If you don't have a project, you can create one from the sqlc Cloud
dashboard at https://dashboard.sqlc.dev/. If you have a project, ensure
you've set its id as the value of the "project" field within the "cloud"
section of your sqlc configuration. The id will look similar to
"01HA8TWGMYPHK0V2GGMB3R2TP9".`)
View Source
var ErrMissingEngine = errors.New("unknown engine")
View Source
var ErrMissingVersion = errors.New("no version number")
View Source
var ErrNoPackagePath = errors.New("missing package path")
View Source
var ErrNoPackages = errors.New("no packages")
View Source
var ErrNoQuerierType = errors.New("no querier emit type enabled")
View Source
var ErrUnknownEngine = errors.New("invalid engine")
View Source
var ErrUnknownVersion = errors.New("invalid version number")
Functions ¶
func IsAndurelLock ¶ added in v0.3.0
IsAndurelLock reports whether name is the Andurel project lock file.
Types ¶
type CombinedSettings ¶
func Combine ¶
func Combine(conf Config, pkg SQL) CombinedSettings
type Config ¶
type Config struct {
Version string `json:"version" yaml:"version"`
Cloud Cloud `json:"cloud" yaml:"cloud"`
Servers []Server `json:"servers" yaml:"servers"`
SQL []SQL `json:"sql" yaml:"sql"`
Overrides Overrides `json:"overrides" yaml:"overrides"`
Rules []Rule `json:"rules" yaml:"rules"`
}
func FromAndurelLock ¶ added in v0.3.0
FromAndurelLock builds a narsilc Config from an andurel.lock document. Paths, package, sql_package (pgx/v5), and Andurel row mapping are fixed. User choices are databaseConfig.engine and databaseConfig.nullType.
type Overrides ¶
type Overrides struct {
Go *golang.GlobalOptions `json:"go,omitempty" yaml:"go"`
}
type SQL ¶
type SQL struct {
Name string `json:"name" yaml:"name"`
Engine Engine `json:"engine,omitempty" yaml:"engine"`
Schema Paths `json:"schema" yaml:"schema"`
Queries Paths `json:"queries" yaml:"queries"`
Database *Database `json:"database" yaml:"database"`
StrictFunctionChecks bool `json:"strict_function_checks" yaml:"strict_function_checks"`
StrictOrderBy *bool `json:"strict_order_by" yaml:"strict_order_by"`
Gen SQLGen `json:"gen" yaml:"gen"`
Rules []string `json:"rules" yaml:"rules"`
Analyzer Analyzer `json:"analyzer" yaml:"analyzer"`
}
type V1GenerateSettings ¶
type V1GenerateSettings struct {
Version string `json:"version" yaml:"version"`
Cloud Cloud `json:"cloud" yaml:"cloud"`
Packages []v1PackageSettings `json:"packages" yaml:"packages"`
Overrides []golang.Override `json:"overrides,omitempty" yaml:"overrides,omitempty"`
Rename map[string]string `json:"rename,omitempty" yaml:"rename,omitempty"`
Rules []Rule `json:"rules" yaml:"rules"`
}
func (*V1GenerateSettings) Translate ¶
func (c *V1GenerateSettings) Translate() Config
func (*V1GenerateSettings) ValidateGlobalOverrides ¶
func (c *V1GenerateSettings) ValidateGlobalOverrides() error
Click to show internal directories.
Click to hide internal directories.