sqlx

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Example
package main

import (
	"context"
	"os"
	"path/filepath"

	"github.com/xoctopus/genx/pkg/genx"
	"github.com/xoctopus/x/misc/must"

	_ "github.com/xoctopus/sqlx/devpkg/sqlx/v1"
)

func main() {
	cwd := must.NoErrorV(os.Getwd())

	entry := filepath.Join(cwd, "..", "..", "..", "testdata")

	ctx := genx.NewContext(&genx.Args{
		Entrypoint: []string{
			entry,
			filepath.Join(entry, "v2"),
		},
	})

	if err := ctx.Execute(context.Background(), genx.Get()...); err != nil {
		panic(err)
	}

}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr added in v0.0.3

type Attr string
const (
	// AttrTableName defines model's table name to extend TableName method
	AttrTableName Attr = "TableName"
	// AttrRegister defines model's catalog to register table
	AttrRegister Attr = "Register"
)

func HasAttr added in v0.0.3

func HasAttr(x string) Attr

type Model

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

func NewModel

func NewModel(g genx.Context, t types.Type) *Model

func (*Model) CommentOf added in v0.0.3

func (m *Model) CommentOf(ref string) s.Snippet

func (*Model) CreationMarker added in v0.0.3

func (m *Model) CreationMarker() s.Snippet

func (*Model) DeletionMarker added in v0.0.3

func (m *Model) DeletionMarker() s.Snippet

func (*Model) HasSoftDeletion added in v0.0.3

func (m *Model) HasSoftDeletion() bool

func (*Model) Ident added in v0.0.3

func (m *Model) Ident() s.Snippet

func (*Model) IndexList

func (m *Model) IndexList(unique bool) s.Snippet

func (*Model) ModeledCT

func (m *Model) ModeledCT(ctx context.Context, t typx.Type) s.Snippet

func (*Model) ModeledColDefList

func (m *Model) ModeledColDefList(ctx context.Context) s.Snippet

func (*Model) ModeledColInitList

func (m *Model) ModeledColInitList(ctx context.Context) s.Snippet

func (*Model) ModeledKeyDefList

func (m *Model) ModeledKeyDefList(ctx context.Context) s.Snippet

func (*Model) ModeledKeyInitList

func (m *Model) ModeledKeyInitList(_ context.Context) s.Snippet

func (*Model) ModeledM

func (m *Model) ModeledM(ctx context.Context) s.Snippet

func (*Model) ModeledTCol

func (m *Model) ModeledTCol(ctx context.Context, t typx.Type) s.Snippet

func (*Model) ModeledTable

func (m *Model) ModeledTable(ctx context.Context) s.Snippet

func (*Model) ModificationMarker added in v0.0.3

func (m *Model) ModificationMarker() s.Snippet

func (*Model) PrimaryColList

func (m *Model) PrimaryColList() s.Snippet

func (*Model) Register added in v0.0.3

func (m *Model) Register() s.Snippet

func (*Model) SoftDeletionCondition added in v0.0.3

func (m *Model) SoftDeletionCondition(ctx context.Context) s.Snippet

func (*Model) String added in v0.0.3

func (m *Model) String() string

func (*Model) TableDesc

func (m *Model) TableDesc() s.Snippet

func (*Model) TableName

func (m *Model) TableName() s.Snippet

func (*Model) UniqueConditions added in v0.0.3

func (m *Model) UniqueConditions(ctx context.Context, names []string) s.Snippet

func (*Model) UniqueFields added in v0.0.3

func (m *Model) UniqueFields(names []string) s.Snippet

func (*Model) UniqueNames added in v0.0.3

func (m *Model) UniqueNames() [][]string

Jump to

Keyboard shortcuts

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