sqlc

package
v0.29.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 13 Imported by: 0

README

POSH sqlc provider

Usage

Plugin
package plugin

type Plugin struct {
	l        log.Logger
  cache    cache.Cache
	commands command.Commands
}

func New(l log.Logger) (plugin.Plugin, error) {
	inst := &Plugin{
		l:        l,
		commands: command.Commands{},
	}

	// ...

  inst.commands.MustAdd(sqlc.NewCommand(l, inst.cache))

	// ...

	return inst, nil
}
Config

To install binary locally, add:

sqlc:
  tempDir: .posh/tmp/sqlc
  cacheDirDir: .posh/cache/sqlc
Ownbrew

To install binary locally, add:

ownbrew:
  packages:
    - name: sqlc
      tap: foomo/tap/sqlc-dev/sqlc
      version: 1.28.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(l log.Logger, cache cache.Cache, opts ...CommandOption) (*Command, error)

func (*Command) Complete

func (c *Command) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Command) Description

func (c *Command) Description() string

func (*Command) Execute

func (c *Command) Execute(ctx context.Context, r *readline.Readline) error

func (*Command) Help

func (c *Command) Help(ctx context.Context, r *readline.Readline) string

func (*Command) Name

func (c *Command) Name() string

type CommandOption

type CommandOption func(*Command)

func CommandWithConfigKey

func CommandWithConfigKey(v string) CommandOption

func CommandWithName

func CommandWithName(v string) CommandOption

type Config

type Config struct {
	TempDir  string `json:"tempDir" yaml:"tempDir"`
	CacheDir string `json:"cacheDir" yaml:"cacheDir"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL