 Documentation
      ¶
      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 ErrNoOutPath = errors.New("no output path")
    
      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 ErrPluginBothTypes = errors.New("plugin: `process` and `wasm` cannot both be defined")
    
      View Source
      
  
    var ErrPluginBuiltin = errors.New("a built-in plugin with that name already exists")
    
      View Source
      
  
    var ErrPluginExists = errors.New("a plugin with that name already exists")
    
      View Source
      
  
    var ErrPluginNoName = errors.New("missing plugin name")
    
      View Source
      
  
    var ErrPluginNoType = errors.New("plugin: field `process` or `wasm` required")
    
      View Source
      
  
    var ErrPluginNotFound = errors.New("no plugin found")
    
      View Source
      
  
    var ErrPluginProcessNoCmd = errors.New("plugin: missing process command")
    
      View Source
      
  
    var ErrUnknownEngine = errors.New("invalid engine")
    
      View Source
      
  
var ErrUnknownVersion = errors.New("invalid version number")
    Functions ¶
Types ¶
type Codegen ¶
type Codegen struct {
	Out     string    `json:"out" yaml:"out"`
	Plugin  string    `json:"plugin" yaml:"plugin"`
	Options yaml.Node `json:"options" yaml:"options"`
}
    TODO: Figure out a better name for this
type CombinedSettings ¶
type CombinedSettings struct {
	Global  Config
	Package SQL
	Go      golang.Options
	JSON    SQLJSON
	// TODO: Combine these into a more usable type
	Codegen Codegen
}
    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,omitempty" yaml:"overrides"`
	Plugins   []Plugin             `json:"plugins" yaml:"plugins"`
	Rules     []Rule               `json:"rules" yaml:"rules"`
	Options   map[string]yaml.Node `json:"options" yaml:"options"`
}
    type Overrides ¶
type Overrides struct {
	Go *golang.GlobalOptions `json:"go,omitempty" yaml:"go"`
}
    type Plugin ¶
type Plugin struct {
	Name    string   `json:"name" yaml:"name"`
	Env     []string `json:"env" yaml:"env"`
	Process *struct {
		Cmd string `json:"cmd" yaml:"cmd"`
	} `json:"process" yaml:"process"`
	WASM *struct {
		URL    string `json:"url" yaml:"url"`
		SHA256 string `json:"sha256" yaml:"sha256"`
	} `json:"wasm" yaml:"wasm"`
}
    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"`
	Codegen              []Codegen `json:"codegen" yaml:"codegen"`
	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.