driver

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The database connection string
	Dsn string
	// The database schemas to generate models for
	Schemas pq.StringArray
	// The name of this schema will not be included in the generated models
	// a context value can then be used to set the schema at runtime
	// useful for multi-tenant setups
	SharedSchema string `yaml:"shared_schema"`
	// List of tables that will be included. Others are ignored
	Only map[string][]string
	// List of tables that will be should be ignored. Others are included
	Except map[string][]string
	// How many tables to fetch in parallel
	Concurrency int
	// Which UUID package to use (gofrs or google)
	UUIDPkg string `yaml:"uuid_pkg"`
	// Which `database/sql` driver to use (the full module name)
	DriverName string `yaml:"driver_name"`

	// The name of the folder to output the models package to
	Output string
	// The name you wish to assign to your generated models package
	Pkgname   string
	NoFactory bool `yaml:"no_factory"`
}

type DBInfo

type DBInfo = drivers.DBInfo[any, any, IndexExtra]

type Enum

type Enum struct {
	Schema string
	Name   string
	Type   string
	Values pq.StringArray
}

type IndexExtra added in v0.29.0

type IndexExtra = struct {
	NullsFirst    []bool   `json:"nulls_first"` // same length as Columns
	NullsDistinct bool     `json:"nulls_not_distinct"`
	Where         string   `json:"where_clause"`
	Include       []string `json:"include"`
}

type Interface

type Interface = drivers.Interface[any, any, IndexExtra]

func New

func New(config Config) Interface

Jump to

Keyboard shortcuts

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